Tool to configure and operate OpenInverter systems over CAN
Project description
OpenInverter CAN tool
A tool to allow configuration and operating of OpenInverter systems for electric vehicles over a CAN connection.
Features
- Display all available modifiable parameters and read-only values supported by a given inverter firmware version
- Read a specified parameter/value
- Write a new value to a specified parameter
- Display the current value of each parameter/value on a given device
- Log a list of parameters to a CSV file at regular intervals
- Save and load all parameters to and from a JSON file
- Manage parameter to custom CAN message mappings:
- Create, remove and list parameter mappings on a device
- Support maps with standard CAN 2.0a and extended CAN 2.0b frames
- Export and import mappings to a local JSON file
- Export mappings to DBC allowing easier debugging with SavvyCAN
- Upgrade firmware or recover devices over CAN
- Display the inverter serial number
- Command the inverter to:
- Start
- Stop
- Load parameters from flash
- Save parameters to flash
- Revert parameters to their default values
- Reset
- Display a device's error log
- Scan a CAN bus for possible nodes
- Runs on Linux, Windows and MacOS with python 3.9+
- Support shell completion for commands and options for bash, zsh and fish shells
- Works with any CAN adapter supported by python-can
- Supports stm32-sine 5.24.R or later
- Automatic parameter database download and caching (requires stm32-sine 5.27.R or later)
- Works with Foccci/Clara CCS controller, Stm32-vcu (a.k.a. Zombieverter VCU) and Flying ADC BMS
Installation
To avoid any clashes with other software the tool is best is best installed using the pipx package manager. Install this following the pipx installation guide for your platform.
Initial Install
The most recent release may be installed using:
pipx install openinverter_can_tool
Upgrading
Upgrading to the most recent release is carried out using pip:
pipx upgrade openinverter_can_tool
Configuration
Before the tool can be used the CAN interface adapter needs to be configured. To do this create ~/.canrc on Linux and MacOS or %USERPROFILE%/can.conf on Windows. Details on interfaces supported and the configuration file format can be found in the python-can documentation.
An example configuration file for a SocketCAN compatible adapter on Linux would look like:
[default]
interface = socketcan
channel = can0
bitrate = 500000
Note: Before the tool can on Linux run the SocketCAN network interface needs to be started. Read the guide on how to do this.
An example configuration file for a SLCAN adapter such as GVRET on Windows would look like:
[default]
interface = slcan
channel = COM8
bitrate = 500000
Tested interfaces
- Innomaker USB2CAN in Linux using
socketcan - GVRET in Linux using
slcan - MKS CANable V2.0 Pro in Windows and Linux using
slcan - FYSETC UCAN in MacOS using
slcan - Peak PCAN-USB in Linux using
socketcan
Let me know if you have used a particular CAN interface successfully and I can expand this list.
The many CANable clone devices on eBay or AliExpress can be swapped from socketcan to slcan firmware (or vice versa) using the web firmware updater.
Incompatible interfaces
These python-can drivers are known to have problems with openinverter_can_tool:
- Geschwister Schneider and candleLight using
gs_usbon Windows or Linux. This prevents Innomaker USB2CAN from working with Windows.
Command Line Usage
To get the usage information for the tool run the oic command with no parameters:
Usage: oic [OPTIONS] COMMAND [ARGS]...
OpenInverter CAN Tool allows querying and setting configuration of inverter
parameters over a CAN connection
Options:
-d, --database FILE Override the OpenInverter JSON parameter database
to use
-c, --context TEXT Which python-can configuration context to use
-n, --node INTEGER RANGE The CAN SDO node ID to communicate with [env var:
OIC_NODE; default: 1; 1<=x<=127]
-t, --timeout FLOAT Response timeout in seconds [default: 1.0]
--debug Enable detailed debugging messages
--version Show the version and exit.
--help Show this message and exit.
Commands:
cache Parameter database cache management commands
can Manage parameter to CAN message mappings on a device
cmd Execute a command on a device
dumpall Dump the values of all available parameters and values
errors List all of the errors on a device
listparam List the definition of PARAM
listparams List all available parameters and values
load Load all parameters from json IN_FILE
log Log the value of PARAMS from the device periodically in CSV...
read Read the value of PARAM from the device
save Save all parameters in json to OUT_FILE
scan Scan the CAN bus for available nodes
serialno Read the device serial number.
upgrade Upgrade the device firmware.
write Write the value to the parameter PARAM on the device
To scan for OpenInverter devices on a CAN network:
$ oic scan
Scanning for devices. Please wait...
Found possible OpenInverter node: 1
Found possible OpenInverter node: 3
To read the current value of a parameter:
$ oic read brakeregen
brakeregen : -50
Values may be changed using symbolic names:
oic write potmode DualChannel
oic write pinswap PWMOutput13,PWMOutput23
Firmware on devices may be easily upgraded:
$ oic upgrade stm32_sine.bin
Device upgrade started for 87193029
Upgrading: 15.3% complete
Experimental GUI
An experimental GUI version of the tool exists which can be started by running the oic-gui command:
Further details can be found in the user documentation.
Development and Contributing
If you are interested in contributing to the tool please check the contributing guidelines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openinverter_can_tool-0.5.1.tar.gz.
File metadata
- Download URL: openinverter_can_tool-0.5.1.tar.gz
- Upload date:
- Size: 384.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fa724f50ca4eae0896448b402b7f15e912e945bd5befc8af4da9a2ebb9041c2
|
|
| MD5 |
6c9949aa134ae2e71f848f72394f4857
|
|
| BLAKE2b-256 |
3038b7a74f28862e82660956b6d621f36550e47104478fac091bb6c1cd8e9c80
|
Provenance
The following attestation bundles were made for openinverter_can_tool-0.5.1.tar.gz:
Publisher:
release.yml on davefiddes/openinverter-can-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openinverter_can_tool-0.5.1.tar.gz -
Subject digest:
4fa724f50ca4eae0896448b402b7f15e912e945bd5befc8af4da9a2ebb9041c2 - Sigstore transparency entry: 714064689
- Sigstore integration time:
-
Permalink:
davefiddes/openinverter-can-tool@1e53f1daf860bdd232a522ac5ceaf5569adcb221 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/davefiddes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1e53f1daf860bdd232a522ac5ceaf5569adcb221 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openinverter_can_tool-0.5.1-py3-none-any.whl.
File metadata
- Download URL: openinverter_can_tool-0.5.1-py3-none-any.whl
- Upload date:
- Size: 366.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72302f6f3024ad293584fa0706c5e9fa863e181ed50b8d6185253c126617fdb2
|
|
| MD5 |
80dafac4621490353e60314a06db28e7
|
|
| BLAKE2b-256 |
1e0a6af939b1db477080fb0a47e48b3c6733aed4eee494a95f3696aaaa4c1642
|
Provenance
The following attestation bundles were made for openinverter_can_tool-0.5.1-py3-none-any.whl:
Publisher:
release.yml on davefiddes/openinverter-can-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openinverter_can_tool-0.5.1-py3-none-any.whl -
Subject digest:
72302f6f3024ad293584fa0706c5e9fa863e181ed50b8d6185253c126617fdb2 - Sigstore transparency entry: 714064699
- Sigstore integration time:
-
Permalink:
davefiddes/openinverter-can-tool@1e53f1daf860bdd232a522ac5ceaf5569adcb221 -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/davefiddes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1e53f1daf860bdd232a522ac5ceaf5569adcb221 -
Trigger Event:
push
-
Statement type: