Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

python-can-canpal

CANPAL USB and TCP client backend for python-can.

0.1.0rc4 is an experimental preview. Full hardware release acceptance is incomplete. Use it for evaluation on an isolated test bench. It is not the qualified 0.1.0 release.

Install

Requires Python 3.12, python-can 4.6.1 and pySerial 3.5. Platform wheels include the pinned CANPAL native SDK and required non-system runtime libraries.

Platform Python process
Windows 11 x64 64-bit or 32-bit (WOW64)
Ubuntu 24.04 x86_64 64-bit

The Windows win32 wheel requires 32-bit Python; it does not qualify a 32-bit Windows OS. Windows x86 installation was verified with Smart App Control off; enforced application control previously blocked the unsigned native runtime. Linux ARM64 remains a local development candidate tested with QEMU, without physical ARM acceptance. ARM64, ARM32, Windows ARM64 and Linux i686 wheels are not part of this release.

python -m pip install --only-binary=:all: python-can-canpal==0.1.0rc4

The MIT license applies to the Python plugin, tests and documentation. The native SDK and bundled third-party libraries have separate terms included in the platform wheel. Firmware and OS device drivers remain separate. The bundle uses QtCore, QtNetwork and QtSerialPort under LGPLv3, with their third-party notices. The SDK is covered by LICENSE-CANPAL-SDK version 0.2. You may modify and replace compatible LGPL libraries under their terms; the package does not lock their release hashes at runtime. Replacement instructions, component licenses and source details are included in canpal/_native/licenses/.

Corresponding third-party sources are under CANPAL分析仪/二次开发/python-can-canpal/:

Bundled platform Directory and archive SHA256
Windows x64 / Linux x86_64 (unchanged rc3 binaries) 0.1.0rc3/third-party-sources/python-can-canpal-0.1.0rc3-third-party-sources.zip (235600943 bytes) 8919f717e793b6c021fc7cb35fe0cdd788383bbb554a4021320036c658caec4a
Windows x86 0.1.0rc4/third-party-sources/python-can-canpal-0.1.0rc4-new-architectures-third-party-sources.zip (234709370 bytes) f34ea2499015d7165f0284a85cf6ae53f0b5f9e51d5f8f2ce450dfea95dbabc8

The second archive also contains source materials prepared for the local ARM64 candidate; this does not indicate an ARM64 runtime release. The wheel also includes the upstream Qt QCalendar LGPL-header correction. For source requests or download problems, contact yongxiang.wu@hotmail.com, specifying version and platform. The installed wheel includes canpal/_native/licenses/THIRD-PARTY-SOURCES.md.

Hardware evidence and limits

The following x64 evidence was obtained with rc3. rc4 retains those native binaries and the CAN data path. Final rc4 installation checks verify its package, architecture selection and dependency origins; they do not imply a fresh run of every historical hardware test.

Environment Preview evidence
Windows 11 x64 X5 classic CAN/RTR and X6 classic CAN/RTR/ISO FD over USB and explicit-IP WLAN TCP
Windows, multiple devices Two USB devices, X5 USB + X6 WLAN, X5 WLAN + X6 USB; five reopen cycles per device/transport
Ubuntu 24.04 x86_64 in Hyper-V Native Linux SDK with two USB devices through USB/IP; ttyACM number swap with UID selection; TCP checks through temporary SSH forwarding via Windows WLAN

Both devices had CAN1 wired to their own CAN2 on separate physical buses. These checks do not use an independent reference CAN interface. Classic checks covered standard/extended frames and RTR DLC 0–8 in both directions. X6 FD checks covered lengths 0–64 and BRS off/on. The current SDK checks verified 19,680 frames and 20 Windows reopen cycles. Of these, 4,384 frames were verified on Linux USB using usbipd-win 5.3.0 and Linux CDC ACM. Reversing attachment order swapped ttyACM0/ttyACM1 while UID selection still found the correct X5 and X6.

SDK software regressions passed 170 assertions on each of Windows x64, Windows x86, and Ubuntu x86_64, plus two Linux ThreadSanitizer checks. Windows x86 plugin candidate checks additionally verified USB, both mixed USB/WLAN directions, classic CAN/RTR and X6 ISO FD, with five reopen runs for each tested mode. These checks used X5 CAN1, X6 CAN1 and X6 CAN2 on one shared bus; X5 CAN2 was disconnected. X5 was uninitialized for X6 FD tests. This qualifies neither separate-bus isolation nor an independent FD reference. Repeated tests verified 1,080 classic/RTR frames and 5,200 FD frames with the 32-bit Python plugin. The target WLAN device was identified by BSSID and UID; its current IP was supplied explicitly. An X6 WLAN connection failure recovered after a device power cycle; its underlying cause was not established.

Not yet qualified: independent-reference CAN/CAN FD interoperability, physical Linux host USB controllers, direct Linux WLAN, two simultaneous WLAN devices, full repeated physical renumbering/disconnection acceptance, rated-load/endurance runs, and native resource stability. Formal 0.1.0 retains the complete release acceptance requirements.

Native SDK and firmware requirements

The default runtime is SDK build 663eda8, bundled with each platform wheel. No CANPAL_LIBRARY, Qt installation or library search-path setting is needed for the default runtime. USB permissions and a reachable device IP remain OS configuration requirements.

