CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sat Aug 19, 2017 5:47 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Tue May 31, 2016 12:44 pm 
Offline

Joined: Fri Apr 22, 2016 3:36 pm
Posts: 5
Hi,

I'm trying to connect UAExpert to the OPC/UA on my RPI, but I get an error message "Could not connect to server: BadCommunicationError".
UAExpert Discovery service doesn't find the server either, so I have tried connecting by IP-address without luck.

I have tried the project on Control Win, works like a charm.
netstat says 'listening' on ports 4840 and 11740, so ports aren't blocked...

Does anyone have any ideas what could be blocking the connection? Reinstall the runtime?


Regards,
Daniel


Top
   
PostPosted: Fri Jun 03, 2016 1:02 pm 
Offline

Joined: Thu Jun 02, 2016 12:40 pm
Posts: 1
Hi,
I have the same problem with Raspberry CoDeSys v3.5.8.10. Try to downgrade Raspberry CoDeSys to v3.5.7.10 for do it works.


Top
   
PostPosted: Tue Jul 05, 2016 2:28 pm 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi lgruz,

How to I find the donwgrade version v3.5.7.10

I am also having some problems, maybe not the same, since I can find a way to open port 4840, but this downgrade may help me.

look forward to receive your reply.

Peter Grote


Top
   
PostPosted: Tue Jul 05, 2016 6:51 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2057
Hi,
downgrade does not solve it.
The problem is if the runtime starts before you have an valid IP address which
is usually the case the OPCUA Server does not reasign/change the address.
This leads to problems on startup (runtime works OPCUA not)
You could workaround this by a later start of the runtime (init Sleep with 20s)
If you have a port problem you could configure the port in /etc/CODESYSControl.cfg (and even which nic you want to use for OPCUA)

[CmpOPCUA]
NetworkAdapter=eth0
NetworkPort=4841


BR
Edwin


Top
   
PostPosted: Wed Jul 06, 2016 12:07 pm 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi Edwin
Thank you your help, but look into the "CODESYSControl.cfg" file on my Rpi, I was not able to add, because this file is read only.

I found that inside the Rpi Package there was a demo OPCUA project and open this and downloaded this the port 4840 was open, reason I can not find/see anywhere.

I then open up my own little project with OPCUA and downloaded this and now I am able to telnet the port 4850 and along with this also able to browse and see value in my Kepware OPC UA Client.

I am not able to find WHO and where to set the port number ex. 4840 and have also checked the "CODESYSControl.cfg" file and still no OPCUA inside this file.

Can you please help me try to understand this or show me how to set the port number for the OPC UA..

My demo project Work OK now on the 2h demo, since I do not have any license for the Rpi Control yet.

Have a great and sunny day.

Peter Grote


Top
   
PostPosted: Thu Jul 07, 2016 10:16 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2057
Hi Peter,
You need to add this section to /etc/CODESYSControl.cfg

sudo nano /etc/CODESYSControl.cfg

BR
Edwin


Top
   
PostPosted: Fri Jul 08, 2016 12:17 pm 
Offline

Joined: Thu Sep 03, 2015 11:04 pm
Posts: 20
Hi,

I recently tested the OPC UA server with my RPi and struggled with the same problems mentioned above ("Could not connect to server: BadCommunicationError") but finally found a workaround.

As Edwin explained, the OPC UA Server does not reasign/change the ip-address after the runtime start.
So I just restarted codesyscontrol:

sudo /etc/init.d/codesyscontrol stop
sudo /etc/init.d/codesyscontrol start

Afterwards I was able to connect uaExpert Client to RPi OPC UA Server.

@Edwin: What did you mean by "init Sleep with 20s" and how to implement that?

Best regards,
Oleg


Top
   
PostPosted: Fri Jul 08, 2016 1:52 pm 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi Edwin,
Thank you and I was able to edit and save the edits regarding to OPC UA.

BR
Peter Grote

Edwin Schwellinger wrote:
Hi Peter,
You need to add this section to /etc/CODESYSControl.cfg

sudo nano /etc/CODESYSControl.cfg

BR
Edwin


Top
   
PostPosted: Mon Jul 11, 2016 3:05 pm 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi Edwin,

Can you also please help at the suggestion : What did you mean by "init Sleep with 20s" and how to implement that?

