Skip to main content

CI PyPI version PyPI - Python Version

can-waveshare

python-can backend for the Waveshare 2-CH-CAN-TO-ETH bridge that uses a fixed 13‑byte TCP wire format. Works with python -m can.viewer/logger/player and plain can.Bus(...).

Transport: TCP server on the device (e.g., :20001 for CAN1, :20002 for CAN2).
Frames: 13 bytes: [flags/dlc][id:4][data:0..8 padded]

References

Install

pip install can-waveshare
# or from source (editable):
pip install -e .[dev]

Use with CLI

# Most portable: pass channel as host:port
python -m can.viewer -i waveshare -c 172.31.11.67:20001

# Or forward kwargs directly to the bus:
python -m can.viewer -i waveshare --bus-kwargs host=172.31.11.67 port=20001

Config via ~/.canrc

The stock CLIs read only the [default] section. Put this in ~/.canrc:

[default]
interface = waveshare
channel   = 172.31.11.67:20001

Then:

python -m can.viewer

If you want multiple profiles, either (a) swap rc files or (b) write a tiny launcher in code and use Bus(config_context="waveshare2") to select other sections.

Use in code

import can

# explicit kwargs:
with can.Bus(interface="waveshare", host="172.31.11.67", port=20001) as bus:
    bus.send(can.Message(arbitration_id=0x123, data=b"\x11\x22\x33", is_extended_id=False))
    print(bus.recv(1.0))

# or via channel (parses host:port, tcp://host:port, [ipv6]:port, or aliases can1/can2):
with can.Bus(interface="waveshare", channel="172.31.11.67:20001") as bus:
    print(bus.recv(1.0))

Features & Notes

  • CAN 2.0 (0..8 data bytes). CAN‑FD not supported by Waveshare wire format.
  • Software filters (can_filters) supported in the backend.
  • Best‑effort own‑echo suppression when receive_own_messages=False (default). Set True to see echoes.
  • Periodic TX via bus.send_periodic(...) works (python-can broadcast manager calls send() repeatedly).

License

Apache 2.0

Metadata

Release files for can-waveshare 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for can-waveshare 0.1.0
File Size Uploaded Provenance
can_waveshare-0.1.0.tar.gz 15.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for can-waveshare 0.1.0
File Interpreter ABI Platform
can_waveshare-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.9 kB

Release files / can_waveshare-0.1.0.tar.gz

Download URL can_waveshare-0.1.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a7f6681dce187bbaeea67b31cce0e32e74a1dac8198994d4b4fdda383eda80a6
BLAKE2b-256 checksum
How to use checksums
21faf5f6bc3b1ef2f02aeeb5af31c4f193d98c2e0f6e2e28acc5dd3e10d4076e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2025.

Transparency log

Release files / can_waveshare-0.1.0-py3-none-any.whl

Download URL can_waveshare-0.1.0-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
039033b1cb9d9631198dddd4af860a0c1e3ede4fdc444c41b1adfe5dc9447548
BLAKE2b-256 checksum
How to use checksums
dfab239a5c1514c0a3541f64f671c60a09b05baa191ee92f1347ece6916c26f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2025.

Transparency log

Security for can-waveshare 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for can_waveshare-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page