iec104-python
Project description
iec104-python
Table of contents
Introduction
This software provides an object-oriented high-level python module to simulate scada systems and remote terminal units communicating via 60870-5-104 protocol.
The python module c104 combines the use of lib60870-C with state structures and python callback handlers.
Example remote terminal unit
import c104
# server and station preparation
server = c104.Server(ip="0.0.0.0", port=2404)
# add local station and points
station = server.add_station(common_address=47)
measurement_point = station.add_point(io_address=11, type=c104.Type.M_ME_NC_1, report_ms=1000)
command_point = station.add_point(io_address=12, type=c104.Type.C_RC_TA_1)
server.start()
Example scada unit
import c104
client = c104.Client(tick_rate_ms=1000, command_timeout_ms=5000)
# add RTU with station and points
connection = client.add_connection(ip="127.0.0.1", port=2404, init=c104.Init.INTERROGATION)
station = connection.add_station(common_address=47)
measurement_point = station.add_point(io_address=11, type=c104.Type.M_ME_NC_1, report_ms=1000)
command_point = station.add_point(io_address=12, type=c104.Type.C_RC_TA_1)
client.start()
See examples folder for more detailed examples.
Licensing
This software is licensed under the GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html).
See LICENSE file for the complete license text.
Dependencies
lib60870-C
This project is build on top of lib60870-C v2 from MZ Automation GmbH, which is licensed under GPLv3.
The library is used for 60870-5-104 protocol based communication.
mbedtls
This project is build on top of mbedtls from the Mbed TLS Contributors, which is licensed under Apache-2.0.
The library is used to add transport layer security to the 60870-5-104 protocol based communication.
pybind11
This project is build on top of pybind11 from Wenzel Jakob, which is licensed under a BSD-style license.
The library is used to wrap c++ code into a python module and allow seamless operability between python and c++.
catch2
This project is build on top of catch2 from the Catch2 Authors, which is licensed under BSL-1.0.
The library is used as testing framework for test-automation.
System requirements
Operating systems
- Debian/Ubuntu (x64): YES
- Raspbian (arm32v7): YES
- Windows (x64): YES
- Raspbian (aarch64): Not yet
Python versions
- python >= 3.6, < 3.11
Installation
Package distribution
Install from pypi package (comming soon)
python3 -m pip install c104~=1.16.0
Add to requirements.txt
c104~=1.16.0
Source distribution
Install from source
sudo apt-get install build-essential python3-dev python3-pip
python3 -m pip install c104@git+https://github.com/fraunhofer-fit-dien/iec104-python.git@v1.16.0
Add to requirements.txt
c104 @ git+https://github.com/fraunhofer-fit-dien/iec104-python.git@v1.16.0
Wiki
Read more about the Classes and their Properties in our project Wiki.
Contribution
How to contribute
-
Add feature requests and report bugs using GitHub's issues
-
Create merge requests
How to build for multiple python versions (linux with docker)
- Build wheels via docker
/bin/bash ./bin/linux-build.sh
How to build (linux)
-
Install dependencies
sudo apt-get install build-essential python3-pip python3-dev python3-dbg python3 -m pip install --upgrade pip
-
Build wheel
python3 -m pip wheel .
How to analyze performance (linux)
-
Install dependencies
sudo apt-get install google-perftools valgrind sudo pip3 install yep
-
Copy pprof binary
cd /usr/bin sudo wget https://raw.githubusercontent.com/gperftools/gperftools/master/src/pprof sudo chmod +x pprof
-
Execute profiler script
./bin/profiler.sh
How to build (windows)
-
Install dependencies
- Python 3
- Buildtools für Visual Studio 201x (Scroll down » All Downloads » Tools for Visual Studio 201x)
-
Build wheel
python3 -m pip wheel .
Generate documentation
-
Build c104 module
-
Install dependencies
python3 -m pip install --upgrade sphinx breathe sphinx-autodoc-typehints
- doxygen
- graphviz
-
Build doxygen xml
doxygen Doxyfile
-
Build sphinx html
python3 bin/build-docs.py
Change log
Track all changes in our CHANGELOG documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for c104-1.16.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6a9b5983927a0595c970d80103fc7b3dd26df78b7fde21caf927218a660c8b3 |
|
MD5 | f80fd3a1104c751693b0849bde50d959 |
|
BLAKE2b-256 | cfbb4a0b611081cd93e79fc16fe3fca5d19f5dbe45e2aab742837bafd3611b10 |
Hashes for c104-1.16.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 901f0f2fe097dc34f2bbc483a4cdbdd38c65faa2794122e6d09730360001a15b |
|
MD5 | ad157c288bf4fe93cb0bec3de552ae38 |
|
BLAKE2b-256 | 002a9b2f6ff3a330b23de9e11dc14525262bc9de329bf340ec58b74fd4d97b50 |
Hashes for c104-1.16.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e12e4d46956e8db9b98ae59e0716e0b014a722e578d3fdcef437d9ae4aea35d |
|
MD5 | 7eac6c4a0bd85b3816a24fa6dfd90c01 |
|
BLAKE2b-256 | 05898b03c5b1b8c675a56c9caca7fff7e51c44a49e153eb60ba0e3419d488851 |
Hashes for c104-1.16.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c1fcb9511514abf3d5071be73a6de1ab4c73666c2e091e2e5143f191b0e77e3 |
|
MD5 | 404a4fd626fe85d28fe0ae06b183dd3c |
|
BLAKE2b-256 | 2ef8367cd7295fa3f6a0a97890b4021ec4288f9d83d51a7b05809fd9833e32f3 |
Hashes for c104-1.16.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d4764901412fd151169e8895bb2e4c95a7ced9fa7cfbfa328e28ddcff801888 |
|
MD5 | f8f3339440f90e1cd55d34b6cfbac457 |
|
BLAKE2b-256 | 931531e069629347fad056b6637c262f83ab1a220f60d36c85341bc8a4d87bcc |
Hashes for c104-1.16.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e6d5e19108f6eabf756d6b617463b2e8be1afc0f402bd9969bf83767c6dd30c |
|
MD5 | 6c9ce9f16583f070f754ffdb16d19e9c |
|
BLAKE2b-256 | 427ba7c24c988a87a80747387bd95a555221a14db8c5042e6e4f485e4f07e030 |
Hashes for c104-1.16.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe6d2ecb3bcbfc0ba09bedebd9030ef3e85bed1baa4df01ce9e90dce510b817 |
|
MD5 | b6c0b3d7435d5d58d2bec8948144ffc5 |
|
BLAKE2b-256 | e3e01bd120670f916ee0067f2517d8b2f7ef1a84a8fc13bf4959902780cb2aeb |
Hashes for c104-1.16.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bd4ff90a5a33a6b983c1dae76a3079c453fc61f035f1a290882f1a17101dc4b |
|
MD5 | 226492d5a6a6f6e9c3042043dc2e4013 |
|
BLAKE2b-256 | 83ca59db93f8eb6f5bcc242f880d6bd19948afad05d279b6736b1fea371505da |
Hashes for c104-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42bcb5615d816a02e1d779b9670048e508fefa85fe151c73609fd1a242e60b0b |
|
MD5 | bc5049890ef9632e141756dc73ab6fb4 |
|
BLAKE2b-256 | 7a92581d41487af770491604fc3dbbdf1f09ca1d38eb1eba4631f9ec51d21d12 |
Hashes for c104-1.16.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e57c7157f68b17dda8ef600f5caad9587700afb225a732e5ddad9e9768d3e1a2 |
|
MD5 | 4b48b91e62c919ef299f019de8e7a44d |
|
BLAKE2b-256 | 9e1af81a0f69dca9f0e05d188ef369f0aaf2e64bbaf630e2e75c6f9a6121b5eb |
Hashes for c104-1.16.0-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ddd10fb7eafe8d57a42527ddc8e44d3547a2567d6df491dbb2c6bab0fac2683 |
|
MD5 | 308aeebdd802faa960fb7fb6e0845187 |
|
BLAKE2b-256 | 6e4d77b238e1444413d003b824e8e460715c6cc45b26cf0a410a71645333e613 |
Hashes for c104-1.16.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5474af8ff4ba3d8f738b3a7885defe006c9955b000fc0be44e3ab2f316e3296a |
|
MD5 | 7b8eb8ff3b9154ca441c1494bca886f0 |
|
BLAKE2b-256 | 37970fce9c6a4443b357e294cbffa4ea528b65be9546805d6c5a6b78cca71f36 |
Hashes for c104-1.16.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8897bf0b1d03c0ed09187fee72901571bcf06f6dc962259debafb2e565fd0b94 |
|
MD5 | e6a112086c9d145d03c6ed3e76441f8a |
|
BLAKE2b-256 | 551da809df8ce5e0f7fc5814d195f4d1dba528ea0f4a5599757dd68368d91969 |
Hashes for c104-1.16.0-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68c7077696e3207b0b12b36157074817a230a8b63eada2329a921e7c5a97acc6 |
|
MD5 | 8710304d82df6c1640ab6392dc59ea86 |
|
BLAKE2b-256 | 4e086079f8a8febdf1dfbde22cd5f3551fe3aa65eb0ed0350d7492fc8c7f67cd |
Hashes for c104-1.16.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7633ca77aef8fc91689681320b1f733928c0cbd5e7e9b82322b9ff5f410da3d7 |
|
MD5 | 53d2db7ff5beea25e67f6ac8331d8ee2 |
|
BLAKE2b-256 | c94b6e20bee81074fe560f8b69221feb955eb14159ab515c06860dbeb1183e05 |