Node-Red, InfuxDB & Grafana Installation
Raspberry Pis are very good for monitoring all sorts of things. Today we will use Node-Red, InfluxDB, and Grafana for monitoring as well as enable Smartphone and Mail alarming.
Passwords
Where | User | Password |
Raspberry | Pi | raspberry |
Node-Red Flows | admin | admin |
Node-Red UI | User | user |
InfluxDB User | Pi | raspberry |
Grafana | admin | admin |
Prepare Image on SD card
Download image: http://bit.ly/2GdZbPe
Add empty ssh file to root directory of the card
Add wpa_supplicant.conf to root directory
Content of wpa_supplicant.conf file:
country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid=”…”
psk=”…”
}
Insert SD card into your Raspberry, boot, and find its IP address using https://www.advanced-ip-scanner.com
Log-in using Putty https://www.putty.org/
update your Raspberry to the newest version:
sudo apt-get update && sudo apt-get upgrade
Configuration on the Raspberry
Configuration of Mosquitto
sudo nano /etc/mosquitto/mosquitto.conf
insert:allow_anonymous true
Restart Mosquitto
sudo systemctl restart mosquitto
Configuration of influxDB
Create User:
CREATE USER "pi" WITH PASSWORD 'raspberry' WITH ALL PRIVILEGES
exit
Change config file:
sudo nano /etc/influxdb/influxdb.conf
In [http] uncomment:
enabled = true and bind-address=:8086
in [monitor] uncomment and change to:
store-enabled = false
sudo service influxdb restart
Configuration of Node-Red
Import Flows from: https://drive.google.com/open?id=1kECuykSaFO7Qb_67QqIHtlpvElpVWDMI
Install Mail
sudo apt-get install ssmtp
sudo apt-get install mailutils
sudo nano /etc/ssmtp/ssmtp.conf
For Gmail enter this text:
mailhub=smtp.gmail.com:587
AuthUser=[yourmailaddress]@gmail.com
AuthPass=[emailPassword]
UseSTARTTLS=YES
UseTLS=YES
Test your Mail
echo "Hello world email body" | mail -s "Test Subject" sensorsiot@gmail.com
Add support for less secure apps in Gmail: https://myaccount.google.com/lesssecureapps
Create influxDB database
influx
Create database [your databaseName]
Show DATABASES
Use [your databaseName]
Show series
exit
Install and prepare Telegram
Install Telegram on your PC https://desktop.telegram.org/
Start telegram and search for “botfather”
Enter the name of your desired bot. Note down the token.
Send a text message to the bot.
Go to: https://api.telegram.org/bot[Token]/getUpdates
and take a note of the ID. We will use it later:
Prepare Grafana
Examples:
Beer Pressure: https://drive.google.com/open?id=1beKyu4WuGErAHeYKyE3-8wtpyZJ8yHkZ
Weather: https://drive.google.com/open?id=18326_tjcVln0xBLRJINJn2ZwP0lNlyHX
YouTube: https://drive.google.com/open?id=1TrZAGnxn4zRfyO_X8RXw4ZtQIvJi8JnQ
Add Mail Notification Channel
sudo nano /etc/grafana/grafana.ini
enabled=true
host = smtp.gmail.com:587
user =[receivingEmail]@gmail.com
password =”[emailPassword]”
skip_verify = true
from_address = [sendingEmail]@gmail.com
from_name = [whateverName]
And press “Send Text”
Add Telegram Notification Channel
Insert chatID and token from before
And press “Send Test”
You are done!
vinc
22. July 2019 @ 7:47
Hello Andreas
i think this image http://www.sensorsiot.org/node-red-infuxdb-grafana-installation/
is not working on a raspberry 4.
Do you have the Single steps also documented?
my Goal would be to have a Raspberry Pi
attached a SSH Disk
with a Node-Red, InfuxDB & Grafana Installation
mqtt / Moskitto
and the rtl_433-for-a-sdr-rtl-dongle
Also Lora Information should arrive there at the end.
but a stumble over the installation
have a nice day
vinc
bogi
11. December 2020 @ 21:08
vinc, have you found a way to hoopk RB Pi4 with SSD to run all these cookies without SD card? I’m also interested in grafana, influxdv and mosquitto with nodered for home automation without commercial clouds involved.
Daniel
22. July 2019 @ 9:16
Thanks a lot for the great work and your great videos!
Is it maybe possible to make a video showing how to change the passwords?
Especially the nodered admin is giving me some headache.
THX greets from Vienna!
Jaromir
23. September 2019 @ 21:19
Recently I tried to install the ssmtp on raspbian buster. Failing at getting it working with the same configuration as with raspbian jessy on my other raspberry pi, I started looking for information and found this one:
https://wiki.debian.org/sSMTP
Package is currently unmaintained
This package has been orphaned since 2019-03-19. msmtp can be used as an alternative.
I installed msmtp-mta and it works well on raspbian buster.
Matt Lumb
14. January 2020 @ 5:12
Andreas,
i enjoy your videos and have followed them with mostly success. I’m trying to get a remote beehive monitoring system up and running made up of Raspberry Pi, Enviro+ data capture, thermal and normal cameras and a strain gauge for the weight. It will be in a group of hive up to about 100 that i want to monitor the same way.
Do you do projects such as this as a sideline to your professional and other commitments?
I’m happy to pay for your time and costs associated.
I’m sure you are too busy but i thought i’d ask
Matt Lumb
Australia
admin
22. January 2020 @ 7:44
Hi Matt, YouTube is only my hobby and I do not consult or do projects in this area. I made once a video about measuring weight which also can be used for beehives. There you find valuable info from beekeepers in the comments
Sean Sturley
14. February 2020 @ 12:02
Matt,
Have you found anyone to assist you in your beehive monitoring project?
If you are still interested in collaborating with someone, send me a message.
I am a Cyber Security/IoT researcher & beekeeper(no current hives as about to relocate) and have been researching/developing a low powered LoraWan based monitoring system which I would be happy to discuss.
Kind Regards
Sean
Dorian Wiskow
12. June 2020 @ 15:33
HI Andreas
Great topic . . . I have been a YouTube subscriber to your channel for a while and really enjoy your educational, informative and entertaining videos. This topic inspired me to set up an IOT server using docker containers on an old Pi3 . . . and I now wanted to share back in return.
I created a a simple bash script to easily to monitor multiple Raspberry Pi’s (CPU Temperatures, Frequencies, etc) and publish this information using MQTT . . . the IOTstack provided a simple and easy capability to use this, process the data through NodeRed, log the data with InfluxDB and finally produce a very slick looking dashboard with Grafana (some screen shots are available on the discord here (https://discordapp.com/channels/638610460567928832/638610461109256194/720996520555577374)
Regards
Dorian
#!/bin/bash
# To view this MQTT message subscribe to topic ‘server/+’
#
# mosquitto_sub -h dockerPi.local -t server/+
#
host=$(hostname)
#
x=$(vcgencmd measure_temp)
y=${x#*=}
temp=${y:0:${#y}-2}
x=$(vcgencmd measure_clock arm)
arm=${x#*=}
x=$(vcgencmd measure_clock core)
core=${x#*=}
x=$(vcgencmd measure_clock H264)
h264=${x#*=}
x=$(vcgencmd measure_volts core)
y=${x#*=}
coreVolts=${y:0:${#y}-1}
x=$(vcgencmd get_throttled)
throttled=${x#*=}
#
tags=”{\”server\”:\”$host\”,\”throttled\”:\”$throttled\”}”
fields=”{\”temp\”:$temp,\”armFreq\”:$arm,\”coreFreq\”:$core,\”h264Freq\”:$h264,\”coreVolts\”:$coreVolts}”
#
msg=”[$fields,$tags]”
mosquitto_pub -h dockerPi.local -t server/$host -m $msg
Dorian Wiskow
12. June 2020 @ 15:59
PS: I think this might make a really good follow up to your YouTube video #295 (Raspberry Pi Server based on Docker) . . . by showing how to simply download/install the IOTstack and then very quickly and easily implement Raspberry Pi monitoring across multiple Pi’s, so that you know whether your Pi’s are overheating and/or throttling at any point.
I am happy to share the bash script (I tried in my post above !), the dashboard I created, and details of the very simple NodeRed flow, so that others could copy/implement this as quickly and easily as I did (less than an hour from start to finish . . . once I properly understood it !).
Let me know if this works for you by sending me an email and I will share the collateral by return.
Pierre R
7. July 2021 @ 12:20
I get the following error upon running sudo apt-get update && sudo apt-get upgrade
E: The repository ‘https://dl.bintray.com/fg2it/deb jessie Release’ does no longer have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
is this distrib out of date ?
admin
8. July 2021 @ 14:06
This is an old project. It was replaced with IOTstack. Maybe you have a look at this project?