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.
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.
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.