So, I’m working on a sketch that reads and relays data from a Universal UR10E.
Grabs the data over TCP modbus, formats the data 2 ways.
Osc that it sends to localhost
Websocket as JSON
The wired ethernet connection to the robot has no internet connection, so the websocket sends via WiFi.
On Windows, works great.
On Mac, will do one or the other.
I’ve reordered the Network connection list, no success.
Moved the websocket connection to a separate thread, still nothing. Also tried setting the wired connection with a manual IP. Same thing
I’ve run out of guesses and would appreciate it if you have any
Hi @npuckett, Welcome to the forum. What I know doesn’t overlap very well with this but I’d like to clarify a couple of things.
“Universal UR10E” is a robot arm thing (I just Googled), with cat-5 ethernet connection? “the robot” same thing? I think I need quick sketch to see where everything is and what’s sending to what.
Send to localhost - for a web-page? Is this all on e.g. a home network with WiFi router? Have you looked at the ip addresses in both situations?
Apologies - there are lots of moving pieces here that need clarifying.
The point of the program is to communicate with the robot arm, get data from it, and then package up that data in 2 formats - OSC and JSON to a Websocket. Modbus is a bit finnicky to deal with, so the idea is have this one program connecting and redistributing the data to other programs in an easier format.
UR10E = Robot Arm. It allows communication via the modbus protocol over either serial or TCP. I’m using TCP via a wired eithernet connection. I’m doing that via EasyModbus Java Library. The computer and the robot arm are both plugged into the same router via wired ethernet. That router has no internet connection because hooking the robot directly up to the internet is a very bad idea.
The localhost connection is for the OSC data. The idea being that another Processing sketch or any program that can read OSC would get the data and use however it wants. The assumption being that this program is running locally on the same computer running the connection/server sketch.
The second part of this came from the idea of being able to also be able to respond to the data in P5. So, it sends the same data as JSON to a heroku app running a simple socket server. It can do that because the computer is connected to the internet via the Wifi connection.
Amazingly, it works - on windows. On MacOS, I can only get it to either: connect to the robot via the ethernet cable OR connect to the websocket server.
That’s all much clearer. You are reminding me of a situation where I wanted my PC connected to two test networks, both already established, and both 192.168.1. which doesn’t work, or doesn’t work for everything. Your PC/Mac is on 2 networks, and I think they have to be different sub-nets. e.g. If the infrastructure WiFi is giving your PC 192.168.1.5, set the non-internet router to 192.168.2.1 and give out (DHCP) 192.168.2.2 etc.
That is a good thought, but they are on 2 networks with different IP ranges and subnets. The wifi network is at the University, so its an enterprise level setup whereas the wired connection is just a simple switch. I would find it much easier to understand if it didn’t work at all, but working on one platform and not the other has me puzzled.
Are you suggesting it might be better if both connections had the same general IP range?
I’m saying they should be on a different range, as you have said they are. “Just a simple switch” - so the PC/Mac and the robot-arm have manually entered IP addresses. (?) If it were a router (like we all have at home) that could give them IP addresses (DHCP).
Robot has a fixed IP, the computer gets a dynamic one via DHCP on both the wired and wireless connection.
Seems alright, as long as the Robot’s fixed IP isn’t the same as one the DHCP gives out (unlikely I agree). A confusion with IP addresses is something that might be different from one PC to the next, without necessarily being because it’s a Mac.