Go Down

Topic: Issue when trying to talk to HTU21D module on Heltec WiFi LoRa 32 (Read 108 times) previous topic - next topic

headcloudmonkey

I'm having an issue where the combination of LoRa and HTU21D libraries seem to step on each other.

The attached sketch should init the Adafruit HTU21D driver (it does), OLED display (it does), then the LoRa (it does).

After that it seems to function correctly on those except it hangs reading the temperature.

Any help is greatly appreciated.

Thanks,
Dan


LC200

Hi

Does it work okay if you just initialise the HTU21D?

It could be a timing issue which I've come across before, try going into the Adafruit library for the HTU21D in the readTemperature method and try increasing the delay on the read from 50 to 100.

There are some odd or perhaps fake HTU21Ds which I've found lock up if they are read too fast after the request to read, funnily enough ones bought from reputable suppliers (i.e. not Ebay) have always worked within the datasheet specification.

Hope that helps.




srnet

After that it seems to function correctly on those except it hangs reading the temperature.
So when you ONLY run the code for the HTU21D it also fails to read the temperature ?
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

headcloudmonkey

Hi,

If I just initialise the HTU21D, I can read temp and humidity without issues. It only becomes an issue when I initialise the other parts of the board (display, LoRa).

I'll dig into the timing as suggested. These are good HTU21D units from Adafruit, and I've used them on other projects without issue (ESP8266-12S and ESP32-WROOM based) with wifi enabled.

I have emailed Heltec with a query for example code for other I2C devices, but nothing back from them in over a month.

Thanks
Dan

Go Up