Publish the temperature and humidity information
-
Run the MQTT broker in raspberry pi (host : 192.168.0.104)
-
Subscribe the humidity/temperature topic in raspberry pi board.
subscribe -t sensor/humidity
-
Upload the .ino file into NodeMCU board (ESP8266)
-
Connect DHT11 signal pin to D6 pin which is GPIO12, Vcc to 5V and GND to GND of raspberry pi board.
-
Power ON the NodeMCU board.
-
You can see the temp and humidity data in raspberry pi terminal.