Skip to main content

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
import can_remote

# Create a connection to server. Any config is passed to server.
bus = can_remote.RemoteBus('ws://localhost:54701/',
                           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.3.tar.gz (537.7 kB view details)

Uploaded Source

File details

Details for the file python-can-remote-0.1.3.tar.gz.

File metadata

File hashes

Hashes for python-can-remote-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4f425387366cb6896f5bdb4ff5c793a4d7a8b8ef5d44226ad060832ea1e07741
MD5 5e9c3171a655951b86995cc0759d1401
BLAKE2b-256 5bb256a7db89b0419a2aee17921269adbaa0400662f269b91a09915820f22964

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page