This LUA script is for ESP8266 hardware.
Send SW420 data (level and amplitude) through an ESP8266 to a MQTT broker.
config.lua
: Configuration variablesinit.lua
: Connect to a wifi AP and then execute main.luamain.lua
: Main file
- Connect to a wifi AP
- Start a MQTT client and try to connect to a MQTT broker
- Publish data (level and amplitude) to MQTT broker each time GPIO changes level