Metadata-Version: 2.4
Name: pycangui
Version: 0.7.0
Summary: Graphical CAN bus tool: live trace and plots, transmit, CANopen, UDS, J1939, XCP and CCP, Python scripting
Author: davhodg
License-Expression: Apache-2.0 AND MIT-0 AND MIT
Project-URL: Homepage, https://github.com/davhodg/pycangui
Project-URL: Documentation, https://github.com/davhodg/pycangui/blob/master/pycangui/help/manual.md
Project-URL: Repository, https://github.com/davhodg/pycangui
Project-URL: Issues, https://github.com/davhodg/pycangui/issues
Project-URL: Releases, https://github.com/davhodg/pycangui/releases
Project-URL: Changelog, https://github.com/davhodg/pycangui/blob/master/pycangui/help/changelog.md
Keywords: CAN,CAN bus,CAN FD,CANopen,UDS,ISO-TP,J1939,XCP,CCP,DBC,automotive,diagnostics,python-can,Qt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
License-File: LICENSES/MIT-0.txt
License-File: LICENSES/MIT.txt
Requires-Dist: PySide6-Essentials>=6.8
Requires-Dist: pyqtgraph>=0.13
Requires-Dist: python-can[pywin32,serial]>=4.6
Requires-Dist: python-can-cansub>=2026.9.28
Requires-Dist: canopen>=2.3
Requires-Dist: cantools>=39
Requires-Dist: numpy>=1.26
Requires-Dist: udsoncan>=1.23
Requires-Dist: can-isotp>=2.0
Requires-Dist: python-can-j1939>=0.1.2
Requires-Dist: bincopy>=20.0
Requires-Dist: msgpack>=1.0; sys_platform == "win32"
Provides-Extra: all
Requires-Dist: asammdf>=8.8.33; extra == "all"
Requires-Dist: isal>=1.9.1; extra == "all"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: ruff==0.17.*; extra == "test"
Requires-Dist: pdoc>=16; extra == "test"
Requires-Dist: trove-classifiers; extra == "test"
Provides-Extra: dev
Requires-Dist: pycangui[test]; extra == "dev"
Requires-Dist: pycangui[all]; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/davhodg/pycangui/master/pycangui/resources/pycangui.png" alt="pycangui icon: a CAN bus with four node taps and a terminating resistor at each end" width="128">
</p>

# pycangui

