Basically what I have attempted so far has been the following:
Install ubuntu desktop 20.10
download openPOWERLINK 2.1 and copied to ubuntu drive directory "oplk_Pi4"
I installed libcpap and cmake using apt:
sudo apt-get install libpcap0.8 libpcap0.8-dev libpcap-dev
sudo apt get install cmake
sudo apt get install cmake-gui
After doing this I tried to follow the steps for setting up the CN in the guide linked above. So the steps describe in "4. Compile and build CN"
Used CMake-gui to build stack in Debug mode
make install
Used Cmake-gui to build stack in release mode
make install
The guide specifies the reversed order, Release mode first then Debug but I found an answer here on the forum specifying that Debug should be installed first.
Building and installing the stack seems to be working fine, no errors appeared.
Then I move on to try and install the PCAP User Space Daemon. I follow the steps from the guide but when I specify the paths in Cmake-gui I get the error shown in picture err1.png.
It was possible to close the dialog and un-check the box CFG_OPLK_MN, change BUILD_TYPE to Debug and press "Generate" to build.
However, when I attempt to run "make install" I get the error shown in err2.png.
Regarding the order of the build types, Release and Debug, I have attempted both the order specified in the guide as well as the one that was suggested in the forum post I read but I end up with the same error in the end.
I'm not an experienced linux user and therefore have a hard time figuring out what is wrong. Do you have any input on how I can fix this issue and move forward?
I assume that you have installed the Ubuntu on RPi and performing a native compilation.
The order of build between debug and release does not matter as long as you do a make install before changing the build type. It copies the debug or release libraries into the lib directory until you perform a make clean.
Coming to the error here,
- You were right to uncomment MN build to fix the first CMake error.
- For the second error, its not related to the build configuration. Rather, if you can see in the log, the linker is not able to find the libdbus-1 library. This is not a typical error you face in OPLK compilation; but I assume you could resolve it by installing libdbus-1 or libdbus-1-dev library on Ubuntu.
Thank you so much for your input! This has helped me move forward. As you pointed out the issue was that the libdbus had not been installed, which I thought I had checked...
After installing the library I was able to successfully build the Pcap daemon.
Using CMake-gui to build PCAP User Space Daemon in Debug mode
make install
Using CMake-gui to build PCAP User Space Daemon in Release mode
make install
Followed by building the demo_cn_console. Here I'm not sure what settings to use for the build since the picture in the guide was for the demo_mn_console (even though I'm following the steps for the CN devices) so the settings available were a bit different, I have attached a PrtScr of the settings I used.
Using CMake-gui to build Demo_Cn in Debug mode
make install
Using CMake-gui to build Demo_Cn in Release mode
make install
in oplkd-pcap directory: sudo modeprobe tun
./oplkcnd-pcap
This seems to be working and I get a "Running" status feedback from the openPOWERLINK kernel stack daemon
However, when I try to run the cn demo:
in demo_cn_console directory: ./demo_cn_console
After selecting the ethernet card (eth0 in this case) I get an error stating that oplk_initialize() failed, as can be seen in err3.png.
Is this caused by me using the wrong settings when building the demo? What settings are the correct ones? Is there something else that has to be setup that I'm missing?
Once again thank you for the support.
Best regards
Glad that it helped.
You are right to use the demo_cn_console to build the CN demo and the settings look fine.
Just an fyi here, you don't have to build the app twice though. Either Debug or Release build is fine. For application builds, the binary from latest build replaces the previous build binaries. When you build a Debug app, it uses the debug stack library and when you build a release app, it uses the release stack library.
The problem you see here are more likely due to insufficient permission level. Try to run both the driver and app as super user or in sudo mode. You should get it working.
Hello everyone,
I'm trying to implement the openPOWERLINK stack on a raspberry Pi4 B which I want to use as a CN node. The plan is to use a B&R-PLC as MN.
I have tried to follow the guide: https://www.kalycito.com/introduction-on-how-to-get-powerlink-working-on-raspberry-pi-2/ but I have made some changes to the procedure since I'm using a new version of the Pi. I have also made adjustments to the procedure according to information I have found here on the forum.
Basically what I have attempted so far has been the following:
Install ubuntu desktop 20.10
download openPOWERLINK 2.1 and copied to ubuntu drive directory "oplk_Pi4"
I installed libcpap and cmake using apt:
sudo apt-get install libpcap0.8 libpcap0.8-dev libpcap-dev
sudo apt get install cmake
sudo apt get install cmake-gui
After doing this I tried to follow the steps for setting up the CN in the guide linked above. So the steps describe in "4. Compile and build CN"
Used CMake-gui to build stack in Debug mode
make install
Used Cmake-gui to build stack in release mode
make install
The guide specifies the reversed order, Release mode first then Debug but I found an answer here on the forum specifying that Debug should be installed first.
Building and installing the stack seems to be working fine, no errors appeared.
Then I move on to try and install the PCAP User Space Daemon. I follow the steps from the guide but when I specify the paths in Cmake-gui I get the error shown in picture err1.png.
It was possible to close the dialog and un-check the box CFG_OPLK_MN, change BUILD_TYPE to Debug and press "Generate" to build.
However, when I attempt to run "make install" I get the error shown in err2.png.
Regarding the order of the build types, Release and Debug, I have attempted both the order specified in the guide as well as the one that was suggested in the forum post I read but I end up with the same error in the end.
I'm not an experienced linux user and therefore have a hard time figuring out what is wrong. Do you have any input on how I can fix this issue and move forward?
Thank you for reading!
Best regards
Hi Erik,
make install
before changing the build type. It copies the debug or release libraries into the lib directory until you perform amake clean
.Coming to the error here,
- You were right to uncomment MN build to fix the first CMake error.
- For the second error, its not related to the build configuration. Rather, if you can see in the log, the linker is not able to find the libdbus-1 library. This is not a typical error you face in OPLK compilation; but I assume you could resolve it by installing libdbus-1 or libdbus-1-dev library on Ubuntu.
Let me know if you need any help.
Best Regards,
#aeicoriiotteam
Thank you so much for your input! This has helped me move forward. As you pointed out the issue was that the libdbus had not been installed, which I thought I had checked...
After installing the library I was able to successfully build the Pcap daemon.
Using CMake-gui to build PCAP User Space Daemon in Debug mode
make install
Using CMake-gui to build PCAP User Space Daemon in Release mode
make install
Followed by building the demo_cn_console. Here I'm not sure what settings to use for the build since the picture in the guide was for the demo_mn_console (even though I'm following the steps for the CN devices) so the settings available were a bit different, I have attached a PrtScr of the settings I used.
Using CMake-gui to build Demo_Cn in Debug mode
make install
Using CMake-gui to build Demo_Cn in Release mode
make install
in oplkd-pcap directory: sudo modeprobe tun
./oplkcnd-pcap
This seems to be working and I get a "Running" status feedback from the openPOWERLINK kernel stack daemon
However, when I try to run the cn demo:
in demo_cn_console directory: ./demo_cn_console
After selecting the ethernet card (eth0 in this case) I get an error stating that oplk_initialize() failed, as can be seen in err3.png.
Is this caused by me using the wrong settings when building the demo? What settings are the correct ones? Is there something else that has to be setup that I'm missing?
Once again thank you for the support.
Best regards
Hi Erik,
Glad that it helped.
You are right to use the demo_cn_console to build the CN demo and the settings look fine.
Just an fyi here, you don't have to build the app twice though. Either Debug or Release build is fine. For application builds, the binary from latest build replaces the previous build binaries. When you build a Debug app, it uses the debug stack library and when you build a release app, it uses the release stack library.
The problem you see here are more likely due to insufficient permission level. Try to run both the driver and app as super user or in sudo mode. You should get it working.
Best Regards,
#aeicoriiotteam
Running it as sudo solved the issue. So the demo seems to be running properly.
Thank you for the support and the clarification!
Best regards
Great. Cheers !!