An explicitly supplied library_path takes precedence over CANPAL_LIBRARY, then the bundled SDK, then legacy system lookup. Invalid explicit paths are errors; they do not silently select a different SDK. External SDK users may still request build 663eda8 through their existing CANPAL supplier.

The pinned source revision is 663eda823be0533754123695405033b38e115489. It adds stricter CAN ACK validation, TCP buffered-read handling, immediate OBD write-error propagation, UDS source filtering, and synchronized command handoff. It also includes cooperative worker shutdown and the Qt serial buffered-read fix. The firmware protocol has no transaction sequence, so a delayed ACK for an identical earlier request cannot be distinguished by the echoed fields alone.

The following are the original rc2 SDK input hashes. Packaging tools rewrite dependency names/paths, so final wheel hashes are recorded in each wheel's manifest.

Runtime input file SHA256
Windows x64 CANPAL.dll c5bf185e71d06171302163d47f9c709b791306ecddf911de464d5b432daa943a
Ubuntu x86_64 libCANPAL.so a7b5d46e50bdb1fa5a580f59f43498fa78a05b959dd2d0c2bd01f9eba242c70d

Matching exported function names or the SDK version string alone does not identify this fixed build. rc3 adds platform runtime bundles and default library selection. rc4 adds the Windows 32-bit Python runtime and architecture selection; the CAN protocol and formal hardware acceptance limits remain unchanged.

Classic RTR also requires firmware that preserves the received DLC. The original X5 firmware reporting 0x0332 and X6 firmware reporting 0x0127 cleared RTR DLC to zero. Supplier-signed diagnostic builds fixed this on the two test devices. Those builds still report the same version numbers: ask your supplier to identify the actual fixed build. The plugin cannot recover DLC that firmware has discarded.

For an external SDK only, set CANPAL_LIBRARY or pass library_path. On Windows, CANPAL_DEPENDENCY_DIRS supplies that external SDK's dependencies; it is ignored when the bundled SDK is selected. On Linux, external SDK users must arrange its matching dependencies. USB users need serial-port access through udev or the dialout group.

The bundled libraries can be replaced under their applicable terms. Hashes identify release artifacts and are not a runtime replacement lock.

Connect by UID or IP

import can

with can.Bus(interface="canpal", ignore_config=True,
             transport="usb", device_id="YOUR_24_HEX_DIGIT_UID",
             channel=0, bitrate=500_000) as bus:
    message = bus.recv(timeout=1)

The device UID remains the selector when a COM/ttyACM number changes. After a reconnection, close and recreate the Bus using the same UID; automatic reconnect is not implemented. A Linux USB/IP enumeration-order swap has been verified; the full repeated physical renumbering acceptance remains pending.

Use transport="wlan", host="192.0.2.10", port=8000 for TCP direct connection. The IP and port must match the actual device; no network discovery is attempted. Keep device_id to verify identity at that endpoint. X6 CAN FD additionally uses fd=True, data_bitrate=2_000_000.

Different physical devices use independent Bus objects. A device can have one Bus and one selected CAN channel at a time. Use one Notifier per device for independent fault handling. UDP, server mode, transmit echo and concurrent channels on one device are not implemented.

A successful send() means the native queue accepted the frame, not that the CAN bus acknowledged it. Use a single receiver per Bus, stop its Notifier before shutdown, and handle python-can exceptions. Timestamp alignment is approximate per device and does not provide precise synchronization between devices.

rc3 distributes platform wheels. Source and build inputs are archived separately; an incomplete source distribution is not offered as an automatic pip fallback.

Metadata

Release files for python-can-canpal 0.1.0rc4

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

Built distributions (wheels)

Table of built distributions (wheels) for python-can-canpal 0.1.0rc4
File Interpreter ABI Platform
python_can_canpal-0.1.0rc4-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
python_can_canpal-0.1.0rc4-py3-none-win32.whl Python 3 none Windows x86-32 Details
python_can_canpal-0.1.0rc4-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details

Total release size: 30.1 MB

Release files / python_can_canpal-0.1.0rc4-py3-none-win_amd64.whl

Download URL python_can_canpal-0.1.0rc4-py3-none-win_amd64.whl
Size 5.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
dd91665c4e8056cfa3ec0f100a7b1df3cb93813b3707dcdcab2777ba413dfa4f
BLAKE2b-256 checksum
How to use checksums
86514692efc85ed060069c8a92293536520e29b6b373f75ed65ed3df4cbda76a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / python_can_canpal-0.1.0rc4-py3-none-win32.whl

Download URL python_can_canpal-0.1.0rc4-py3-none-win32.whl
Size 5.4 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
c400a6b64e0dc430dced89e4ee98086d7249b168dcd15926fb0dbf96588a2a20
BLAKE2b-256 checksum
How to use checksums
f423db1dcb73366f980fc26b49185c0b8dd95955d82761f7d57fd89f6b34c3c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / python_can_canpal-0.1.0rc4-py3-none-manylinux_2_39_x86_64.whl

Download URL python_can_canpal-0.1.0rc4-py3-none-manylinux_2_39_x86_64.whl
Size 19.5 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a8453677f16496a87847f21f877cfefda8a4bcfb5363d66d69e4af0fb5f3bbbd
BLAKE2b-256 checksum
How to use checksums
058553fe1d423d2f4b09352437b5944ec77bf54242428291d53d6fadbbda3d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
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