This is a LUA program for ESP8266 publishing MH-Z19 CO2 measurements via MQTT to a broker.
- A ESP8266 board
- A MH-Z19 CO2 sensor module
- Serial connection to ESP8266
For example a WeMos D1 Mini can be used as it is very convenient to work with. It offers 32 Mbits of flash memory and has got a serial to usb converter.
- LUA dump function for data structures from https://stackoverflow.com/a/27028488
- Documentation on init.lua from https://nodemcu.readthedocs.io/en/master/en/upload/#initlua
- A simple connected object with NodeMCU and MQTT tutorial on https://www.foobarflies.io/a-simple-connected-object-with-nodemcu-and-mqtt/