Skip to content

ilyxa/RapidScada-NodeMCU-MQTT

Repository files navigation

screenshot

Software

RapidScada, free and easy to use SCADA system https://rapidscada.org

KpMQTT.dll https://github.com/bersim/OpenKPs/tree/master/KpMQTT

Eclipse Mosquitto https://github.com/eclipse/mosquitto

Works ONLY with Mosquitto (no idea why, RabbitMQ was a huge problem)

Files structure:

conf/ config examples

scripts/ script running on RapidScada Site and development VM

esp_firmware/ NodeMCU Sensor 2.2.0 with modules ADC BIT BME280 DHT DS18B20 FILE GPIO I2C MQTT NET NODE OW RTCMEM SPI TLS TMR UART WIFI

dlls/ KpMQTT.dll with Retain support (export FrameworkPathOverride=/usr/lib/mono/4.5/ is important ;) )

ESP8266 Setup

Prepare firmware:

Update firmware, manual and details is here.

esptool write_flash 0x00000 0x00000.bin 0x10000 0x10000.bin
cp credentials.lua.example credentials.lua

Edit credentials.lua any way

Upload:

luatool.py -f init.lua
luatool.py -f user.lua
luatool.py -f credentials.lua

RapidScada setup

TODO

Heartbeat

crontab entry

* * * * *       /opt/scada/regenerate_heartbeat.sh

Heartbeat logic: every minutes topic "heartbeat" pub new value generated randomly. Every session from ESP sensors network get new system value and re-publish it again and again to make sure that sensor is online and health state is OK.

TODO

  • xor values temp and humi w/ current heartbeat values.
  • RapidScada setup.