cob-cpcusb
CPC-USB/ARM7 adapter support for canopen-bench: a python-can
backend plus the bench's adapter-card UI, in one package. It registers
two entry points — a can.interface driver for any python-can user, and
a canopen_bench.plugins adapter card for the bench specifically.
This is a separate distribution. It shares the canopen-bench
repository but not its package: own pyproject.toml, own version, own
tests, installed on its own. pip install canopen-bench does not bring
it — install it only if you have this adapter. It is here as the worked
reference for what a plugin package looks like.
Protocol
The adapter's USB protocol — identifiers, endpoints, transfer framing,
message types, SJA1000 register semantics, bit timing and the required
initialization order — is documented in PROTOCOL.md.
That interface data was read off the mainline Linux driver
drivers/net/can/usb/ems_usb.c (© 2004–2009 EMS Dr. Thomas Wuensche),
which is its only public verified description. The implementation here
is a pyusb/libusb userspace driver against that protocol; none of the
kernel driver's own machinery (URB handling, sk_buff/netdev integration,
the Linux CAN error-frame state machine, TX queue and echo handling) has
a counterpart in it.
License
MIT, see LICENSE — same as the canopen-bench core.
This package was GPL-2.0-only until decode_bulk_packet was
reimplemented against PROTOCOL.md; that one function had followed the
kernel driver's control flow rather than just its protocol facts. The
reasoning, and what remains in common, is written up in
PROTOCOL.md.
Install
pip install cob-cpcusb
pip install -e ./plugins/cob-cpcusb # or editable, from a clone's root
The driver needs only python-can and pyusb:
import can
bus = can.Bus(interface="cpcusb", bitrate=250_000)
The adapter card shows up in canopen-bench (1.x) once both are installed; pip does not bring the bench along.
pyusb needs libusb. On Windows it comes with the install
(libusb-package), and the device must be bound to WinUSB once — a
Zadig step (select the CPC-USB/ARM7 device,
driver = WinUSB). On Linux and macOS it is the system's libusb-1.0
(apt install libusb-1.0-0, brew install libusb).
What's in here
cob_cpcusb/bus.py—can.BusABCimplementation, driven over native USB bulk transfers (no vendor DLL, no COM-port framing)cob_cpcusb/plugin.py— the bench-side adapter card (BenchPlugin.adapters()/adapter_backends())cob_cpcusb/protocol.py— CPC-USB wire protocol constants/framing
Both halves ship in one package deliberately: the adapter card is meaningless without the driver it points at, and vice versa.
Tests
pip install -e .[dev]
pytest tests/
Metadata
Release files for cob-cpcusb 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cob_cpcusb-1.1.2.tar.gz | 15.9 kB | With provenance | Details for cob_cpcusb-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cob_cpcusb-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for cob_cpcusb-1.1.2-py3-none-any.whl |
Total release size: 28.5 kB
Release files / cob_cpcusb-1.1.2.tar.gz
| Download URL | cob_cpcusb-1.1.2.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff24bf23c2da60798fc2da4055c10fc68f408e85bc5c7eb8ce5f7446aeea7709
|
|
BLAKE2b-256 checksum How to use checksums |
66e26b298142f1f944beb761dde67b0fea2db35d700299c81e1500c5019cb05a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logRelease files / cob_cpcusb-1.1.2-py3-none-any.whl
| Download URL | cob_cpcusb-1.1.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9baeaf6432b7c8756b6b85fb77d08ab3652ddb47eb1672467df9e3389e86eac3
|
|
BLAKE2b-256 checksum How to use checksums |
066531164d2a5228cf5e6bc8bb996e22efd8015b24e3b83790ab9a77074ac03f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logSecurity for cob-cpcusb 1.1.2
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.
Attestation for cob_cpcusb-1.1.2.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 Nov 3, 2026.
Transparency logA 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.