Technical Guidance on Integrating SCADA Data with Edge Services on Raspberry Pi for Smart Grid EMS

Hello EMS Community,

I am currently working on implementing an Energy Management System (EMS) for a smart grid. My setup includes the edge service runs on a Raspberry Pi 4 and the the SCADA system in the smart grid generates multiple data points from PV. I aim to establish a robust communication link between the SCADA system and the OpenEMS edge service on the Raspberry Pi. Furthermore, I need to manage and process this data on the backend and then send it to the UI for real-time visualization and control. My questions are:

  1. What are the best practices or recommended protocols for establishing communication between the SCADA system and the Raspberry Pi edge service?
  2. Are there specific Python libraries or frameworks that can facilitate this communication effectively?
  3. What are the recommended approaches for managing and processing SCADA data on the backend?
  4. How can I ensure the data is stored efficiently and is readily available for real-time processing and analytics?
  5. What is the best approach to transmit processed data from the backend to the UI for real-time monitoring and control?
  • If anyone could provide sample Python code or reference implementations for similar setups, it would be immensely helpful.

Thank you for your assistance. Any insights, sample code, or documentation references would be greatly appreciated.

Hi nada,

In a local network or VPN, i.e. if SCADA system and OpenEMS Edge can “see” each other, you can use out of the box:

I’d recommend REST/JSON in your case, if your SCADA system supports it. Alternatively Modbus/TCP.

Read State-of-Charge using REST/JSON: (Source)

import requests

url = 'http://192.168.0.23:80/rest/channel/_sum/EssSoc'

user = 'x'
password = 'user'

session = requests.Session()
session.auth = (user, password)

response = session.get(url)
response.raise_for_status()

print(response.text)

Send charge/discharge command to Energy Storage system via REST/JSON: (Source)

import requests

url = 'http://192.168.0.23:80/rest/channel/ess0/SetActivePowerEquals'

user = 'x'
password = 'owner'

session = requests.Session()
session.auth = (user, password)

data = {"value": 5000}

response = session.post(url, json = data)
response.raise_for_status()

For those questions I am unsure about your exact system architecture. Can you take this image as a reference and tell us if this looks like your setup? → Introduction :: Open Energy Management System

Regards,
Stefan