[![CI](https://github.com/davhodg/pycangui/actions/workflows/ci.yml/badge.svg)](https://github.com/davhodg/pycangui/actions/workflows/ci.yml)
[![release](https://img.shields.io/github/v/release/davhodg/pycangui?include_prereleases)](https://github.com/davhodg/pycangui/releases)
[![PyPI](https://img.shields.io/pypi/v/pycangui)](https://pypi.org/project/pycangui/)
![python](https://img.shields.io/badge/python-3.12+-blue)
![platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey)
![license](https://img.shields.io/badge/license-Apache--2.0-green)

A graphical CAN bus tool: live trace and plots, transmit, CANopen, UDS, J1939, XCP and CCP, and Python scripting, on any adapter supported by python-can -- PEAK, Vector, Kvaser, IXXAT, SocketCAN and low-cost SLCAN adapters among them.

![pycangui on its demo device: the CAN Trace, CAN Transmit and Event Log above, and engine and vehicle speed plotted in Signals and Plot below](https://raw.githubusercontent.com/davhodg/pycangui/master/pycangui/help/main-window.png)

## Install and run

To install it:

```
pip install pycangui
```

To run it (`python -m pycangui` does the same):

```
pycangui
```

To update it:

```
pip install --upgrade pycangui
```

Python 3.12 or newer, on Windows, Linux or macOS.

On Linux, Qt needs a system library to draw the window, and Debian, Ubuntu, Linux Mint and the like often leave it out:

```
sudo apt install libxcb-cursor0
```

To include everything optional up front -- currently that is only the reader for MDF and MF4 measurement files -- install `all`. Without it, pycangui offers to install the reader the first time a measurement file is opened.

```
pip install "pycangui[all]"
```

## What it does

- **Adapters**: every interface python-can supports:
  - USB, PCI and network adapters: 8devices USB2CAN, CANalyst-II, candleLight and other gs_usb devices, CANtact, CSS Electronics CANsub, ETAS, Intrepid neoVI, isCAN, IXXAT, Kvaser, Neousys, NI-CAN and NI-XNET, PEAK PCAN, SYS TEC and Vector.
  - Serial: SLCAN (CANable, Lawicel), Robotell, Seeed Studio and other serial adapters.
  - Linux: SocketCAN, socketcan_vcan from the CANsub plugin, and socketcand to reach a Linux machine's SocketCAN over the network.
  - UDP multicast, to share frames with other python-can programs on the same computer or the local network.
- **Live trace** of every connected channel on one timebase, CAN FD included, with recording to six log formats and replay of a log onto a bus. Filtering is at two levels: an acceptance filter on a channel, which drops frames before they arrive, and a filter on the trace, which hides them and discards nothing.
- **Transmit** raw frames, DBC messages edited by signal, or a CANopen RPDO, once or repeating, with a rolling counter and a checksum -- XOR, sums, CRC-8, CRC-16 or your own -- worked out for every frame.
- **Signals and Plot** from DBC decode, CANopen TPDOs or XCP and CCP polling, with export to CSV and import of MDF and MF4 measurement files.
- **Database**: every message and signal in the loaded DBC files, with each message's bits drawn out -- a multiplexed one for one value of its multiplexer at a time -- and a message sent to Transmit or the trace, or a signal to the plot, from there.
- **CANopen**: node list, object dictionary, PDO configuration, EMCY, LSS, SYNC, DCF save, apply and compare, firmware download (CiA 302-3), and the network's PDOs, heartbeats and emergencies saved as a DBC.
- **UDS** over ISO-TP: sessions, security access, DIDs, DTCs, routines, and firmware transfer in either direction.
- **J1939**: nodes from address claims, DM1 faults with lamp status and the failure mode in words, multi-packet messages (TP.BAM and TP.CM), requesting and sending PGNs, and SPNs decoded from a J1939 DBC.
- **XCP and CCP on CAN**: connect, seed and key, reading and writing A2L measurements and characteristics by polling, curves and maps as tables, and flashing.
- **Custom panes**: the values a job needs -- CANopen objects, XCP and CCP measurements and characteristics by their A2L names, or UDS data identifiers -- laid out as a form with labels and units. Built with no code, and polled into Signals and Plot.
- **ASCII Log**: reads any CAN identifier as text, for devices that print a console into the data bytes.
- **CAN off an oscilloscope**: frames that [pyscopegui](https://github.com/davhodg/pyscopegui), also on [PyPI](https://pypi.org/project/pyscopegui/), decodes from a scope's channel arrive by UDP multicast, and are traced, decoded and plotted like frames from an adapter. The other way, pycangui sends its signals to pyscopegui, to show beside its instruments and to trigger on.
- **Python** hooks with hot reload, replaceable components (your own CAN interface, ISO-TP transport, or XCP or CCP engine), a live console and *Run script*.
- **Plugins** that add a pane of their own, from the plugin lists in *Manage plugins* or a zip:
  - [Motor control (CiA 402)](https://github.com/davhodg/pycangui-cia402): drives a motor controller -- its state, its mode, its target and what it is doing.
  - [EtherCAT](https://github.com/davhodg/pycangui-ethercat): scans a ring, sets the slaves' states, reads and writes their objects, and runs their process data. Its drives can be run from the CiA 402 plugin.
  - [A2L generator](https://github.com/davhodg/pycangui-a2l-gen): creates an A2L file from the ECU's ELF, updates it after a rebuild, and checks it.
- **Simulated nodes**: devices written as Python files, on a virtual bus or standing on a real adapter, and gateways between channels. A demo device that answers CANopen, UDS, J1939, XCP and CCP comes with pycangui.
- **Workspaces**: one for each device or project you work on, holding its hooks, EDS files, databases, channels and layout, and exported as one zip.

The [manual](https://github.com/davhodg/pycangui/blob/master/pycangui/help/manual.md) covers each of these, and is also under **Help > Documentation** in the application.

## Adapters

Any adapter [python-can](https://github.com/hardbyte/python-can) supports, as listed above. Install the adapter maker's driver and python-can finds it at run time.

## More

- [Source, issues and releases](https://github.com/davhodg/pycangui)
- [Standalone Windows installer](https://github.com/davhodg/pycangui/releases)
- [Manual](https://github.com/davhodg/pycangui/blob/master/pycangui/help/manual.md)

## Safety notice and licence

pycangui talks to real equipment. It is intended only for people trained and experienced in working with CAN networks and the equipment connected to them.

Joining a bus at the wrong bitrate makes a controller signal an error on every frame it sees, which can impact the nodes that are already on the bus. Transmitting, replaying a log, writing parameters, enabling a drive and downloading firmware all change what equipment does, and not all of them can be undone.

Know what is on the bus before you join it, and what a device will do before you write to it. Like any software, pycangui can have faults, so do not rely on it to keep anything off the bus. Where a mistake could hurt someone or damage equipment, keep a way to stop that equipment within reach.

The hook and simulated-node templates copied into a workspace are under MIT-0, so what you write in them carries no conditions. pycangui itself is provided under the Apache License 2.0, without warranty of any kind.
