Simple ESP32 IoT Sensor Node Tutorial: WiFi Enabled MQTT Sensor Data Node

preview_player
Показать описание
This tutorial will create an internet of things sensor node based on an ESP32 development board. This node will use the MQTT protocol to send sensor data over WiFi to a Raspberry Pi based IoT server. This tutorial will allow you to collect any kind of sensor data you like, send it over your network to a MQTT server and visualise it on a Grafana dashboard.

This system consists of a series of sensor nodes that send sensor data in a JSON message over the network to a Raspberry Pi via MQTT. MQTT is a network protocol where a client pushes data to a broker, such as mosquitto, and the broker pushes that data to any client that has subscribed to that topic. A topic categorises the data that is sent. Any client that is subscribed to "home/sensor" will be forwarded this MQTT message containing the sensor data. On the Raspberry Pi server, NodeRED will subscribe to this topic, interpret the json message data and then send the data to a database to be stored and used. InfluxDB will store all the sensor data. Then a Graphana front end will query the database in order to display the data we want to see and do a whole host of other things. This is all explained in our Raspberry Pi IoT server tutorial linked below.

Helpful links:

Timestamps
00:00 Introduction
00:41 System Overview
01:40 How does this work?
02:58 Payload format
03:16 Required libraries
03:36 Hardware setup
03:51 Arduino IDE implementation
04:28 Programming
10:00 Conclusion

-- Equipment we use regularly --
The following links are affiliate links where we may make a small percentage on qualifying sales through these links. Use the respective UK or US links listed.

All videos and tutorials on this channel and mentioned websites are for educational purposes only.
Рекомендации по теме
Комментарии
Автор

Not one word to little nor to many. 100% on the spot. Thanks a lot!!!

Europayacht
Автор

Great video, it worked for me, I had a couple of issues, firstly I was just testing this with analogue input from a pin and some of the ESP32 analogue pins are disabled when wifi is operational. That took a while to sort! The only other issue was that I somehow didn't connect the nodes in node red, once that was sorted worked fine. I'll be using this for a battery operated weather station powered by a rather large 10w solar panel (since I want it on all the time) and a lipo . I've used Andreas Spiess's design with a power path. I'll be using the data in Home Assistant and also want to design a wall mounted retro display to show current weather with an arrow for wind direction etc. It's all a bit of a mammoth project since I knew very little when I started, this video has been a big help though.

gripperrod
Автор

Thank you for such a clear awesome video. It was very well set out.

brendanowen
Автор

thank u i learn a lot thank any books from your channel

edinetgrunhed
Автор

I vote to see similar project with LoRa such as TTGO :)

zfd
Автор

Excellent video! I look forward to more!

grottyboots
Автор

is gas heater affecting tem sensor? i have experiecne ens160 + aht2x sensor...which is about 3-4 C more than surrounding or compared to other sensor.

jozefsoucik
Автор

I would like to use the netsgpclient to collect data from my solar micro inverter. How can I have another client from netsgpclient to receive serial data via an lc12s 2.4ghz module? The two programs work by themselves but how can I merge them? I need a wifi mqtt serial gateway I guess.

alexprgressive
Автор

What about soil moisture sensor ? It’s not have library how i can do it

hieuao
Автор

Since you've got the sensor and the server in the same room (and connected by USB cable), a good follow-on video would be showing how to connect the BME680 directly to the Pi and use a daemon to periodically read the sensor via the Pi's header pins.

LegalizeAdulthood
Автор

it worked fine for a few hours and then started returning this error ( rc=-2Attempting MQTT connection...failed ) what might be the issue

sanjeevjoshi
Автор

Am I able to create my own IoT app (web app in my case) and connect it to the MQTT server? If so, what programming language should I use to do it?

franciscosousa
Автор

hi i dont own a rapberry what other ways can i run a server instead of using raspberry

terlumunjoseph
Автор

Can you please do a tute that includes both BME680 and SPS30 sensors with Node -Red and Grafana

gregruthenium
Автор

Please make this architecture with ESP IDF and accelerometer sensor

AmitSharma-bmqj
Автор

Garcia Brian Lee Frank Hernandez Susan

TinaMitchell-lj
Автор

White Shirley White Richard Johnson Gary

WhittierLesley-ct
Автор

Walker Margaret Brown Charles Rodriguez Jeffrey

AvelinaEicher-df
Автор

Brown Donna Moore Robert Wilson Deborah

XnndjehdhkNxndjhds
Автор

Robinson Michael Jackson Gary Smith Sharon

TirusDblok-ru