pydnp3 -- python binding for opendnp3
Reason this release was yanked:
Doesn't work properly
Project description
dnp3-python
About the DNP3 Protocol
Distributed Network Protocol (DNP or DNP3) has achieved a large-scale acceptance since its introduction in 1993. This protocol is an immediately deployable solution for monitoring remote sites because it was developed for communication of critical infrastructure status, allowing for reliable remote control.
GE-Harris Canada (formerly Westronic, Inc.) is generally credited with the seminal work on the protocol. This protocol is, however, currently implemented by an extensive range of manufacturers in a variety of industrial applications, such as electric utilities.
DNP3 is composed of three layers of the OSI seven-layer functions model. These layers are application layer, data link layer, and transport layer. Also, DNP3 can be transmitted over a serial bus connection or over a TCP/IP network.
Main DNP3 Capabilities
As an intelligent and robust SCADA protocol, DNP3 gives you many capabilities. Some of them are:
- DNP3 can request and respond with multiple data types in single messages
- Response without request (unsolicited messages)
- It allows multiple masters and peer-to-peer operations
- It supports time synchronization and a standard time format
- It includes only changed data in response messages
For more details about the DNP3 protocol, the DNP3-Primer.md article is a good start.
About the dnp3-python Package
Python bindings for the opendnp3 library, an open source implementation of the DNP3 protocol stack written in C++14.
Note: This is a redesign of pydnp3 and work in progress.
Supported Platforms: Linux (Tested with Ubuntu 20.04, 22.04)
Install
Support Python >= 3.8, using pip
pip install dnp3-python
Validate Installation
After installing the package, run the following command to validate the installation.
dnp3demo
Expected output
ms(1666217818743) INFO manager - Starting thread (0)
channel state change: OPENING
ms(1666217818744) INFO tcpclient - Connecting to: 127.0.0.1
ms(1666217818744) WARN tcpclient - Error Connecting: Connection refused
2022-10-19 17:16:58,744 dnp3demo.data_retrieval_demo DEBUG Initialization complete. Master Station in command loop.
ms(1666217818746) INFO manager - Starting thread (0)
ms(1666217818746) INFO server - Listening on: 127.0.0.1:20000
2022-10-19 17:16:58,746 dnp3demo.data_retrieval_demo DEBUG Initialization complete. OutStation in command loop.
ms(1666217819745) INFO tcpclient - Connecting to: 127.0.0.1
ms(1666217819745) INFO tcpclient - Connected to: 127.0.0.1
channel state change: OPEN
ms(1666217819745) INFO server - Accepted connection from: 127.0.0.1
...
===important log: case6 get_db_by_group_variation ==== 2 2022-10-19 17:17:01.157129 {GroupVariation.Group30Var6: {0: 5.588852790313346, 1: 17.7138169198775, 2: 22.456219616993142, 3: 0.0, 4: 0.0, 5: 0.0, 6: 0.0, 7: 0.0, 8: 0.0, 9: 0.0}}
===important log: case6b get_db_by_group_variation ==== 2 2022-10-19 17:17:01.157407 {GroupVariation.Group1Var2: {0: True, 1: True, 2: True, 3: False, 4: False, 5: False, 6: False, 7: False, 8: False, 9: False}}
===important log: case6c get_db_by_group_variation ==== 2 2022-10-19 17:17:01.157559 {GroupVariation.Group30Var1: {0: 5, 1: 17, 2: 22, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0}}
===important log: case7 get_db_by_group_variation_index ==== 2 2022-10-19 17:17:01.157661 {GroupVariation.Group30Var6: {0: 5.588852790313346}}
===important log: case7b get_db_by_group_variation_index ==== 2 2022-10-19 17:17:01.157878 17.7138169198775
===important log: case7c get_db_by_group_variation_index ==== 2 2022-10-19 17:17:01.157974 0.0
NOTE: Use
dnp3demo -h
to see demo options
$ dnp3demo -h
usage: dnp3demo [-h] {master,outstation,demo} ...
Dnp3 use case demo
optional arguments:
-h, --help show this help message and exit
dnp3demo Sub-command:
{master,outstation,demo}
master run a configurable master interactive program
outstation run a configurable outstation interactive program
demo run dnp3 demo with default master and outstation
For more details about the dnp3demo
module, please refer to dnp3demo-module.md.
For Developers
pydnp3 is a thin wrapper around opendnp3 classes. Documentation for the opendnp3 classes is available at automatak.
Dependencies
To build the library from source, you must have:
- A toolchain with a C++14 compiler
- CMake >= 2.8.12 (https://cmake.org/download/)
This repository includes two repositories as submodules (under deps/
):
- dnp3 (https://github.com/automatak/dnp3)
- pybind11 (https://github.com/Kisensum/pybind11) - This is a fork containing a minor patch required to compile some pydnp3 wrapper code. It will be replaced with pybind11 proper when the issue is resolved.
Please find more info Notes_on_packaging.md about packaging process, for example, building from the C++ source code, packaging native Python code with C++ binding code, etc.
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
File details
Details for the file dnp3_python-0.3.0b1-py3.11-linux-x86_64.egg
.
File metadata
- Download URL: dnp3_python-0.3.0b1-py3.11-linux-x86_64.egg
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93f407bd3f1db6c2039647ea6c645acfb3bf7b79809e6bed7b07406b4f8b245f |
|
MD5 | bc2194d50033b2a81d51da70868c8f90 |
|
BLAKE2b-256 | 77590e8de2cec236f65fda76ad757e37711245b0462f15e3d7c70089f21cf79e |
File details
Details for the file dnp3_python-0.3.0b1-py3.10-linux-x86_64.egg
.
File metadata
- Download URL: dnp3_python-0.3.0b1-py3.10-linux-x86_64.egg
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2948c566a4ad44e000cd5b538a549192d800de0ae7e37f27e462a5100402c533 |
|
MD5 | 3d342f2b93bf43cb1fc606d05b917e56 |
|
BLAKE2b-256 | 984dadc50362436cae674669b85275f9c132c9ab7da72261c1cefef60666d113 |
File details
Details for the file dnp3_python-0.3.0b1-py3.9-linux-x86_64.egg
.
File metadata
- Download URL: dnp3_python-0.3.0b1-py3.9-linux-x86_64.egg
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fff63a403295cb17bfd76c0840b54c8fe9471a3a556c98ceb693baad4a5c7b22 |
|
MD5 | c2d303c6956451203a4e7b731534c885 |
|
BLAKE2b-256 | c612e7a9598e67f4f238b3876edfd4e66fc8878333246c0e64af82e0d42cea16 |
File details
Details for the file dnp3_python-0.3.0b1-py3.8-linux-x86_64.egg
.
File metadata
- Download URL: dnp3_python-0.3.0b1-py3.8-linux-x86_64.egg
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3141acde5a18eeba2a5d6fe498b5fa5fed04fa25f62eb058d7f49c6626e1212 |
|
MD5 | bd6807f460c8b5144471dc2e7f4ca4b8 |
|
BLAKE2b-256 | c3c08e03391d08a347f053b6685d09cc83488ec0786dd1e3d751d80e8b345a8a |
File details
Details for the file dnp3_python-0.3.0b1-cp311-cp311-manylinux1_x86_64.whl
.
File metadata
- Download URL: dnp3_python-0.3.0b1-cp311-cp311-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d28a89159e1225182a1829251d222293d29002193444437ba1bc8cc58835b97 |
|
MD5 | cd13b30a7bf671d8afb9eb31297405f1 |
|
BLAKE2b-256 | 4e0fbc865145398f3c2259b31f1b885f2454faf4f1a224f1468ee81e4faddf14 |
File details
Details for the file dnp3_python-0.3.0b1-cp310-cp310-manylinux1_x86_64.whl
.
File metadata
- Download URL: dnp3_python-0.3.0b1-cp310-cp310-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28163e5ea159f2b2361fd46feb9963fe485e477606e05c60ab8ef1bcfef9362b |
|
MD5 | 8822c943fc408cf2aa0891e28395eeea |
|
BLAKE2b-256 | 51ee5f77bd2552059cbe44ae1e96a6a685d4b957c5e57d921934676c9c096139 |
File details
Details for the file dnp3_python-0.3.0b1-cp39-cp39-manylinux1_x86_64.whl
.
File metadata
- Download URL: dnp3_python-0.3.0b1-cp39-cp39-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fee12c917edc279a991ccf008c39b92a0af6385745719123429587df534cf22 |
|
MD5 | c66c0f0b3d45023923d327ab86e0645f |
|
BLAKE2b-256 | 83dbd4e3ac9d2de609c01c82daf730e5e3481327bf2a7734ab79d5e4aeeeba2c |
File details
Details for the file dnp3_python-0.3.0b1-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: dnp3_python-0.3.0b1-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dc0fa1cb79c55ed63bbee67e983fb929941cad256c83cf1f03f2bacfbf9ef23 |
|
MD5 | 34ac94f923230f1906b287793a786499 |
|
BLAKE2b-256 | 88abebda31349318f71a09e156b2c62cce3c1a11a987fc272893b21504fbafe4 |