OW_RPi wrote:
Hi,

I recently tested the OPC UA server with my RPi and struggled with the same problems mentioned above ("Could not connect to server: BadCommunicationError") but finally found a workaround.

As Edwin explained, the OPC UA Server does not reasign/change the ip-address after the runtime start.
So I just restarted codesyscontrol:

sudo /etc/init.d/codesyscontrol stop
sudo /etc/init.d/codesyscontrol start

Afterwards I was able to connect uaExpert Client to RPi OPC UA Server.

@Edwin: What did you mean by "init Sleep with 20s" and how to implement that?

Best regards,
Oleg


Top
   
PostPosted: Thu Aug 18, 2016 8:29 am 
Offline

Joined: Wed Aug 17, 2016 3:21 pm
Posts: 3
petergrote wrote:
Hi Edwin,

Can you also please help at the suggestion : What did you mean by "init Sleep with 20s" and how to implement that?


I added this 2 lines to /etc/rc.local before "exit 0" (edit with sudo nano /etc/rc.local )
-------
Sleep 10
sudo /etc/init.d/codesyscontrol restart
------
I hope this is useful

Claudio


Top
   
PostPosted: Wed Aug 31, 2016 1:44 pm 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi Claudio
Thank you for your suggestion and I have now tryed this, but sorry for me no luck.

Can you please look to my attached rc.local file and tell what I am doing wrong or need to change

Great help from you and for your information, if I run the "sudo /etc/init.d/codesyscontrol restart" from the termonal Windows on PRi the OPC UA Works

BR
Peter Grote

claudio wrote:
petergrote wrote:
Hi Edwin,

Can you also please help at the suggestion : What did you mean by "init Sleep with 20s" and how to implement that?


I added this 2 lines to /etc/rc.local before "exit 0" (edit with sudo nano /etc/rc.local )
-------
Sleep 10
sudo /etc/init.d/codesyscontrol restart
------
I hope this is useful

Claudio


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Sep 01, 2016 7:55 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2057
Hi Peter,

but one question:

Does this example here work:

"c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\3.5.9.10\Examples\OPCUA.project"

If you try to browse the items with your OPCUA Client?

BR
Edwin


Top
   
PostPosted: Fri Sep 02, 2016 7:46 am 
Offline

Joined: Mon Apr 11, 2016 2:29 pm
Posts: 15
Hi Edwin,

Sorry but the OPCUA project does not sole this issue, but by running from the Terminal window "sudo /etc/init.d/codesyscontrol restart" I am then able to browse the items from my OPC UA Client.

I have attached my rc.local file so that you can look into this "Claudia suggestion"

Look forward to receive your feedback.

Have a great day

BR Peter Grote

Edwin Schwellinger wrote:
Hi Peter,

but one question:

Does this example here work:

"c:\Users\<YourWindowsUserName>\CODESYS Control for Raspberry PI\3.5.9.10\Examples\OPCUA.project"

If you try to browse the items with your OPCUA Client?

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sun Oct 16, 2016 7:28 pm 
Offline

Joined: Mon Apr 22, 2013 12:30 pm
Posts: 3
Hi Folks,
Ive tried all of these hacks pertaining to opcua, pi config files, and restart codesys engine etc, and Im not having reliable repeatable success. Have there been any further developments or guidelines re getting OPCUA server to work on Raspberry pi 1.3.0.0 with CoDeSys v3.5.9.2 runtime ? We use unified-automation OPCUA SDK internally in the office for other stuff, and are familiar with opcua. But troubleshooting it on codesys pi is difficult. Im trying to thrash out a major use case / proof of concept for abstract control system development for our biggest client, so any help much appreciated. I got it to work once, then couldnt repeat it. Is there anything obviously wrong with the symbol configuration below? Im getting the raspberry pi empty config on ua expert, but not any variables that are supposedly configured to be available via opcua.
thanks
Cormac


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Oct 17, 2016 11:13 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2057
hm..
could you confirm that the miniproject from

"c:\Users\<WindowsUserName>\CODESYS Control for Raspberry PI\3.5.9.X\Examples\OPCUA.project"

works with your configuration and changed /etc/init.d/codesyscontrol (added the sleep 10 in that file in the do_start section)

BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 15 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited