Raspberry Pi IoT Server Tutorial: InfluxDB, MQTT, Grafana, Node-RED & Docker

preview_player
Показать описание
This tutorial will create an internet of things server on your Raspberry Pi. This server will use Mosquitto MQTT, InfluxDB, Node-RED, Graphana in docker containers. We will use the helpful IoTStack tool which will configure our docker containers for us. This tutorial will allow you to collect any kind of sensor data you like, send it over your network to this raspberry pi 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 slash sensor will be forwarded this MQTT message. 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.

The written version of this tutorial and the code used is available here:

See other Raspberry Pi Tutorials here:

Timestamps
00:00 What this server will do
00:30 How will it do it?
02:16 Docker
03:59 IoTStack
06:46 InfluxDB Database
07:25 Node-RED Setup
10:15 Grafana Setup
11:58 Conclusion

-- Equipment we use regularly --
The following links are affiliate links where I 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.
Рекомендации по теме
Комментарии
Автор

This is, by far, the best video I have seen for explaining an IOT server, thank you

familyplans
Автор

After what feels like 45000 tutorials, thank you - you finally gave me the insight needed to strip out unnecessary data and CHANGE the incoming data into a payload that influx was happy with. I now have a happy little chart of how bad the air is during the Canadian wildfire season.

frollard
Автор

Maybe I just hadn't looked hard enough before but I think you're the first person I've seen explain grafana this well.

nathanpendergrast
Автор

Just a note, when setting up the MQTT server in Node-Red you can type in the name of the docker container as it is running in the same stack as Node-Red.

LincsOracle
Автор

Amazing guide! I watched it a couple of times and after a few hours I had my Grafana up and running, mind you I had never done anything MQTT before. For now I am just logging the room temp with an ESP32 and an LM35 temp sensor but I will be adding a lot of stuff soon and hopefully some solar production data in the future. Thanks a lot!

nosafetyswitch
Автор

Thank you! Your video is straightforward and to the point. Other videos were a complete waste of time. I'm glad I found your videos

ika
Автор

Amazing Video, cannot thank you enough. I tried it myself and here is feedback. The github code you shared is having issue with NodeRed, see error below -
I managed to install other containers by skipping nodered and later installed nodered as systemd.
It would be nice if you can make your github repo public in that way users can report issue and can pull the working code.

Start Stack:
docker-compose up -d --remove-orphans
WARNING: Some networks were defined but are not used by any service: nextcloud
Creating network "iotstack_default" with driver "bridge"
Building nodered
ERROR: Cannot locate specified Dockerfile: Dockerfile

SDNTechForum
Автор

This is a really excellent tutorial. Every step is clearly explained in detail. Just one issue: it is generally not advised to use a leading forward slash '/' for the root an MQTT topic. But that's a minor quibble

kylemfwelch
Автор

Really good tutorial. I wish I watched this before setting up my IOT server

SwanepoelDewald
Автор

Great tutorial to get started with IoT stack in R-Pi4. I am going to use this in a CM4 and use node red + mosquito talking to IO module downstream. Docker surely makes things flexible and easy.

manasXP
Автор

Great Video, I am bumbling through this on my own system, I intend to use this to monitor my solar install, hopefully remotely, so much to learn so it may be sometime before it goes live. Thanks for posting ;)

eveb
Автор

Thank you for this excellent project & tutorial. It was my first step into the world of microcontrollers.

JoachimGrossmann-jw
Автор

After struggling for a whole day trying to get mosquitto to work on my raspberry pi, following your video had me up and running within half an hour. This is a fantastic tutorial, thank you so much for the help ❤

rndmstuf
Автор

Fantastic Video. Very crisp and to the point. Helped me learn the whole stack at one go.

srikumarc
Автор

Great tutorial... I am going to get the data from my netatmo devices and data from my "solar system" into this.

yannkitson
Автор

Thank you for this video, i learned about portainer, grafana and influxdb in same video. thank u very much

edinetgrunhed
Автор

Very cool video on the Pi. For Arduino the ESP8266 NodeMCU is a cheaper option as it already have Wifi built-in and better power management. ESP32 would work too. Both very small form factor.

Darkk
Автор

Great helpful video and website. One point, on the website it says to use 'docker-compose up' to check the status of the containers whereas you use 'docker-compose ps' in your video. I really appreciate the effort you are putting into your videos and supporting material.

statters
Автор

Thanks for this guide, I have referenced and linked to it because it helped me build a server on an M5Stack CM4 Stack.

AJBK
Автор

Well done and I have a number of projects in mind that will use what was explained here.

dang