Last update: 2024/02/01
- Python script removed, all the logic is implemented using Node-RED
- MQTT data is stored InfluxDB
- Grafana can be used to display trends
- minor fixes and improvements
FreeDS SCADA developed using Node-RED
This project implements a SCADA for FreeDS, developing these functions:
- shows information about FreeDS status
- allows enabling/disabling PWM and switching between modes AUT<-->MAN
- implements two set points in order to switch to MAN mode when the temperature is <= Low_temperature_set_point and switches to AUTO mode when the temperature is >= Low_temperature_set_point+Temperature_increase_set_point
- A PC or Raspberry Pi, I'm using a Raspberry Pi 2 and a 16 GB SD card
- Debian or Raspberry Pi OS administration skills
- Install and configure Mosquito MQTT broker and required utilities:
https://randomnerdtutorials.com/how-to-install-mosquitto-broker-on-raspberry-pi/
sudo apt install mosquitto mosquitto-clients influxdb influxdb-client
Edit /etc/mosquitto/mosquitto.conf and add at the end:
allow_anonymous true
listener 1883 0.0.0.0
Enable and restart Mosquitto:
sudo systemctl enable mosquitto.service
sudo service mosquitto restart
- Install Node-RED:
https://nodered.org/docs/getting-started/raspberrypi
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
sudo systemctl enable nodered.service
sudo service nodered restart
Access to Node-RED from a Internet browser:
http://raspberry-pi-IP:1880
http://raspberry-pi-IP:1880/ui (runtime)
- Create FreeDS database on InfluxDB:
$ influx
> create database FreeDS
> quit
- Optional but recommendable:
- download MQTT explorer in order to debug MQTT broker: http://mqtt-explorer.com/
- configure your timezone and enable time synchronization:
raspi-config --> Localisation Options --> Timezone
sudo raspi-config
sudo systemctl enable systemd-timesyncd
-
Log into Node-RED using http://raspberry-pi-IP:1880 and install node-red-dashboard and node-red-contrib-influxdb:
Menu-->Manage Palete-->Install and search node-red-dashboard/node-red-contrib-influxdb, select it for installation and accept -
Download FreeDS-SCADA.json, import it into Node-RED and enjoy !