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

# 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.2.2.tar.gz (192.5 kB view details)

Uploaded Source

Built Distribution

python_can_remote-0.2.2-py3-none-any.whl (190.3 kB view details)

Uploaded Python 3

File details

Details for the file python_can_remote-0.2.2.tar.gz.

File metadata

  • Download URL: python_can_remote-0.2.2.tar.gz
  • Upload date:
  • Size: 192.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for python_can_remote-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c1f9d499cb10d81c10ef924f470dbe480035f2a2bc78afccd4d671349e4bcf7a
MD5 dc644569423535cd473b6623ef91f43a
BLAKE2b-256 3b0e25b5986939a95594c897bef23daf97130fecb01c55f836348fd5dafd3663

See more details on using hashes here.

File details

Details for the file python_can_remote-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_can_remote-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c8c0910126c509e1145b9806c51f858cce3f55bfbd8f60ec803c82f9fcad7fbc
MD5 d22f82c14d2b1158fa2f177ec7488cbd
BLAKE2b-256 eb982ddf253f6591ab377f8318683e814021bf6f86d44187f7466bc1d2a42f3b

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