CAN bus can cope with quite a long cable run. I’m sure it can do 100 metres without too much bother.
Ethernet cable can be used for CAN - just use one pair for CANH/CANL and any other wire for GND.
To avoid ground loops over that distance, use an isolated CAN transciever at the controller end e.g. https://www.amazon.co.uk/dp/B07Q812QK8
Thanks for the reply, towen.That could definitely work, however I’d like to use the ethernet cable for other network communication. So ideally convert the CAN to use TCP/IP then back to CAN then to USB?
If you are running Linux, consider using cannelloni - it’s a program to tunnel CAN over SCTP (like a real-time TCP, unique to Linux)
You could have a raspberry pi with CAN adapter at the remote end, and the server could use a vCAN socket connected via cannelloni to the real CAN bus on the Pi.
Then, use your python code with vcan as the CAN interface and it should ‘just work’
You may need to install libsctp-dev and build cannelloni from source on both platforms, because it’s not included by default in most distributions, but it works much better than UDP transport.