odva_ethernetip multiple devices in the same machine
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 localport 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 localport=2211 keeps blocked waiting for an implicit message that never arrives.
I used omronos32cdriver code as a source of inspiration on how to use the odvaethernetip API. Omron driver, at the main(), constructs the UDP socket with the localport 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 odvaethernetip package or from people having used the omronos32c_driver with multiple lidars.
thanks a lot,
andreu
OS: Ubuntu16.04, ROS-Kinect
Asked by Andreu on 2017-11-30 04:33:33 UTC
Comments
Is ros-drivers/omron#12 related?
Asked by gvdhoorn on 2017-11-30 04:45:33 UTC
Yes, absolutely. And it seems that it is not solved.
Asked by Andreu on 2017-11-30 06:18:21 UTC
I have some interest in this issue. Has there been any change in status?
Asked by wpmccormick on 2019-03-08 14:53:34 UTC