ESP32 Board communicating with a BME680 breakout over I2C and publishing environmental data to an MQTT broker.
This Arduino IDE project is the code to power an ESP32 Thing connected via I2C to a BME680 environmental sensor. The microcontroller connects to your WiFi network and publishes to an MQTT broker of your choice at a configurable interval.
This was purpose-built to be used in conjunction with other MQTT-compatible software… In this case, Home Assistant, but the same setup will work with anything similar.
dialout
group.LED | Meaning | Actions |
---|---|---|
Off | No power or starting up. | Check power and wait at least 30 seconds. |
Flashes once, with 2 seconds in between | BME680 wasn’t found | Make sure the BME680 is wired in and working. If using a non-standard I2C mode, you may have to update the BME680_I2C_MODE configuration. |
Flashes twice | WiFi error | Make sure wifi can reach the ESP32, and the NETWORK_ID/PASSWORD configuration is correct. |
Flashes Trebly | MQTT client error | Make sure your MQTT broker is running and the connection settings are correct. |
Lit Steady | No Error | Have some tea. Relax. Read a book. |
All other issues should be debugged using the IDE, with the DEBUG constant defined for verbose output to the console. Make sure to set the baud rate in the IDE to match SERIAL_SPEED (115200 unless changed).