opendnp3 setup help

1,442 views
Skip to first unread message

usjli

unread,
Sep 24, 2015, 3:42:31 PM9/24/15
to automatak-dnp3
Hi guys,

I'm new to the opendnp3 and raspberry pi thing, so I have been trying to get opendnp3 install on my raspberry Pi.

I followed this guide : http://tinkerlabz.com/?topic=raspberry-pi-dnp3-master-and-remote-rtu

but I'm having problem at the part where it is asking me to do $sudo autoreconf -i -f

it's telling me that configure.ac or configure.in is required, and I couldn't find out why. Can anyone help? Thanks in advance

Adam Crain

unread,
Sep 24, 2015, 3:52:07 PM9/24/15
to automatak-dnp3
Hi,

Support for autotools will be removed in the next release, so there is no autoconf stuff in the tip of the repo.

You have 2 options:

1) Checkout the last tagged stable release (2.0.1) and use that to build using autotools

https://github.com/automatak/dnp3/tree/2.0.1

2) Just use cmake to build things on the RPI:

https://automatak.com/opendnp3/docs/guide/current/build/cmake/

Cmake is very similar to autotools in the sense that it just generates a makefile.

-Adam

usjli

unread,
Sep 24, 2015, 4:05:07 PM9/24/15
to automatak-dnp3
Hi,

Thank you for your reply, although I'm curious what are the differences between the two options? between using the last release and the most current version?

J Adam Crain

unread,
Sep 24, 2015, 4:12:42 PM9/24/15
to automatak-dnp3
The changelog contains a list growing list of things since the last release:

https://github.com/automatak/dnp3/blob/2.0.x/CHANGELOG.markdown

There has only been 1 relatively trivial bug reported in 2.0.1. It is very stable.

The 2.1.0 changes are mostly geared around modifying the API and the way that the libraries build to eventually allow for secure authentication support.

-Adam

usjli

unread,
Sep 24, 2015, 4:45:56 PM9/24/15
to automatak-dnp3
Is there a guide that can help me setup it up? Cause I'm really new to dnp3

J Adam Crain

unread,
Sep 24, 2015, 5:06:55 PM9/24/15
to automatak-dnp3
The API for the outstation really hasn't change much at all from 2.0.1 -> 2.1.0.

Have a look at the companion docs for 2.1.0 for an explanation of the major interfaces:

https://automatak.com/opendnp3/docs/guide/current/api/outstations/

-Adam

J Adam Crain

unread,
Sep 24, 2015, 5:10:37 PM9/24/15
to automatak-dnp3
There's also a fully working example of bridging DNP3 to external I/O with the "piface" add on board here:

https://github.com/automatak/pifacertu

This example uses cmake and expects the opendnp3 stuff to be installed system-wide.

-Adam
Message has been deleted

usjli

unread,
Sep 24, 2015, 5:23:50 PM9/24/15
to automatak-dnp3
Yea I have the pifacertu downloaded, but is there a complete guide on how to setup opendnp3, then explain how dnp3 works with pifacertu, this is my first time using linux

J Adam Crain

unread,
Sep 25, 2015, 11:07:11 AM9/25/15
to automatak-dnp3
We do not provide a guide that will familiarize you with generic Linux development practices.

Building opendnp3 on the RPi is really no different than building on regular linux as described here:

https://automatak.com/opendnp3/docs/guide/current/build/cmake/#building-on-linux

-Adam

usjli

unread,
Sep 25, 2015, 3:10:50 PM9/25/15
to automatak-dnp3
I'm getting an error msg when i do "make", here is the error msg

[ 91%] Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerBase.cpp.o
Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/UTCTimeSource.cpp.o
Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/TimerASIO.cpp.o
Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerSerial.cpp.o
Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerBaseTCP.cpp.o
Building CXX object CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerTCPClient.cpp.o
In file included from /home/pi/dnp3/cpp/libs/src/asiopal/ASIOSerialHelpers.cpp:21:0:
/home/pi/dnp3/./cpp/libs/include/asiopal/ASIOSerialHelpers.h:24:20: fatal error: asio.hpp: No such file or directoryIn file included from /home/pi/dnp3/cpp/libs/src/asiopal/TimerASIO.cpp:21:0:
/home/pi/dnp3/./cpp/libs/include/asiopal/TimerASIO.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.

