Problem with BME280 sensor


#1

Help needed to get I2C sensor running. I can’t get any of my BME280 (3.3v) modules to work.
I keep getting error: [Thread 1 exited with exception InvalidHardwareStatusError @[003A:005E:0042:000D:0040:004A:0000:0020]]
I have triple checked if I have correctly connected SDA/SCL pins and all seems to be correct.
Actually I get the same error even without the sensor connected. Can it be a drivers issue? Am I doing something wrong?
Please help me to troubleshoot this. Code that I use is from the Example here: https://docs.zerynth.com/latest/official/lib.bosch.bme280/examples/examples.html


#2

Hi there @Edgars_Rozentals :slight_smile:

The InvalidHardwareStatusError means that the board cannot communicate with the sensor. So let’s investigate.

It seems to me that you are using a DOIT ESP32, if check from Zerynth Studio the pinout (third icon on the right of the device selection: image).

At the bottom of the page, pick Peripherals view:
image

From there, you can see which I2C pins are available, and the corresponding number in Zerynth:

For instance, you can connect SDA to pin D18, and connect SCL to pin D19.
After that, change your code to use I2C2 instead of I2C0.

Let me know how it goes,
regards,
Antonio.


Waveshare BME280
#3

@a.pitasi thanks a lot!
Indeed the pinout diagram that was included in the box with my ESP32 dev kitt was completeley wrong. There is no title that says that it is DOIT board, but apparnetly it is. I had registered it as NodeMCU.
I connected to I2C2 as you sugested and it works perfectly!


#4

It probably is some kind of clone. Glad to hear that it works now :smiley: