CAN over network bridge for Python
Project description
Creates a CAN over TCP/IP bridge for use with python-can.
Installation
Install using pip:
$ pip install python-can-remote
Usage
Start server from command line:
$ python -m can_remote --interface=virtual --channel=0 --bitrate=500000
Create python-can bus:
import can
# Create a connection to server. Any config is passed to server.
bus = can.Bus('ws://localhost:54701/',
bustype='remote',
bitrate=500000,
receive_own_messages=True)
# Send messages
msg = can.Message(arbitration_id=0x12345, data=[1,2,3,4,5,6,7,8])
bus.send(msg)
# Receive messages
msg2 = bus.recv(1)
print(msg2)
# Disconnect
bus.shutdown()
Web interface
There is also a basic web interface for inspecting the CAN traffic using a browser. It is available on the same address using HTTP, e.g. http://localhost:54701/.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-can-remote-0.1.5.tar.gz
(540.0 kB
view hashes)
Built Distribution
Close
Hashes for python_can_remote-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2536a99c3173291bd75b2491eebfc34ada9606095d1cedb2451491150e7ced8c |
|
MD5 | 6d837f7e9776d0d0878e8bce4423f71c |
|
BLAKE2b-256 | 25b81512bb8ef7037848af2db3208ab98a8e544ed1d5e33419f46376c1043405 |