Skip to content

NodeMcu code for ESP8266 + dht11/22 temp and humidity publish to MQTT

Notifications You must be signed in to change notification settings

111deny111/esp8266_dht_mqtt_nodemcu

 
 

Repository files navigation

NodeMcu LUA code to read DHT11/22 temperature and humidity values and send them to MQTT server What it does is:

  • scan WIFI for known access points

  • if AP found, connect wifi, connect to MQTT server and start poling DHT sensor and publish temperature and humidity.

  • publish also free ram and uptime, for test purpose

  • if deconnected from MQTT, esp8266 reset is done by code

  • a LED blink differently depending on the state:

    • no wifi available: fast 5 blink per second
    • AP found: one blink per second
    • connected to AP: one blink every 2 seconds
    • MQTT connected: one blink every 4 seconds

    No TLS at this time, look like the free ram is not enough to handle it. Will try using arduino IDE + c source

Lavaux Gilles 2017/05

About

NodeMcu code for ESP8266 + dht11/22 temp and humidity publish to MQTT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%