DanEscasa / dht2MQTT

Use an ESP32 to publish temperature and humidity readings from a DHT11 to EMQX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dht to MQTT

In this project, an ESP32 takes readings from a DHT11 temperature and humidity sensor and publishes those to EMQX. This project is adapted from Rui Santos's excellent tutorial, using the DHT11 in place of the BME680, and broker.emqx.io in place of a local MQTT broker. You'll need to download the MQTT library umqttsimple.py from that tutorial.

I also used tayfunulu's WiFi Manager instead of hard-coding the WLAN credentials. All you need do is download the .py from his repository. In the “near future”, I'll add code to WiFi Manager to allow the user to change the default password.

The other libraries should come with the standard ESP Micropython distribution.

In addition to Node-RED, I also used the Linux desktop client MQTT X and the Android app MQTT Dash. In the “near future”, I'll try out the iOS version. Below are their respective screenshots.

NODE-Red

The best way to learn to get this output is by following Rui's instructions in his tutorial, omitting the steps for pressure and gas, and changing the broker if needed. You can also take the easy way out and import import Rui's or this repository's flows.json, depending on whether you stick with Rui's BME+local MQTT broker or my DHT11+emqx broker, respectively.

MQTTX
MQTT Dash

As an aside, those screenshots are more-or-less to scale. Yes, I have a big-screen phone — 6.44".

ACKNOWLEDGEMENTS

Thanks to Michael Polla for his gist on resizing image files in, among others, a github README.md

I also got the idea of using tables to insert an image caption from a post in towardsdev.com

About

Use an ESP32 to publish temperature and humidity readings from a DHT11 to EMQX


Languages

Language:Python 100.0%