compilation terminated.
In file included from /home/pi/dnp3/cpp/libs/src/asiopal/IOServiceThreadPool.cpp:21:0:
/home/pi/dnp3/./cpp/libs/include/asiopal/IOServiceThreadPool.h:26:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
In file included from /home/pi/dnp3/./cpp/libs/include/asiopal/ASIOExecutor.h:26:0,
                 from /home/pi/dnp3/cpp/libs/src/asiopal/ASIOExecutor.cpp:21:
/home/pi/dnp3/./cpp/libs/include/asiopal/Synchronized.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
In file included from /home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:21:0:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In instantiation of ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group121Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group121Var1>&)>’:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:103:21:   required from ‘struct opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group121Var1]::<lambda(const class opendnp3::Indexed<opendnp3::Group121Var1>&)>’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3:   required from ‘opendnp3::IINField opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group121Var1]’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:141:69:   required from here
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:105:40: error: ‘this’ was not captured for this lambda function
CMakeFiles/asiopal.dir/build.make:238: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/TimerASIO.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/TimerASIO.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In instantiation of ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var1>&)>’:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:103:21:   required from ‘struct opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var1]::<lambda(const class opendnp3::Indexed<opendnp3::Group122Var1>&)>’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3:   required from ‘opendnp3::IINField opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var1]’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:210:69:   required from here
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:105:40: error: ‘this’ was not captured for this lambda function
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In instantiation of ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var2]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var2>&)>’:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:103:21:   required from ‘struct opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var2]::<lambda(const class opendnp3::Indexed<opendnp3::Group122Var2>&)>’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3:   required from ‘opendnp3::IINField opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var2]’
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:215:69:   required from here
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:105:40: error: ‘this’ was not captured for this lambda function
In file included from /home/pi/dnp3/./cpp/libs/include/asiopal/ASIOExecutor.h:26:0,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerASIO.h:26,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerBaseTCP.h:24,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerTCPClient.h:24,
                 from /home/pi/dnp3/cpp/libs/src/asiopal/PhysicalLayerTCPClient.cpp:21:
/home/pi/dnp3/./cpp/libs/include/asiopal/Synchronized.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
In file included from /home/pi/dnp3/./cpp/libs/include/asiopal/ASIOExecutor.h:26:0,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerASIO.h:26,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerBaseTCP.h:24,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerTCPServer.h:24,
                 from /home/pi/dnp3/cpp/libs/src/asiopal/PhysicalLayerTCPServer.cpp:21:
/home/pi/dnp3/./cpp/libs/include/asiopal/Synchronized.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
CMakeFiles/asiopal.dir/build.make:54: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/ASIOSerialHelpers.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/ASIOSerialHelpers.cpp.o] Error 1
In file included from /home/pi/dnp3/./cpp/libs/include/asiopal/ASIOExecutor.h:26:0,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerASIO.h:26,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerSerial.h:25,
                 from /home/pi/dnp3/cpp/libs/src/asiopal/PhysicalLayerSerial.cpp:21:
/home/pi/dnp3/./cpp/libs/include/asiopal/Synchronized.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
In file included from /home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:31:0,
                 from /home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:21:
