odva_ethernetip multiple devices in the same machine

asked 2017-11-30 03:33:33 -0500

Dear all,

I'm developing a ROS node for an ethernet/ip device, using the odva_ethernetip package. I use the implicit messaging feature, so I create an instance of eip::Session and set an IO connection with function eip::Session::createConnection() , which sets a periodic data stream between the computer and the device through UDP sockets, in both directions. It works fine for a single device.

But I want to connect the same computer to several devices, and an exception is thrown when the computer tries to create a second eip::Session instance, required to communicate with the second device , indicating that the socket can't be bind to port 2222, since the port is already bound to the UDP socket used by the first IO connection:

what(): bind: Address already in use

So I decided to create the UDPsocket (required as argument by eip::Session constructor) with different local_port argument (for instance 2211), an then the constructors of both instances are correctly executed and the above exception is not thrown anymore. However , in that case, the implicit messaging does not work properly. It seems that the Session::receiveIOPacket() function of the Session instance with local_port=2211 keeps blocked waiting for an implicit message that never arrives.

I used omron_os32c_driver code as a source of inspiration on how to use the odva_ethernetip API. Omron driver, at the main(), constructs the UDP socket with the local_port set to 2222 (hardcoded), so I also wonder if this omron node main function works for multiple node instances working in the same machine.

Any comment, reply or suggestion is welcome, from both people knowing the odva_ethernetip package or from people having used the omron_os32c_driver with multiple lidars.

thanks a lot,

andreu

OS: Ubuntu16.04, ROS-Kinect

edit retag flag offensive close merge delete

Comments

gvdhoorn gravatar image gvdhoorn  ( 2017-11-30 03:45:33 -0500 )edit

Yes, absolutely. And it seems that it is not solved.

Andreu gravatar image Andreu  ( 2017-11-30 05:18:21 -0500 )edit

I have some interest in this issue. Has there been any change in status?

wpmccormick gravatar image wpmccormick  ( 2019-03-08 13:53:34 -0500 )edit