Send DHT11 sensor data using ESP-01S ESP8266 and MQTT to IOTA Tangle using Masked Authenticated Messaging (MAM)
This is a tutorial how to send DHT11 sensor data using ESP-01S ESP8266, MQTT and Raspberry Pi 3 to IOTA Tangle using Masked Authenticated Messaging (MAM).
All hardware requirements and how to wire the ESP-01S (ESP8266) is explained at:
https://www.mobilefish.com/developer/iota/iota_quickguide_esp01s_mam.html
More information about the ESP-01S can be found at:
https://www.esp8266.com/wiki/doku.php
https://www.esp8266.com/wiki/doku.php?id=esp8266-module-family
http://wiki.ai-thinker.com/_media/esp8266/esp8266_module_list.png
http://wiki.ai-thinker.com/_media/esp8266/esp8266_series_modules_user_manual_v1.1.pdf
https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf
The ESP8266 firmware can be found at this location: http://wiki.aprbrother.com/en/Firmware_For_ESP8266.html
Note: A copy of this firmware ai-thinker-0.9.5.2.bin (115000 baud) is also stored in this project.
The project consists of multiple Arduino sketches and NodeJS files.
The most important files are:
-
DHT_mqtt2.ino: This sketch is uploaded to the ESP-01s module which reads the DHT11 sensor data and publishes it to the MQTT broker running on a Raspberry Pi 3.
-
dht_mqtt_mam.js: This NodeJS file subscribes to a MQTT topic and reads the published DHT11 sensor data. This data is processed and published to the Tangle using MAM.
-
mam_receive.js: Extract the stored data from the Tangle using MAM and display the data.
npm install
How to use the scripts see:
https://www.mobilefish.com/developer/iota/iota_quickguide_esp01s_mam.html
or watch this YouTube video: https://youtu.be/qZg-3OTrMKE