03-11-2021 09:21 AM
Good morning,
I have successfully developed and tested this sketch (https://github.com/jordan1982/temperaturino) on d1 mini. Then I bought a new d1 mini and a new sensor bme680, loaded the sketch but at startup it goes into error with the following error: BME680 error code: -2
I tried to change the line "iaqSensor.begin (BME680_I2C_ADDR_SECONDARY, Wire);" to BME680_I2C_ADDR_PRIMARY, but the sensor fails. I get the same error with the basic sketch included in the library. Can someone help me? Thank you
Solved! Go to Solution.
03-11-2021 11:36 PM
Hello Jordan,
Please check below.
You need to connect SDO with GND if you want to use secondary i2c address.
Thanks,
03-12-2021 09:28 AM
Thanks for the reply. I used the same type of wiring used for the other sensor that currently works. I just want to fix the error (error code:-2) and not change the address. Can you help me?
03-12-2021 04:55 PM
Hello Jordan,
I'm just confused a little bit, so please give me a chance to clarify your problem.
1) When you change your addresss as BME680_I2C_ADDR_SECONDARY or BME680_I2C_ADDR_PRIMARY, does your system work?
If yes, your hardware interface is configured as I mentioned, and unfortunately, you should use the address unless you change your hardware configuration.
Please let me know if you have any questions.
Thanks,
03-12-2021 05:48 PM
when do you get the error code -2? The functions you reference are all void(), so there is no clue whether you are initializating the BME680 properly at all.
As previous boards D1 / BME680 did work, so how about:
- different vendor of BME680 module. I had this myself, that one module was with 0x77 and one with 0x76 address.
- why not changing boards between working setup and non working one until it works?
Use the Adafruit_BME680 library in the Arduino IDE to avoid any mistakes from implementaions in your library for config.
I can only recommend to get rid of all wifimanager, json etc, to just have the PURE code to interface with BME680 and then one can easier debug it.
rgds