Package: dnp3-python
dnp3-pythonAbout the DNP3 ProtocolDistributed 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 CapabilitiesAs 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 messagesResponse without request (unsolicited messages)It allows multiple masters and peer-to-peer operationsIt supports time synchronization and a standard time formatIt includes only changed data in response messagesFor more details about the DNP3 protocol, theDNP3-Primer.mdarticle is a good start.About the dnp3-python PackagePython bindings for theopendnp3library, an open source
implementation of theDNP3protocol stack written in C++14.Note:  This is a redesign ofpydnp3and work in progress.Supported Platforms:Linux (Tested with Ubuntu 20.04, 22.04)InstallSupport Python >= 3.8, using pippipinstalldnp3-pythonValidate InstallationAfter installing the package, run the following command to validate the installation.dnp3demoExpected outputms(1666217818743)INFOmanager-Startingthread(0)channelstatechange:OPENING
ms(1666217818744)INFOtcpclient-Connectingto:127.0.0.1
ms(1666217818744)WARNtcpclient-ErrorConnecting:Connectionrefused2022-10-1917:16:58,744dnp3demo.data_retrieval_demoDEBUGInitializationcomplete.MasterStationincommandloop.
ms(1666217818746)INFOmanager-Startingthread(0)ms(1666217818746)INFOserver-Listeningon:127.0.0.1:200002022-10-1917:16:58,746dnp3demo.data_retrieval_demoDEBUGInitializationcomplete.OutStationincommandloop.
ms(1666217819745)INFOtcpclient-Connectingto:127.0.0.1
ms(1666217819745)INFOtcpclient-Connectedto:127.0.0.1
channelstatechange:OPEN
ms(1666217819745)INFOserver-Acceptedconnectionfrom:127.0.0.1

...===importantlog:case6get_db_by_group_variation====22022-10-1917: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}}===importantlog:case6bget_db_by_group_variation====22022-10-1917: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}}===importantlog:case6cget_db_by_group_variation====22022-10-1917: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}}===importantlog:case7get_db_by_group_variation_index====22022-10-1917:17:01.157661{GroupVariation.Group30Var6:{0:5.588852790313346}}===importantlog:case7bget_db_by_group_variation_index====22022-10-1917:17:01.15787817.7138169198775===importantlog:case7cget_db_by_group_variation_index====22022-10-1917:17:01.1579740.0NOTE:Usednp3demo -hto see demo options$dnp3demo-h
usage:dnp3demo[-h]{master,outstation,demo}...

Dnp3usecasedemo

optionalarguments:-h,--helpshowthishelpmessageandexitdnp3demoSub-command:{master,outstation,demo}masterrunaconfigurablemasterinteractiveprogramoutstationrunaconfigurableoutstationinteractiveprogramdemorundnp3demowithdefaultmasterandoutstationFor more details about thednp3demomodule, please refer todnp3demo-module.md.For Developerspydnp3 is a thin wrapper around opendnp3 classes. Documentation for the opendnp3
classes is available atautomatak.DependenciesTo build the library from source, you must have:A toolchain with a C++14 compilerCMake >= 2.8.12 (https://cmake.org/download/)This repository includes two repositories as submodules (underdeps/):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 infoNotes_on_packaging.mdabout packaging process, for example, building from the C++ source code,
packaging native Python code with C++ binding code, etc.