/home/pi/dnp3/./cpp/libs/src/opendnp3/app/parsing/Collections.h:92:40: error: ‘opendnp3::TransformedCollection<T, U, Transform> opendnp3::Map(const opendnp3::ICollection<T>&, Transform) [with T = opendnp3::Indexed<opendnp3::Group121Var1>; U = opendnp3::Indexed<opendnp3::SecurityStat>; Transform = opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group121Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group121Var1>&)>]’, declared using local type ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group121Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group121Var1>&)>’, is used but never defined [-fpermissive]
/home/pi/dnp3/./cpp/libs/src/opendnp3/app/parsing/Collections.h:92:40: error: ‘opendnp3::TransformedCollection<T, U, Transform> opendnp3::Map(const opendnp3::ICollection<T>&, Transform) [with T = opendnp3::Indexed<opendnp3::Group122Var1>; U = opendnp3::Indexed<opendnp3::SecurityStat>; Transform = opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var1>&)>]’, declared using local type ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var1]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var1>&)>’, is used but never defined [-fpermissive]
/home/pi/dnp3/./cpp/libs/src/opendnp3/app/parsing/Collections.h:92:40: error: ‘opendnp3::TransformedCollection<T, U, Transform> opendnp3::Map(const opendnp3::ICollection<T>&, Transform) [with T = opendnp3::Indexed<opendnp3::Group122Var2>; U = opendnp3::Indexed<opendnp3::SecurityStat>; Transform = opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var2]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var2>&)>]’, declared using local type ‘opendnp3::MeasurementHandler::LoadValuesWithTransformTo(const opendnp3::HeaderRecord&, const opendnp3::ICollection<opendnp3::Indexed<Source> >&) [with Target = opendnp3::SecurityStat; Source = opendnp3::Group122Var2]::<lambda(const opendnp3::Indexed<opendnp3::Group122Var2>&)>’, is used but never defined [-fpermissive]
In file included from /home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp:21:0:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In lambda function:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3: warning: control reaches end of non-void function [-Wreturn-type]
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In lambda function:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3: warning: control reaches end of non-void function [-Wreturn-type]
In file included from /home/pi/dnp3/./cpp/libs/include/asiopal/ASIOExecutor.h:26:0,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerASIO.h:26,
                 from /home/pi/dnp3/./cpp/libs/include/asiopal/PhysicalLayerBaseTCP.h:24,
                 from /home/pi/dnp3/cpp/libs/src/asiopal/PhysicalLayerBaseTCP.cpp:21:
/home/pi/dnp3/./cpp/libs/include/asiopal/Synchronized.h:24:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h: In lambda function:
/home/pi/dnp3/cpp/libs/src/opendnp3/master/MeasurementHandler.h:106:3: warning: control reaches end of non-void function [-Wreturn-type]
CMakeFiles/asiopal.dir/build.make:100: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/IOServiceThreadPool.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/IOServiceThreadPool.cpp.o] Error 1
CMakeFiles/asiopal.dir/build.make:123: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/ASIOExecutor.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/ASIOExecutor.cpp.o] Error 1
CMakeFiles/opendnp3.dir/build.make:928: recipe for target 'CMakeFiles/opendnp3.dir/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp.o' failed
make[2]: *** [CMakeFiles/opendnp3.dir/cpp/libs/src/opendnp3/master/MeasurementHandler.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/asiopal.dir/build.make:307: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerTCPClient.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerTCPClient.cpp.o] Error 1
CMakeFiles/asiopal.dir/build.make:284: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerSerial.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerSerial.cpp.o] Error 1
CMakeFiles/asiopal.dir/build.make:146: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerTCPServer.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerTCPServer.cpp.o] Error 1
CMakeFiles/asiopal.dir/build.make:215: recipe for target 'CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerBaseTCP.cpp.o' failed
make[2]: *** [CMakeFiles/asiopal.dir/cpp/libs/src/asiopal/PhysicalLayerBaseTCP.cpp.o] Error 1
CMakeFiles/Makefile2:96: recipe for target 'CMakeFiles/asiopal.dir/all' failed
make[1]: *** [CMakeFiles/asiopal.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:166: recipe for target 'CMakeFiles/opendnp3.dir/all' failed
make[1]: *** [CMakeFiles/opendnp3.dir/all] Error 2
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2

obinna Igbe

unread,
Sep 25, 2015, 3:59:57 PM9/25/15
to automatak-dnp3
Hi Usjli,

Given that you're new to both Linux and this branch of opendnp3, I would recommend you search for errors in the previous thread as the thread helped me a lot earlier this year when I started using this branch. It would go a long way in helping you troubleshoot any one of them you encounter. If you search the previous threads, you would see that the asio.hpp being reported in your error log is necessary for the successful compilation of your program:

You need to add the include part of the asio library before building as stated in https://automatak.com/opendnp3/docs/guide/current/build/cmake/#building-on-linux

Hence, you need to first download asio to your home folder from here http://sourceforge.net/projects/asio/files/asio/1.10.6%20%28Stable%29/

 then, you need to add the asio include path to your bashrc
you can achieve this by running this in your home dir:
echo "export ASIO_HOME=~/asio-asio-1-10-6/asio/include" >> .bashrc
but replace asio-asio-1-10-6 with the asio folder name you downloaded:
then initialize the .bashrc by running:
source ~/.bashrc; echo "ASIO_HOME set to: $ASIO_HOME"
This should print your asio include path to your terminal, and you can go back and continue with your CMake stuff.

-Obinna

Tommi

unread,
Sep 25, 2015, 8:18:46 PM9/25/15
to automatak-dnp3
I set the ASIO_HOME to the file i downloaded and located the asio.cpp, but i'm still getting errors.
commands i did after setting ASIO_HOME:
cmake .
make

and here is the error message, it looks like the measurementhandler is giving me errors?

also here is the my lib versions
Libtool 2.4.2
G++ 4.7.2
CPP 4.6.3
GCC 4.6.3
asio 1.10.6
errorMsg.png

obinna Igbe

unread,
Sep 25, 2015, 9:16:22 PM9/25/15
to automatak-dnp3
Try using g++/gcc version >= 4.8.  

-Obinna

J Adam Crain

unread,
Sep 26, 2015, 5:10:12 PM9/26/15
to automatak-dnp3
I think Obinna is right. It's probably some c++11 nuance that gcc 4.6/4.7 doesn't understand.

Here's a good guide for getting gcc 4.8 onto your PI:

https://somewideopenspace.wordpress.com/2014/02/28/gcc-4-8-on-raspberry-pi-wheezy/

Tommi

unread,
Sep 28, 2015, 6:54:58 PM9/28/15
to automatak-dnp3
cool it's really the version of gcc, now i updated it and its working fine. As i move forward with my project into the PiFacertu, it said libpiface 1.0 is required, i was having trouble when importing piface.emulator. It said ImportError: No Module named pygtk. I tried to install the gtk by using sudo apt-get install python-gtk2 but it said its not available, is this because of the version problem?

Tommi

unread,
Sep 29, 2015, 2:49:08 PM9/29/15
to automatak-dnp3
As i went through some documentation, the new version only need to import pifacedigitalio instead of importing both piface.pfio and emulator. So i went on and do the following commands:
./autogen.sh
./configure --prefix=/usr
make
sudo make install

Everything seems to be working until I went on and compile on pifacertu, here is the errors i'm getting
errorMsgAtPiFace.png

Adam Crain

unread,
Sep 29, 2015, 3:55:09 PM9/29/15
to automatak-dnp3
Glad to hear that everything is compiling now!

The API has shifted as we move towards the 2.1.0 release and I have not updated the piface demonstration project.

It was last known to be working against 2.0.1 (the last stable release).

I won't be updating the piface project until we have a 2.1.0 release candidate, but that shouldn't be too much longer.

-Adam

Adam Crain

unread,
Sep 29, 2015, 4:25:41 PM9/29/15
to automatak-dnp3
I took a quick look, and the changes were really minimal so I commited it to a new branch called "2.1.0"  in the pifacertu repo:


Check this out and link this against the tip of 2.0.x for opendnp3 and everything shoudl be fine.

Once we have a release candidate we can merge this into master and delete the 2.1.0 branch.

-Adam

Tommi

unread,
Sep 29, 2015, 5:25:04 PM9/29/15
to automatak-dnp3
Hi Adam,

Thanks for being such a great help, however I ran into another problem while using the 2.1.0 pifacertu
channelretrymsg.jpg

Adam Crain

unread,
Sep 30, 2015, 9:47:20 AM9/30/15
to automatak-dnp3
I changed the signature of AddServer and created the "ChannelRetry" config class to reduce the number of parameters just last week.

If the version of opendnp3 you have checked out and built on the RPi is older than ~week I'd expect this error. Let me know.

Once again, sorry for the confusion, the API won't be shifting like this once we our 2.1.0 release candidate ready.
...

Tommi

unread,
Sep 30, 2015, 3:29:19 PM9/30/15
to automatak-dnp3
Hi Adam,

I went on and downloaded the latest version of dnp3-2.0.x, but as I was compiling using "make" command, i saw some warnings from make saying the "Clock skew detected. Your build may be incomplete." When I get to the sudo make install, this is the msg that's showing me. I see it is saying asio.hpp is not found, but I have already set my ASIO_HOME variable. x.x
...
asio.hpp not found.jpg

Adam Crain

unread,
Sep 30, 2015, 4:22:43 PM9/30/15
to automatak-dnp3
Clock-skew warnings from make are almost always because some build artifacts (object files, libraries, executable) have a date that's in the future. This may just be a result of your RPi syncrhonizing it's time via NTP.

Regarding ASIO_HOME, please check on the command, e.g.>

> echo $ASIO_HOME

Ensure that this directory exists and points to the folder that contains "asio.hpp".

-Adam


...

Tommi

unread,
Sep 30, 2015, 4:46:23 PM9/30/15
to automatak-dnp3
Yes the directory is there.
...
ASIOHOME.jpg

Tommi

unread,
Sep 30, 2015, 6:15:16 PM9/30/15
to automatak-dnp3
I did a fresh install on all files but the problem still exist :\
...

Adam Crain

unread,
Sep 30, 2015, 10:36:55 PM9/30/15
to automatak-dnp3
Without changing anything, run:

> make VERBOSE=1

This will allow us to see what is getting passed to the compiler for arguments.

-Adam
...

Chris Sistrunk

unread,
Sep 30, 2015, 11:08:27 PM9/30/15
to automat...@googlegroups.com, Adam Crain

It sounds like if more people are getting involved with putting opendnp3 on a brand new RPi with a piface, a complete step-by-step how-to is needed in the github. I did it ages ago, but I don't remember what I did and the code has certainly evolved since then.

I've had quite a few people ask about this.

On one hand I can see why googling it and struggling to make it work is good...learning by doing...but I also see the benefit of having a guide for people eager to learn...even beginners.

I just bought a RPi2 and now all I need is a PiFace2. When I get a chance I'll try to work on starting a start to finish how-to.

Chris

Adam Crain

unread,
Oct 1, 2015, 9:52:25 AM10/1/15
to automatak-dnp3, jadam...@automatak.com
I'd happily accept a 3rd party guide. The way to do it would be to use the Github Wiki feature on the repo itself:


If this is something you're interested in doing Chris, let me know and I'll give you write access. If you're unsure how the wiki works, I'd be happy to
give you a tutorial via google hangouts sometime.

BTW, it's my understanding that the original piface should be pin-compatible w/ the RPi2. Have you read otherwise?

-Adam

Tommi

unread,
Oct 1, 2015, 3:12:44 PM10/1/15
to automatak-dnp3, jadam...@automatak.com
Hi Adam,

Here is the file from make VERBOSE. And yes Chris, I was inspired by your piface project and try to do the same, but seems like thing have evolved and i'm struggling to make it work.
...
Verbose

Adam Crain

unread,
Oct 1, 2015, 3:18:22 PM10/1/15
to automatak-dnp3, jadam...@automatak.com
I should have been clearer. This looks like the library build. I need to see the detailed error output from the pifacertu build when invoked with VERBOSE=1.

I'm trying to see if the ASIO location is being properly sent to the compiler.

-Adam
...

Tommi

unread,
Oct 1, 2015, 3:32:28 PM10/1/15
to automatak-dnp3, jadam...@automatak.com
Hi Adam,

You are right, pifacertu wasn't compiling correctly, but now after I downloaded the updated version of opendnp3, the problem happens while compiling the dnp3 on sudo make install command. I have also attached both dnp3 compiling errors and pifacertu make error verbose, thank you!
...
pifacertu verbose
dnp3 verbose

Adam Crain

unread,
Oct 1, 2015, 3:57:57 PM10/1/15
to automatak-dnp3, jadam...@automatak.com
Ok, the error output from the opendnp3 build is complaining about not finding ASIO_HOME.

I have no idea why it would not be finding your environment variable.

Fortunately, there is another way to define it.  We can try doing it via the command line.

Try reconfiguring your build by adding the following:

> cmake [whatever options you were  using] -DASIO_HOME=<path to asio include dir>

This will force cmake to use a fixed directory for ASIO.

Once we get this working and installed, we can worry about the pifacertu.

-Adam

...

Tommi

unread,
Oct 1, 2015, 4:39:44 PM10/1/15
to automatak-dnp3, jadam...@automatak.com
Very cool, just learned a new way to define variable, now dnp3 will compile to the end! 
I went on and try to compile pifacertu, here is the error msg I got
...
pifacertuError.jpg

Cornel Verster

unread,
Oct 2, 2015, 3:28:28 AM10/2/15
to automatak-dnp3, jadam...@automatak.com
Hey Tommi.

From looking at your pic, you can see that the error the compiler gave is a linking error (undefined reference to ***). That means it can't find the libraries so did you copy them into the correct library folder? The libraries you require are libasiodnp3.so, libasiopal.so, libopendnp3.so and libopenpal.so. Have a look for them in /usr/local/lib, and if they are there, try copying them to /usr/lib folder. You can see the compiler is trying to link them from the command including "... -lopendnp3 -lopenpal -lasiodnp3 -lasiopal ..."

Also, I want to encourage you to google the errors you get even before you ask questions on a forum. Most of the time you will find answers to errors like that on sites like www.stackoverflow.com. Asking questions on a forum is definitely not bad, but you will get faster answers from Googling and it also saves time of people answering as many questions are generic. I found that having a look yourself first really helped me to learn a lot faster and understand deeper of what is actually going on. If you get stuck, you can always ask!

Hope it helps.
Cornel
...

Adam Crain

unread,
Oct 2, 2015, 11:23:38 AM10/2/15
to automatak-dnp3, jadam...@automatak.com
Cornel is correct that this is a linking problem, but I think it's a little more subtle than that.

The methods/types it's complaining it can't find are the ones that I added to the API. This means it's finding an older version of the library somewhere. Another way of phrasing this is that headers and libraries aren't matching.

Try deleting libasiodnp3.solibasiopal.so, libopendnp3.so and libopenpal.so from /usr/lib and /usr/local/lib if they accidently got installed there.

Reinstall the dnp3 libraries to /usr/lib using "make install".  (use -DCMAKE_INSTALL_PREFIX=/usr when running cmake)

I think this is just linking against old libraries.
...

Tommi

unread,
Oct 2, 2015, 3:26:35 PM10/2/15
to automatak-dnp3, jadam...@automatak.com
Hi Cornel and Adam,

Yes I would of google it if I know what's the error msg was telling me, but unfortunately with my current knowledge to linux, I wasn't able to notice the errors. 

Also deleting the old library actually worked, pifacertu compiled to the end yay! Thank you so much for all the help from everyone :) 
...

J Adam Crain

unread,
Oct 2, 2015, 3:32:43 PM10/2/15
to automatak-dnp3, jadam...@automatak.com
Awesome. Let us know if it works as expected.

You should be able to connect a dnp3 master, and send latch on/off CROBs to indices 0-7.

Latching 0/1 on/off should cause the relay on the board to toggle (you should hear it click).

When you push the buttons, you should be able to scan and see the binary inputs change state.

Chris Sistrunk and I have discussed perhaps implementing the advanced CROB features to allow you send step functions
to the board to the logic level outputs on indices 2-7. You can then use these to drive a stepper motor.

-Adam
...
Reply all
Reply to author
Forward
Message has been deleted
0 new messages