The web based test utility uses the stack. While the web interface may be used to control a pre-configured outstation, the real power lies in the JSON API. The JSON API may be used to create, destroy and control data links and outstations.
This project was created with only learning in mind. However, if you get some use of out of it, that is a bonus. To download the project, please visit the sourceforge page. Some installation instructions are included here. However, the sourceforge wiki is still the definitive source for installation information.
That said, if you would like to buy me pizza or a beer, there is a donate button on the right.
Running the simulator
The Simulator is broken up into two parts. There is a web utility that has a built-in stack. There is also a remote control utility that contains python libraries and a sample script to demonstrate outstation remote control. The remote control leverages the web utility JSON API for all the heavy lifting. The python libraries were design with the Robot test framework in mind.
Web Utility
The Web Utility required Java 1.8 or above to run. As it is a Java based application, it will run on Windows or Linux (and presumably Mac, Unix, Android, etc though I have not tested these).The DNP3 stack is already built-in to the Web Utility executable. Download and unzip the file from the sourceforge page. In order to run the web utility, execute the following commands:
Windows: java -cp ".;jdnp3-ui-web-outstation-.jar" net.sf.jdnp3.ui.web.outstation.main.App Linux: java -cp ".:jdnp3-ui-web-outstation- .jar" net.sf.jdnp3.ui.web.outstation.main.App Using the default configuration, navigate to: http://127.0.0.1:8080
Remote Control
The remote control requires python 2.7.x. As it is a Python based application, it will run on Windows or Linux (and presumably Mac, Unix, Android, etc though I have not tested these).The use the python modules, download the jdnp3-ui-web-remote package. Unzip the package and copy the jdnp3 folder (include the folder, not just the files) to you python library directory or runtime path (your current working directory). To run the main script, execute the following commands:
Windows/Linux: python main.py
Please keep in mind, main.py is included as a sample only. Do not include it in your projects.
can you please send more details on how to start the various pieces ?
ReplyDeleteCertainly. I have added a quick section about running the utility. Documentation can also be found on the source forge page. There are currently big gaps in the documentation. I have attempted to fill these by providing robust examples. Let me know where you get stuck and I will add the documentation as required. Any bugs you come across, please submit a ticket in source forge. Enjoy.
DeleteCan you provide documentation of the web utility JSON API? I'm interested in porting the python remote control stuff to another language. I'm also interested in a JSON API method for listing all stations and device/station pairs that exists in the system. Thanks!
ReplyDeleteNo problem. This has been something I have been meaning to do for some time. Out of interest, what language are you porting it to? I ask as GSON is used to handle JSON requests on the Java side. This has built in NaN and infinity support for floating point numbers. Please be aware that this is not part of the JSON standard. If you are using NaN and infinity, you will either have to handle it yourself or use a parser that has support for it. I will add the documentation to the source forge wiki.
ReplyDeleteI beleive I have already built-in support for listing device/station pairs. I will check and add it if it is not there.
Thanks abrock. Documentation will follow soon.
Perl. We have an application that controls electric distribution grid devices. The app interfaces to the devices via a DNP3 master. To support our app testing efforts, I've built a test rig (in Perl) that simulates grid devices and stimulates the app. A (working) DNP3 outstation was the missing part of my setup. So far your jdnp3 project is meeting my needs. It would be ideal if I could interface with the jdnp3 web utility directly from my Perl scripts, hence my request for the JSON api.
DeleteRegarding my question on how to list device/station pairs, your web utility home page does this, so clearly it is possible. However, I didn’t see any methods for doing so in your python control and device modules. Hopefully I’ve just overlooked it, let me know what you find.
A very impressive project you have here, thanks for sharing it. The DNP3 protocol is quite the beast. What drove you to want such a learning experience, I suspect you must work in an industry that uses dnp?
I have cut a new release. The new release makes it easy to get a list of devices via the JSON message {'type':'listDevices'}. This has been put on the Wiki. A fair amount of the UI has changed, but there should be no breaking changes any where else.
DeleteIt seems we have a fair amount in common. Perl seems to be quiet popular also, probably due to the vintage of many DMS products. I am very familiar with Perl, the python should port almost line for line. If you get stuck, let me know.
Yeah, DNP3 is a fair beast, mainly due to its history. We shall see how 61850 fairs. I am glad someone else can get something out of the tool. Always happy to share :)
Thanks so much for the update! I've installed it and it has been running fine for over a week now.
DeleteHello again,
DeleteIf I've looked at your code correctly, it currently does not support DNP3 Object groups 3 and 4 (double-bit binary inputs). Is that correct?
Thanks,
Aaron
Hello, there is also connection over serial or only with TCP?
ReplyDeleteIt has been a while, but just in case someone is still looking for an answer. Yes and No.
ReplyDeletejDNP3 only supports TCP connections. I do not have access to the DNP3 standard as this is time based. However, it may be possible to use ser2net or a terminal server to convert TCP to serial.
I would consult the standard first to ensure it is compatible, but I cannot think of a reason why not.