I have an Electron and connected the HTU21D temp and humidity sensor to it directly on the D0 and D1 pins.
When I run the sample sketch from https://build.particle.io/libs/53edeb4ccf314539c90003a4/tab/HTU21D.ino then it all works fine, but as soon as I use SLEEP_NETWORK_STANDBY to put the Electron to sleep, then the HTU21D reports 998 values - which is the equivalent of I2C connection errors.
If I use normal sleep (which restarts), then it works.
See code below.
The sample sketch of HTU21D with normal sleep - which sleeps restarts and reconnects to the cloud at each iteration works, at each iteration it reads the correct values from the HTU21D:
Thanks for the suggestion, I have just tried this.
The first round is fine - temp and humidity collected, but after sleep when it comes back it never finds the HTU21D, just keep printing the "HTU21D not found" forever.
Opening serial monitor for com port: "/dev/ttyACM0"
HTU21D test
HTU21D OK
===================
Hum:31.09
Temp:26.15
il@laptop ~/firmware/modules $ particle serial monitor
Opening serial monitor for com port: "/dev/ttyACM0"
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found
HTU21D not found