ESP8266/ESP32 reading temperature, airpressure, humidity and lux with a BME280 and BH1750
The following repositories were used for this project. Please notice that some of these are still under development. Use at your own risk!
After doing some prototyping with my ESP8266, I found out that doing Websockets with the ESP works quite reliable. Please consider using differnet approaches serving multi clients/sensors with the ArduinoWebsockets lib. (Maybe AsyncWebserver?) Also both sensor libs can easily be used with the ESP32 and ESP8266.
The Bosch BME280 is a 3 in 1 temperature/humidity/airpressure sensor and the BH1750 is a digital light sensor. Hooking up different I2C sensors to the NES controller is quite easy because of the female pin headers.
Thanks to this great library (bbx10’s arduinoWebsockets) it is now possible to send data from any sensor to any client with Websockets (At least with the Arduino core lib. There already are working esp-idf implementations). Use the ESP32 tree for this to work. Besides using POST and GET HTTP Requests with the ESP, Websockets initiate a persistant connection. This can be used to send live sensor data via WiFi to a browser dashboard or app. Actually one could also send the data with the build in RFM69, but that’s another story 😉