Changelog

Version [UNRELEASED DRAFT] - 2026-12-06

Removed

  • Removed the unused --file_name/-f argument from the player CLI. (#1815)

  • Remove support for end-of-life Python 3.9. (#1996)

  • Remove support for end-of-life Python 3.10. (#2128)

  • Remove the pywin32 waitable-timer code path of can.broadcastmanager.ThreadBasedCyclicSendTask, which only ran on Windows with Python < 3.11, together with its event attribute, which is always None on supported Python versions, and the pywin32 optional extra; the usb2can interface, the only remaining user of pywin32, gets it from the new usb2can extra. (#2186)

Deprecated

  • Deprecated the interface specific listen-only options in favour of listen_only: monitor of cantact, driver_mode of kvaser, the "silent" and "loopback_and_silent" operation modes of seeedstudio, the state argument and setting bus.state on pcan and systec, and --active/--passive of can.logger. Giving such an option together with a contradicting listen_only raises ValueError. (#2149)

Added

  • Add a can.viewer --separate-dlc option to keep separate rows and receive statistics for messages sharing an ID with different payload lengths. (#1737)

  • Added support for replaying CAN log files multiple times or infinitely in the player script via the new --loop/-l argument. (#1815)

  • Added can.BusLoadListener to measure the bus load over a sliding time window, and can.bus_load.frame_bit_length() and can.bus_load.frame_duration() to estimate the length of CAN and CAN FD frames on the bus. (#1895)

  • Added python-can-coe interface plugin to the documentation. (#1987)

  • Added hardware filter support for SeeedBus during initialization, with a software fallback. (#1995)

  • Added timestamps_format parameter to ASCWriter to support configurable timestamp format: "absolute" (default, timestamps are offsets from the start of measurement) or "relative" (each timestamp is the delta from the preceding event), matching the semantics described in the ASC format specification. (#2022)

  • Add new timezone parameter tz to can.io.asc.ASCReader and can.io.asc.ASCWriter. (#2035)

  • Include unreleased changes in documentation. (#2039)

  • Added the python-can-flexible-serial plugin to the plugin interface documentation, installable with the flexible-serial extra. (#2082)

  • Added the listen_only argument to can.Bus() and can.BusABC, the can.BusABC.listen_only property, and --listen-only/--no-listen-only to can.logger and can.viewer. (#2149)

  • Added python-can-cansub (CSS Electronics CANsub) to the interface plugin list and as an optional dependency. (#2158)

  • Added a channel parameter to MF4Writer to specify the default 1-based BusChannel value used when a logged Message has no channel set (defaults to 1). (#2164)

  • Add the usb2can optional extra, which installs the pywin32 package that the usb2can interface requires. (#2186)

Changed

  • Clarify non-blocking polling with BufferedReader.get_message(timeout=0), and correct the documented exception when adding to a stopped reader. (#1919)

  • Improved datetime parsing and added support for double-defined datetime strings (such as, e.g., "30 15:06:13.191 pm 2017") for ASCReader class. (#2009)

  • Improved IXXAT VCI exception handling. (#2023)

  • cantact: calling CantactBus.recv(timeout=None) now blocks ‘forever’. (#2026)

  • Improved performance in slcan interface. (#2028)

  • gs_usb: use pyusb package to allow WinUSB instead of requiring libusbK on Windows; calling GsUsbBus.recv(timeout=None) now blocks ‘forever’. (#2031)

  • Move changelog from CHANGELOG.md to documentation. (#2039)

  • The slcan interface now finds frame terminators with the C-level bytearray.find instead of a Python-level byte loop, so recv() is faster and stays fast even when a large backlog of frames has accumulated in the serial buffer. (#2080)

  • Document the reported PCBUSB 0.13 timestamp offset after macOS system sleep. (#2092)

  • Improved performance of the socketcan receive path: capture_message now uses roughly a third less CPU per frame. (#2097)

  • can.BusABC.send_periodic() may raise a TypeError now if the msgs argument is not a message or a sequence of messages. (#2126)

  • Update Vector XL_HardwareType to include VN1670, VN5620A, VN5631, VN5632 (#2131)

  • BitTiming and BitTimingFd now always validate the basic bit timing structure and refuse to encode out-of-range BTR registers, strict=True follows the minimum configuration ranges of ISO 11898-1, and from_sample_point() prefers the most accurate bitrate. (#2147)

  • The default listen_only=None leaves the mode unchanged on cantact, kvaser, nixnet and pcan. An explicit listen_only=False on vector now requests init access and sets normal mode. On vector and kvaser, a channel without init access that is not in the requested mode raises CanInitializationError, for listen_only=False as well. send() raises CanOperationError in listen-only mode. listen_only=True raises CanInterfaceNotImplementedError on interfaces without support, including third-party plugins whose constructor does not declare a listen_only parameter. listen_only=True raises CanInitializationError when the mode cannot be applied (vector or kvaser channels without init access that are not already silent, kvaser controllers without silent mode, PCAN-LAN devices); before, the bus silently opened in normal mode. (#2149)

  • PCAN on Windows now derives the boot time from GetTickCount64 instead of uptime, and the pcan extra no longer installs uptime on Linux and Windows. (#2153)

  • can.Notifier passes an exception raised by a listener or its coroutine only to that listener’s on_error(), no longer to the on_error() of all listeners, and still delivers the message to all other listeners; if the failing listener does not handle the exception, the notifier logs it, removes the listener and calls its stop() method instead of stopping the receive thread or reporting to the event loop’s exception handler, so a listener that relied on another listener’s on_error() to keep receiving messages must now implement on_error() itself. An exception raised by on_error(), also for receive errors of a bus, is now logged and counts as not handled by that listener. (#2183)

Fixed

  • can.logger stops on SIGTERM (e.g. from systemctl stop) the same way as on Ctrl+C, so the log file is completed instead of left empty or truncated. (#896)

  • Fixed the CAN viewer increasing message counts and resetting receive intervals when scrolling or resizing the terminal. (#1407)

  • Catch OSError when enabling SO_TIMESTAMPNS in SocketcanBus and fall back to time.time() when receive ancillary data is unavailable. (#1538)

  • Fixed SocketcanBus passing frames that do not match can_filters when they arrive while the bus is created. (#1565)

  • Raise BLFParseError for objects inside BLF log containers that are smaller than their base header instead of repeatedly reading a zero-sized object. (#1584)

  • Synchronize default thread-based periodic sends with explicit sends on ThreadSafeBus to prevent concurrent calls into the underlying backend. (#1620)

  • Ignore queued message deliveries after Notifier.stop() so they do not call listeners that have already been stopped or write to closed log files. (#1712)

  • slcanBus now logs and drops a received frame line that is cut short or not valid, instead of raising a ValueError that stopped a Notifier’s receive thread, or returning a message with fewer data bytes than its DLC. (#1821)

  • Deliver asyncio file-descriptor receive errors to listeners and raise queued errors from AsyncBufferedReader in message order. (#1865)

  • Reading ThreadSafeBus.state and ThreadSafeBus.protocol no longer waits for a thread that is blocked in recv(). (#1891)

  • Call Listener.on_error() and set Notifier.exception for exceptions raised by synchronous listeners and coroutine callbacks when can.Notifier runs with an asyncio event loop. (#1912)

  • Fixed MF4 log reading crashing when CAN error-frame payloads are stored as packed scalars instead of byte arrays. Payload length and byte order are preserved. (#1913)

  • Keep a reference to asyncio tasks in can.Notifier as recommended by python documentation. (#1938)

  • Retry SocketcanBus.send() while the device transmit queue is full (ENOBUFS) instead of failing before the timeout has expired. (#2004)

  • Fix canERR_PARAM raised when opening a Kvaser channel with Linux CANlib, a regression introduced in 4.6.0. (#2050)

  • Replaced select.select() with select.epoll() in SocketcanBus (#2053)

  • Fix can.BitTiming rejecting bit rate prescaler values greater than 64 even when strict=False. (#2061)

  • Fixed Systec errors raising TypeError instead of reporting the underlying USB-CAN return code. (#2077)

  • Refuse to send remote frames on the socketcand interface instead of sending them as normal frames. The socketcand protocol has no remote request flag. (#2091) (#2091)

  • Fixed IXXAT receive timestamps using an incorrect controller-start epoch offset. Preserve start ticks and timestamp wraps while draining startup messages and handling CAN FD reads, including nonblocking reads. (#2103)

  • Fixed PCAN classic CAN and CAN FD timestamps on Linux being offset by the system boot time when uptime is installed. Linux timestamps no longer depend on uptime; timestamp conversion on other platforms is unchanged. (#2108)

  • Load MF4 dependencies when a reader or writer is created so importing asammdf before can does not permanently disable MF4 support. Preserve the original ModuleNotFoundError when an installed asammdf package has a broken transitive dependency, rather than reporting it missing. (#2123)

  • Reject BLF objects with incomplete headers or message payloads before reading bytes from the following object as CAN message data. (#2132)

  • Skip PCAN controller status frames instead of returning them as CAN messages. (#2133)

  • Fix TRCReader reporting an incorrect payload length for CAN FD and long J1939 messages in TRC 2.x files. (#2135)

  • Preserve the requested data length when writing remote frames to candump log files. (#2136)

  • Fixed ASCReader dropping the first frame in ASC files whose header has no internal events logged line. For those files, a directly following Begin Triggerblock line is now processed as the start-time marker instead of being swallowed. Files written by CANoe or python-can are unaffected. (#2137)

  • Fixed ASCReader handling of CANFD ASC records containing classical CAN frames, remote requests, and empty CAN FD frames, preserving frame flags and remote DLC values. (#2139)

  • Prevent configuration loading from modifying caller-owned dictionaries, including can.rc, when normalizing the legacy bustype key. (#2142)

  • Fix PCAN parameter buffer sizes so only the 11-bit and 29-bit acceptance filters use 64-bit buffers. (#2143)

  • Fixed CanutilsLogReader reading candump error frames of any class other than bus error as data frames. Error frames now keep their error class in arbitration_id, their data bytes, channel and direction, and CanutilsLogWriter writes that error class instead of always writing the bus error class. An error frame without error class bits is still written with the bus error class. (#2146)

  • The deprecated silent driver_mode of kvaser is now applied to the handle with init access; it was ineffective with single_handle=False. can.logger --active no longer fails with NotImplementedError on interfaces that cannot set bus.state, and can.logger --passive now works on every interface that supports listen-only mode instead of only on pcan and systec. An invalid operation_mode of seeedstudio now raises ValueError before the serial port is opened, instead of a KeyError afterwards. (#2149)

  • Fixed the socketcand handshake failing when a server reply arrived split over several reads or together with the first CAN frames. (#2150)

  • Fixed the serial interface reading payload bytes for received remote frames, which broke the stream for remote frames with a DLC above 0. (#2151)

  • Fixed ASCReader support for CANoe 7.x CAN FD records that place the CAN identifier before the Rx/Tx direction. (#2154)

  • Avoid rescanning installed entry points for every Logger and LogReader construction. (#2155)

  • Skip malformed ASC frame records with a warning instead of yielding truncated payloads or stopping iteration. (#2160)

  • Fixed the Python 3.14 DeprecationWarning about _pack_ without _layout_ in the ctypes structures of the SYSTEC and Vector interfaces. (#2162)

  • Fixed CanutilsLogReader stopping with a ValueError on candump log lines that carry a Classical CAN raw DLC (123#1122334455667788_C, 123#R8_F) and reading R8_0 to R8_9 as DLC 80 to 89. Such frames are now read with dlc=8. (#2163)

  • Fixed MF4Reader and MF4Writer to convert between 1-based ASAM MDF4 BusChannel numbers and 0-based can.Message.channel values, matching ASCReader/ASCWriter and BLFReader/BLFWriter so can_logconvert preserves bus numbers when converting from .mf4 to .trc, .asc, or .blf. Note that .mf4 files written by earlier MF4Writer versions contain 0-based BusChannel values and will now be read back with channel numbers shifted down by one (0 becomes None, 1 becomes 0). (#2164)

  • Fixed EtasBus ignoring the can_filters passed to its constructor: the base class then added an accept-all filter that overrode them. (#2167)

  • Fixed EtasBus.set_filters removing only the first previously installed filter, so the other old filters stayed active. (#2171)

  • UdpMulticastBus now logs and drops a received datagram that is not a valid message, instead of raising a CanOperationError that stopped a Notifier’s receive thread for good. (#2173)

  • The serial interface raises CanOperationError when a read times out in the middle of a frame, instead of struct.error or TypeError, or a message with a truncated payload. (#2175)

  • Fixed EtasBus ignoring "extended": False in a receive filter, so extended frames whose ID matched can_id and can_mask were still received. (#2177)

  • Fixed EtasBus receiving no frames through a filter whose can_id sets bits above the 11-bit (standard) or 29-bit (extended) identifier range outside can_mask. (#2178)

  • Fixed the <can_id>~<can_mask> filter syntax of can.logger, can.viewer and can.cli.add_bus_arguments dropping the mask, so an inverted filter blocked every frame on SocketCAN. The mask now keeps all bits except CAN_ERR_FLAG, as in candump. Other interfaces cannot invert a filter; they still let every frame pass and now log a warning. (#2181)

Version v4.6.1 - 2025-08-12

Fixed

  • Fix initialisation of an slcan bus, when setting a bitrate. When using CAN 2.0 (not FD), the default setting for data_bitrate was invalid, causing an exception. (#1978)

Version v4.6.0 - 2025-08-09

Removed

  • Remove support for Python 3.8. (#1931)

  • Unknown command line arguments (“extra args”) are no longer passed down to can.Bus() instantiation. Use the --bus-kwargs argument instead. (#1949)

  • Remove can.io.generic.BaseIOHandler class. Improve can.io.* type annotations by using typing.Generic. (#1951)

Added

  • Support 11-bit identifiers in the serial interface. (#1758)

  • Keep track of active Notifiers and make Notifier usable as a context manager. Add function Notifier.find_instances(bus) to find the active Notifier for a given bus instance. (#1890)

  • Add Windows support to udp_multicast interface. (#1914)

  • Add FD support to slcan according to CANable 2.0 implementation. (#1920)

  • Add support for error messages to the socketcand interface. (#1941)

  • Add support for remote and error frames in the serial interface. (#1948)

  • Add public functions can.cli.add_bus_arguments and can.cli.create_bus_from_namespace for creating bus command line options. Currently downstream packages need to implement their own logic to configure python-can buses. Now python-can can create and parse bus options for third party packages. (#1949)

  • Add support for remote frames to TRCReader. (#1953)

  • Mention the python-can-candle package in the plugin interface section of the documentation. (#1954)

  • Add new CLI tool python -m can.bridge (or just can_bridge) to create a software bridge between two physical buses. (#1961)

Changed

  • Allow sending Classic CAN frames with a DLC value larger than 8 using the socketcan interface. (#1851)

  • The gs_usb extra dependency was renamed to gs-usb. The lint extra dependency was removed and replaced with new PEP 735 dependency groups lint, docs and test. (#1945)

  • Update dependency name from zlgcan-driver-py to zlgcan. (#1946)

  • Use ThreadPoolExecutor in detect_available_configs() to reduce runtime and add timeout parameter. (#1947)

  • Update contribution guide. (#1960)

Fixed

  • Fix a bug in slcanBus.get_version() and slcanBus.get_serial_number(): If any other data was received during the function call, then None was returned. (#1904)

  • Fix incorrect padding of CAN FD payload in BlfReader. (#1906)

  • Set correct message direction for messages received with kvaser interface and receive_own_messages=True. (#1908)

  • Fix timestamp rounding error in BlfWriter. (#1921)

  • Fix timestamp rounding error in BlfReader. (#1927)

  • Handle timer overflow message and build timestamp according to the epoch in the ixxat interface. (#1934)

  • Avoid unsupported ioctl function call to allow usage of the udp_multicast interface on MacOS. (#1940)

  • Fix configuration file parsing for the state bus parameter. (#1957)

  • Mf4Reader: support non-standard CAN_DataFrame.Dir values in mf4 files created by ihedvall/mdflib. (#1967)

  • PcanBus: Set Message.channel attribute in PcanBus.recv(). (#1969)

Version v4.5.0 - 2024-11-28

Features

  • gs_usb command-line support (and documentation updates and stability fixes) (#1790)

  • Faster and more general MF4 support (#1892)

  • ASCWriter speed improvement (#1856)

  • Faster Message string representation (#1858)

  • Added Netronic’s CANdo and CANdoISO adapters interface (#1887)

  • Add autostart option to BusABC.send_periodic() to fix issue #1848 (#1853)

  • Improve TestBusConfig (#1804)

  • Improve speed of TRCReader (#1893)

Bug Fixes

  • Fix Kvaser timestamp (#1878)

  • Set end_time in ThreadBasedCyclicSendTask.start() (#1871)

  • Fix regex in _parse_additional_config() (#1868)

  • Fix for #1849 (PCAN fails when PCAN_ERROR_ILLDATA is read via ReadFD) (#1850)

  • Period must be >= 1ms for BCM using Win32 API (#1847)

  • Fix ASCReader Crash on “Start of Measurement” Line (#1811)

  • Resolve AttributeError within NicanError (#1806)

Miscellaneous

  • Fix CI (#1889)

  • Update msgpack dependency (#1875)

  • Add tox environment for doctest (#1870)

  • Use typing_extensions.TypedDict on python < 3.12 for pydantic support (#1845)

  • Replace PyPy3.8 with PyPy3.10 (#1838)

  • Fix slcan tests (#1834)

  • Test on Python 3.13 (#1833)

  • Stop notifier in examples (#1814)

  • Use setuptools_scm (#1810)

  • Added extra info for Kvaser dongles (#1797)

  • Socketcand: show actual response as well as expected in error (#1807)

  • Refactor CLI filter parsing, add tests (#1805)

  • Add zlgcan to docs (#1839)

Version v4.4.2 - 2024-06-23

Bug Fixes

  • Remove abstractmethod decorator from Listener.stop() (#1770, #1795)

  • Fix SizedRotatingLogger file suffix bug (#1792, #1793)

  • gs_usb: Use BitTiming class internally to configure bitrate (#1747, #1748)

  • pcan: Fix unpack error in PcanBus._detect_available_configs() (#1767)

  • socketcan: Improve error handling in SocketcanBus.__init__() (#1771)

  • socketcan: Do not log exception on non-linux platforms (#1800)

  • vector, kvaser: Activate channels after CAN filters were applied (#1413, #1708, #1796)

Features

  • kvaser: Add support for non-ISO CAN FD (#1752)

  • neovi: Return timestamps relative to epoch (#1789)

  • slcan: Support CANdapter extended length arbitration ID (#1506, #1528)

  • slcan: Add support for listen_only mode (#1496)

  • vector: Add support for listen_only mode (#1764)

Version v4.4.0 - 2024-06-08

Features

  • TRC 1.3 Support: Added support for .trc log files as generated by PCAN Explorer v5 and other tools, expanding compatibility with common log file formats (#1753).

  • ASCReader refactor: improved the ASCReader code (#1717).

  • SYSTEC Interface Enhancements: Added the ability to pass an explicit DLC value to the send() method when using the SYSTEC interface, enhancing flexibility for message definitions (#1756).

  • Socketcand Beacon Detection: Introduced a feature for detecting socketcand beacons, facilitating easier connection and configuration with socketcand servers (#1687).

  • PCAN Driver Echo Frames: Enabled echo frames in the PCAN driver when receive_own_messages is set, improving feedback for message transmissions (#1723).

  • CAN FD Bus Connection for VectorBus: Enabled connecting to CAN FD buses without specifying bus timings, simplifying the connection process for users (#1716).

  • Neousys Configs Detection: Updated the detection mechanism for available Neousys configurations, ensuring more accurate and comprehensive configuration discovery (#1744).

Bug Fixes

  • Send Periodic Messages: Fixed an issue where fixed-duration periodic messages were sent one extra time beyond their intended count (#1713).

  • Vector Interface on Windows 11: Addressed compatibility issues with the Vector interface on Windows 11, ensuring stable operation across the latest OS version (#1731).

  • ASCWriter Millisecond Handling: Corrected the handling of milliseconds in ASCWriter, ensuring accurate time representation in log files (#1734).

  • Various minor bug fixes: Addressed several minor bugs to improve overall stability and performance.

Miscellaneous

  • Invert default value logic for BusABC._is_shutdown. (#1774)

  • Implemented various logging enhancements to provide more detailed and useful operational insights (#1703).

  • Updated CI to use OIDC for connecting GitHub Actions to PyPi, improving security and access control for CI workflows.

  • Fix CI to work for MacOS (#1772).

  • The release also includes various other minor enhancements and bug fixes aimed at improving the reliability and performance of the software.

Version v4.3.1 - 2023-12-12

Bug Fixes

  • Fix socketcand erroneously discarding frames (#1700)

  • Fix initialization order in EtasBus (#1693, #1704)

Documentation

  • Fix install instructions for neovi (#1694, #1697)

Version v4.3.0 - 2023-11-17

Breaking Changes

  • Raise Minimum Python Version to 3.8 (#1597)

  • Do not stop notifier if exception was handled (#1645)

Bug Fixes

  • Vector: channel detection fails, if there is an active flexray channel (#1634)

  • ixxat: Fix exception in ‘state’ property on bus coupling errors (#1647)

  • NeoVi: Fixed serial number range (#1650)

  • PCAN: Fix timestamp offset due to timezone (#1651)

  • Catch pywintypes.error in broadcast manager (#1659)

  • Fix BLFReader error for incomplete or truncated stream (#1662)

  • PCAN: remove Windows registry check to fix 32bit compatibility (#1672)

  • Vector: Skip the can_op_mode check if the device reports can_op_mode=0 (#1678)

  • Vector: using the config from detect_available_configs might raise XL_ERR_INVALID_CHANNEL_MASK error (#1681)

Features

API

  • Add modifier_callback parameter to BusABC.send_periodic for auto-modifying cyclic tasks (#703)

  • Add protocol property to BusABC to determine active CAN Protocol (#1532)

  • Change Bus constructor implementation and typing (#1557)

  • Add optional strict parameter to relax BitTiming & BitTimingFd Validation (#1618)

  • Add BitTiming.iterate_from_sample_point static methods (#1671)

IO

  • Can Player compatibility with interfaces that use additional configuration (#1610)

Interface Improvements

  • Kvaser: Add BitTiming/BitTimingFd support to KvaserBus (#1510)

  • Ixxat: Implement detect_available_configs for the Ixxat bus. (#1607)

  • NeoVi: Enable send and receive on network ID above 255 (#1627)

  • Vector: Send HighPriority Message to flush Tx buffer (#1636)

  • PCAN: Optimize send performance (#1640)

  • PCAN: Support version string of older PCAN basic API (#1644)

  • Kvaser: add parameter exclusive and override_exclusive (#1660)

  • socketcand: Add parameter tcp_tune to reduce latency (#1683)

Miscellaneous

  • Distinguish Text/Binary-IO for Reader/Writer classes. (#1585)

  • Convert setup.py to pyproject.toml (#1592)

  • activate ruff pycodestyle checks (#1602)

  • Update linter instructions in development.rst (#1603)

  • remove unnecessary script files (#1604)

  • BigEndian test fixes (#1625)

  • align ID: in can.Message string (#1635)

  • Use same configuration file as Linux on macOS (#1657)

  • We do not need to account for drift when we USE_WINDOWS_EVENTS (#1666, #1679)

  • Update linters, activate more ruff rules (#1669)

  • Add Python 3.12 Support / Test Python 3.12 (#1673)

Version v4.2.2 - 2023-06-18

Bug Fixes

  • Fix socketcan KeyError (#1598, #1599).

  • Fix IXXAT not properly shutdown message (#1606).

  • Fix Mf4Reader and TRCReader incompatibility with extra CLI args (#1610).

  • Fix decoding error in Kvaser constructor for non-ASCII product name (#1613).

Version v4.2.1 - 2023-05-15

Bug Fixes

  • The ASCWriter now logs the correct channel for error frames (#1578, #1583).

  • Fix PCAN library detection (#1579, #1580).

  • On Windows, the first two periodic frames were sent without delay (#1590).

Version v4.2.0 - 2023-04-26

Breaking Changes

  • The can.BitTiming class was replaced with the new can.BitTiming and can.BitTimingFd classes (#1468, #1515). Early adopters of can.BitTiming will need to update their code. Check the documentation for more information. Currently, the following interfaces support the new classes:

    There are open pull requests for kvaser (#1510), slcan (#1512) and usb2can (#1511). Testing and reviewing of these open PRs would be most appreciated.

Features

IO

  • Add support for MF4 files (#1289).

  • Add support for version 2 TRC files and other TRC file enhancements (#1530).

Type Annotations

Interface Improvements

  • Add __del__ method to can.BusABC to automatically release resources (#1489, #1564).

  • pcan: Update PCAN Basic to 4.6.2.753 (#1481).

  • pcan: Use select instead of polling on Linux (#1410).

  • socketcan: Use ip link JSON output in find_available_interfaces (#1478).

  • socketcan: Enable SocketCAN interface tests in GitHub CI (#1484).

  • slcan: improve receiving performance (#1490).

  • usb2can: Stop using root logger (#1483).

  • usb2can: Faster channel detection on Windows (#1480).

  • vector: Only check sample point instead of tseg & sjw (#1486).

  • vector: add VN5611 hwtype (#1501).

Documentation

  • Add new section about related tools to documentation. Add a list of plugin interface packages (#1457).

Bug Fixes

  • Automatic type conversion for config values (#1498, #1499).

  • pcan: Fix Bus.__new__ for CAN-FD interfaces (#1458, #1460).

  • pcan: Fix Detection of Library on Windows on ARM (#1463).

  • socketcand: extended ID bug fixes (#1504, #1508).

  • vector: improve robustness against unknown HardwareType values (#1500, #1502).

Deprecations

  • The bustype parameter of can.Bus is deprecated and will be removed in version 5.0, use interface instead. (#1462).

  • The context parameter of can.Bus is deprecated and will be removed in version 5.0, use config_context instead. (#1474).

  • The bit_timing parameter of CantactBus is deprecated and will be removed in version 5.0, use timing instead. (#1468).

  • The bit_timing parameter of CANalystIIBus is deprecated and will be removed in version 5.0, use timing instead. (#1468).

  • The brs and log_errors parameters of NiXNETcanBus are deprecated and will be removed in version 5.0. (#1520).

Miscellaneous

  • Use high resolution timer on Windows to improve timing precision for BroadcastManager (#1449).

  • Improve ThreadBasedCyclicSendTask timing (#1539).

  • Make code examples executable on Linux (#1452).

  • Fix CanFilter type annotation (#1456).

  • Fix The entry_points().get deprecation warning and improve type annotation of can.interfaces.BACKENDS (#1465).

  • Add ignore_config parameter to can.Bus (#1474).

  • Add deprecation period to utility function deprecated_args_alias (#1477).

  • Add ruff to the CI system (#1551)

Version v4.1.0 - 2022-11-24

Breaking Changes

  • windows-curses was moved to optional dependencies (#1395). Use pip install python-can[viewer] if you are using the can.viewer script on Windows.

  • The attributes of can.interfaces.vector.VectorChannelConfig were renamed from camelCase to snake_case (#1422).

Features

IO

  • The canutils logger preserves message direction (#1244) and uses common interface names (e.g. can0) instead of just channel numbers (#1271).

  • The can.logger script accepts the -a, --append option to add new data to an existing log file (#1326, #1327, #1361). Currently only the blf-, canutils- and csv-formats are supported.

  • All CLI extra_args are passed to the bus, logger and player initialisation (#1366).

  • Initial support for TRC files (#1217)

Type Annotations

  • python-can now includes the py.typed marker to support type checking according to PEP 561 (#1344).

Interface Improvements

  • The gs_usb interface can be selected by device index instead of USB bus/address. Loopback frames are now correctly marked with the is_rx flag (#1270).

  • The PCAN interface can be selected by its device ID instead of just the channel name (#1346).

  • The PCAN Bus implementation supports auto bus-off reset (#1345).

  • SocketCAN: Make find_available_interfaces() find slcanX interfaces (#1369).

  • Vector: Add xlGetReceiveQueueLevel, xlGenerateSyncPulse and xlFlushReceiveQueue to xldriver (#1387).

  • Vector: Raise a CanInitializationError, if the CAN settings can not be applied according to the arguments of VectorBus.__init__ (#1426).

  • Ixxat bus now implements BusState api and detects errors (#1141)

Bug Fixes

  • Improve robustness of USB2CAN serial number detection (#1129).

  • Fix channel2int conversion (#1268, #1269).

  • Fix BLF timestamp conversion (#1266, #1273).

  • Fix timestamp handling in udp_multicast on macOS (#1275, #1278).

  • Fix failure to initiate the Neousys DLL (#1281).

  • Fix AttributeError in IscanError (#1292, #1293).

  • Add missing vector devices (#1296).

  • Fix error for DLC > 8 in ASCReader (#1299, #1301).

  • Set default mode for FileIOMessageWriter to wt instead of rt (#1303).

  • Fix conversion for port number from config file (#1309).

  • Fix fileno error on Windows (#1312, #1313, #1333).

  • Remove redundant writer.stop() call that throws error (#1316, #1317).

  • Detect and cast types of CLI extra_args (#1280, #1328).

  • Fix ASC/CANoe incompatibility due to timestamp format (#1315, #1362).

  • Fix MessageSync timings (#1372, #1374).

  • Fix file name for compressed files in SizedRotatingLogger (#1382, #1683).

  • Fix memory leak in neoVI bus where message_receipts grows with no limit (#1427).

  • Raise ValueError if gzip is used with incompatible log formats (#1429).

  • Allow restarting of transmission tasks for socketcan (#1440)

Miscellaneous

  • Allow ICSApiError to be pickled and un-pickled (#1341)

  • Sort interface names in CLI API to make documentation reproducible (#1342)

  • Exclude repository-configuration from git-archive (#1343)

  • Improve documentation (#1397, #1401, #1405, #1420, #1421, #1434)

  • Officially support Python 3.11 (#1423)

  • Migrate code coverage reporting from Codecov to Coveralls (#1430)

  • Migrate building docs and publishing releases to PyPi from Travis-CI to GitHub Actions (#1433)

Version v4.0.0 - 2022-02-19

TL;DR: This release includes a ton of improvements from 2.5 years of development! 🎉 Test thoroughly after switching.

For more than two years, there was no major release of python-can. However, development was very much active over most of this time, and many parts were switched out and improved. Over this time, over 530 issues and PRs have been resolved or merged, and discussions took place in even more. Statistics of the final diff: About 200 files changed due to ~22k additions and ~7k deletions from more than thirty contributors.

This changelog diligently lists the major changes but does not promise to be the complete list of changes. Therefore, users are strongly advised to thoroughly test their programs against this new version. Re-reading the documentation for your interfaces might be helpful too as limitations and capabilities might have changed or are more explicit. While we did try to avoid breaking changes, in some cases it was not feasible and in particular, many implementation details have changed.

Major features

New interfaces

Improved interfaces

  • socketcan

    • Support for multiple Cyclic Messages in Tasks (#610)

    • Socketcan crash when attempting to stop CyclicSendTask with same arbitration ID (#605, #638, #720)

    • Relax restriction of arbitration ID uniqueness for CyclicSendTask (#721, #785, #930)

    • Add nanosecond resolution time stamping to socketcan (#938, #1015)

    • Add support for changing the loopback flag (#960)

    • Socketcan timestamps are missing sub-second precision (#1021, #1029)

    • Add parameter to ignore CAN error frames (#1128)

  • socketcan_ctypes

    • Removed and replaced by socketcan after deprecation period

  • socketcan_native

    • Removed and replaced by socketcan after deprecation period

  • vector

    • Add chip state API (#635)

    • Add methods to handle non message events (#708)

    • Implement XLbusParams (#718)

    • Add support for VN8900 xlGetChannelTime function (#732, #733)

    • Add vector hardware config popup (#774)

    • Fix Vector CANlib treatment of empty app name (#796, #814)

    • Make VectorError pickleable (#848)

    • Add methods get_application_config(), set_application_config() and set_timer_rate() to VectorBus (#849)

    • Interface arguments are now lowercase (#858)

    • Fix errors using multiple Vector devices (#898, #971, #977)

    • Add more interface information to channel config (#917)

    • Improve timestamp accuracy on Windows (#934, #936)

    • Fix error with VN8900 (#1184)

    • Add static typing (#1229)

  • PCAN

    • Do not incorrectly reset CANMsg.MSGTYPE on remote frame (#659, #681)

    • Add support for error frames (#711)

    • Added keycheck for windows platform for better error message (#724)

    • Added status_string method to return simple status strings (#725)

    • Fix timestamp timezone offset (#777, #778)

    • Add Cygwin support (#840)

    • Update PCAN basic Python file to February 7, 2020 (#929)

    • Fix compatibility with the latest macOS SDK (#947, #948, #957, #976)

    • Allow numerical channel specifier (#981, #982)

    • macOS: Try to find libPCBUSB.dylib before loading it (#983, #984)

    • Disable command PCAN_ALLOW_ERROR_FRAMES on macOS (#985)

    • Force english error messages (#986, #993, #994)

    • Add set/get device number (#987)

    • Timestamps are silently incorrect on Windows without uptime installed (#1053, #1093)

    • Implement check for minimum version of pcan library (#1065, #1188)

    • Handle case where uptime is imported successfully but returns None (#1102, #1103)

  • slcan

    • Fix bitrate setting (#691)

    • Fix fileno crash on Windows (#924)

  • ics_neovi

    • Filter out Tx error messages (#854)

    • Adding support for send timeout (#855)

    • Raising more precise API error when set bitrate fails (#865)

    • Avoid flooding the logger with many errors when they are the same (#1125)

    • Omit the transmit exception cause for brevity (#1086)

    • Raise ValueError if message data is over max frame length (#1177, #1181)

    • Setting is_error_frame message property (#1189)

  • ixxat

    • Raise exception on busoff in recv() (#856)

    • Add support for 666 kbit/s bitrate (#911)

    • Add function to list hwids of available devices (#926)

    • Add CAN FD support (#1119)

  • seeed

    • Fix fileno crash on Windows (#902)

  • kvaser

    • Improve timestamp accuracy on Windows (#934, #936)

  • usb2can

    • Fix “Error 8” on Windows and provide better error messages (#989)

    • Fix crash on initialization (#1248, #1249)

    • Pass flags instead of flags_t type upon initialization (#1252)

  • serial

    • Fix “TypeError: cannot unpack non-iterable NoneType” and more robust error handling (#1000, #1010)

  • canalystii

    • Fix is_extended_id (#1006)

    • Fix transmitting onto a busy bus (#1114)

    • Replace binary library with python driver (#726, #1127)

Other API changes and improvements

Other Bugfixes

  • BLF PDU padding (#459)

  • stop_all_periodic_tasks skipping every other task (#634, #637, #645)

  • Preserve capitalization when reading config files (#702, #1062)

  • ASCReader: Skip J1939Tp messages (#701)

  • Fix crash in Canutils Log Reader when parsing RTR frames (#713)

  • Various problems with the installation of the library

  • ASCWriter: Fix date format to show correct day of month (#754)

  • Fixes that some BLF files can’t be read ( #763, #765)

  • Seek for start of object instead of calculating it (#786, #803, #806)

  • Only import winreg when on Windows (#800, #802)

  • Find the correct Reader/Writer independently of the file extension case (#895)

  • RecursionError when unpickling message object (#804, #885, #904)

  • Move “filelock” to neovi dependencies (#943)

  • Bus() with “fd” parameter as type bool always resolved to fd-enabled configuration (#954, #956)

  • Asyncio code hits error due to deprecated loop parameter (#1005, #1013)

  • Catch time before 1970 in ASCReader (#1034)

  • Fix a bug where error handlers were not called correctly (#1116)

  • Improved user interface of viewer script (#1118)

  • Correct app_name argument in logger (#1151)

  • Calling stop_all_periodic_tasks() in BusABC.shutdown() and all interfaces call it on shutdown (#1174)

  • Timing configurations do not allow int (#1175)

  • Some smaller bugfixes are not listed here since the problems were never part of a proper release

  • ASCReader & ASCWriter using DLC as data length (#1245, #1246)

Behind the scenes & Quality assurance

  • We publish both source distributions (sdist) and binary wheels (bdist_wheel) (#1059, #1071)

  • Many interfaces were partly rewritten to modernize the code or to better handle errors

  • Performance improvements

  • Dependencies have changed

  • Derive type information in Sphinx docs directly from type hints (#654)

  • Better documentation in many, many places; This includes the examples, README and python-can developer resources

  • Add issue templates (#1008, #1017, #1018, #1178)

  • Many continuous integration (CI) discussions & improvements (for example: #951, #940, #1032)

  • Testing: Many of the new features directly added tests, and coverage of existing code was improved too (for example: #1031, #581, #585, #586, #942, #1196, #1198)

Version v3.3.4 - 2020-10-04

Last call for Python2 support.

  • #850 Fix socket.error is a deprecated alias of OSError used on Python versions lower than 3.3.

Version v3.3.3 - 2020-05-18

  • #798 Backport caching msg.data value in neovi interface.

  • #796 Fix Vector CANlib treatment of empty app name.

  • #771 Handle empty CSV file.

  • #741 ASCII reader can now handle FD frames.

  • #740 Exclude test packages from distribution.

  • #713 RTR crash fix in canutils log reader parsing RTR frames.

  • #701 Skip J1939 messages in ASC Reader.

  • #690 Exposes a configuration option to allow the CAN message player to send error frames (and sets the default to not send error frames).

  • #638 Fixes the semantics provided by periodic tasks in SocketCAN interface.

  • #628 Avoid padding CAN_FD_MESSAGE_64 objects to 4 bytes.

  • #617 Fixes the broken CANalyst-II interface.

  • #605 Socketcan BCM status fix.

Version v3.3.2 - 2019-08-16

Minor bug fix release addressing issue in PCAN RTR.

Version v3.3.1 - 2019-07-23

Minor fix to setup.py to only require pytest-runner when necessary.

Version v3.3.0 - 2019-06-27

  • Adding CAN FD 64 frame support to blf reader

  • Updates to installation instructions

  • Clean up bits generator in PCAN interface #588

  • Minor fix to use latest tools when building wheels on travis.

Version v3.2.1 - 2019-06-25

  • CAN FD 64 frame support to blf reader

  • Minor fix to use latest tools when building wheels on travis.

  • Updates links in documentation.

Version v3.2.0 - 2019-05-16

Major features

  • FD support added for Pcan by @bmeisels with input from @markuspi, @christiansandberg & @felixdivo in PR #537

  • This is the last version of python-can which will support Python 2.7 and Python 3.5. Support has been removed for Python 3.4 in this release in PR #532

Other notable changes

  • #533 BusState is now an enum.

  • #535 This release should automatically be published to PyPi by travis.

  • #577 Travis-ci now uses stages.

  • #548 A guide has been added for new io formats.

  • #550 Finish moving from nose to pytest.

  • #558 Fix installation on Windows.

  • #561 Tests for MessageSync added.

General fixes, cleanup and docs changes can be found on the GitHub milestone https://github.com/hardbyte/python-can/milestone/7?closed=1

Pulls: #522, #526, #527, #536, #540, #546, #547, #548, #533, #559, #569, #571, #572, #575

Backend Specific Changes

pcan

  • FD

slcan

  • ability to set custom can speed instead of using predefined speed values. #553

socketcan

  • Bug fix to properly support 32bit systems. #573

usb2can

  • slightly better error handling

  • multiple serial devices can be found

  • support for the _detect_available_configs() API

Pulls #511, #535

vector

  • handle app_name. #525

Version v3.1.1 - 2019-02-24

Major features

Two new interfaces this release:

  • SYSTEC contributed by @idaniel86 in PR #466

  • CANalyst-II contributed by @smeng9 in PR #476

Other notable changes

  • #477 The kvaser interface now supports bus statistics via a custom bus method.

  • #434 neovi now supports receiving own messages

  • #490 Adding option to override the neovi library name

  • #488 Allow simultaneous access to IXXAT cards

  • #447 Improvements to serial interface:

    • to allow receiving partial messages

    • to fix issue with DLC of remote frames

    • addition of unit tests

  • #497 Small API changes to Message and added unit tests

  • #471 Fix CAN FD issue in kvaser interface

  • #462 Fix Notifier issue with asyncio

  • #481 Fix PCAN support on OSX

  • #455 Fix to Message initializer

  • Small bugfixes and improvements

Version v3.1.0 - 2023-03-01

Version 3.1.0 was built with old wheel and/or setuptools packages and was replaced with v3.1.1 after an installation but was discovered.

Version v3.0.0 - 2019-02-23

Major features

  • Adds support for developing asyncio applications with python-can more easily. This can be useful when implementing protocols that handles simultaneous connections to many nodes since you can write synchronous looking code without handling multiple threads and locking mechanisms. #388

  • New can viewer terminal application. (python -m can.viewer) #390

  • More formally adds task management responsibility to the Bus. By default tasks created with bus.send_periodic will have a reference held by the bus - this means in many cases the user doesn’t need to keep the task in scope for their periodic messages to continue being sent. If this behavior isn’t desired pass store_task=False to the send_periodic method. Stop all tasks by calling the bus’s new stop_all_periodic_tasks method. #412

Breaking changes

  • Interfaces should no longer override send_periodic and instead implement _send_periodic_internal to allow the Bus base class to manage tasks. #426

  • writing to closed writers is not supported any more (it was supported only for some)

  • the file in the reader/writer is now always stored in the attribute uniformly called file, and not in something like fp, log_file or output_file. Changed the name of the first parameter of the read/writer constructors from filename to file.

Other notable changes

  • can.Message class updated #413

    • Addition of a Message.equals method.

    • Deprecate id_type in favor of is_extended_id

    • Initializer parameter extended_id deprecated in favor of is_extended_id

    • documentation, testing and example updates

    • Addition of support for various builtins: __repr__, __slots__, __copy__

  • IO module updates to bring consistency to the different CAN message writers and readers. #348

    • context manager support for all readers and writers

    • they share a common super class called BaseIOHandler

    • all file handles can now be closed with the stop() method

    • the table name in SqliteReader/SqliteWriter can be adjusted

    • append mode added in CSVWriter and CanutilsLogWriter

    • file-like and path-like objects can now be passed to the readers and writers (except to the Sqlite handlers)

    • add a __ne__() method to the Message class (this was required by the tests)

    • added a stop() method for BufferedReader

    • SqliteWriter: this now guarantees that all messages are being written, exposes some previously internal metrics and only buffers messages up to a certain limit before writing/committing to the database.

    • the unused header_line attribute from CSVReader has been removed

    • privatized some attributes that are only to be used internally in the classes

    • the method Listener.on_message_received() is now abstract (using @abc.abstractmethod)

  • Start testing against Python 3.7 #380

  • All scripts have been moved into can/scripts. #370, #406

  • Added support for additional sections to the config #338

  • Code coverage reports added. #346, #374

  • Bug fix to thread safe bus. #397

General fixes, cleanup and docs changes: (#347, #348, #367, #368, #370, #371, #373, #420, #417, #419, #432)

Backend Specific Changes

3rd party interfaces

  • Deprecated python_can.interface entry point instead use can.interface. #389

neovi

  • Added support for CAN-FD #408

  • Fix issues checking if bus is open. #381

  • Adding multiple channels support. #415

nican

  • implements reset instead of custom flush_tx_buffer. #364

pcan

  • now supported on OSX. #365

serial

  • Removed TextIOWrapper from serial. #383

  • switch to serial_for_url enabling using remote ports via loop://, socket:// and rfc2217:// URLs. #393

  • hardware handshake using rtscts kwarg #402

socketcan

  • socketcan tasks now reuse a bcm socket #404, #425, #426,

  • socketcan bugfix to receive error frames #384

vector

  • Vector interface now implements _detect_available_configs. #362

  • Added support to select device by serial number. #387

Version v2.2.1 - 2018-07-12

  • Fix errors and warnings when importing library on Windows

  • Fix Vector backend raising ValueError when hardware is not connected

Version v2.2.0 - 2018-07-03

  • Fallback message filtering implemented in Python for interfaces that don’t offer better accelerated mechanism.

  • SocketCAN interfaces have been merged (Now use socketcan instead of either socketcan_native and socketcan_ctypes), this is now completely transparent for the library user.

  • automatic detection of available configs/channels in supported interfaces.

  • Added synchronized (thread-safe) Bus variant.

  • context manager support for the Bus class.

  • Dropped support for Python 3.3 (officially reached end-of-life in Sept. 2017)

  • Deprecated the old CAN module, please use the newer can entry point (will be removed in an upcoming major version)

Version v2.1.0 - 2018-02-18

  • Support for out of tree can interfaces with pluggy.

  • Initial support for CAN-FD for socketcan_native and kvaser interfaces.

  • Neovi interface now uses Intrepid Control Systems’s own interface library.

  • Improvements and new documentation for SQL reader/writer.

  • Fix bug in neovi serial number decoding.

  • Add testing on OSX to TravisCI

  • Fix non english decoding error on pcan

  • Other misc improvements and bug fixes

Version v2.0.0 - 2018-01-05

After an extended baking period we have finally tagged version 2.0.0!

Quite a few major changes from v1.x:

  • New interfaces:

    • Vector

    • NI-CAN

    • isCAN

    • neoVI

  • Simplified periodic send API with initial support for SocketCAN

  • Protocols module including J1939 support removed

  • Logger script moved to module can.logger

  • New can.player script to replay log files

  • BLF, ASC log file support added in new can.io module

You can install from PyPi with pip:

` pip install python-can==2.0.0 `

Version v1.5.2 - 2016-09-10

Version v1.4.2 - 2016-01-12

Version v1.0.0 - 2010-11-18

Version v0.4.1 - 2010-07-01