Skip to main content

CANtact

crates.io crates.io PyPI docs.rs Rust Build Python Build

Software support for CANtact devices. Includes a driver (see driver/), APIs, and a cross-platform command line interface.

Getting a Device

CANtact Pro is currently a pre-launch project on CrowdSupply. You can subscribe on the product page to get updates about the hardware release.

This tool should work fine with other CANtact/gs_usb compatible devices such as CANable.

Installing

The CLI and driver are built using cargo, which can be installed using rustup.

Once cargo is installed, use it to build and install the can binary:

git clone https://github.com/linklayer/cantact
cd cantact
cargo install --path .

Setting udev Rules (Linux only)

On Linux, only root can access the device by default. This results in a DeviceNotFound error when trying to access the device as a normal user. To allow access for all users, create a file at /etc/udev/rules.d/99-cantact.rules which contains:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="606f", MODE="0666"

Then reload the udev rules:

sudo udevadm control --reload-rules
sudo udevadm trigger

Command Line Interface

The CLI is invoked using the can binary:

can help

can 0.1.0
Eric Evenchick <eric@evenchick.com>
Command line utilities for CANtact devices

USAGE:
    can [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    Print verbose debugging information
    -V, --version    Prints version information

SUBCOMMANDS:
    cfg     Set device configurations
    dump    Receive and display CAN frames
    help    Prints this message or the help of the given subcommand(s)
    send    Send a single CAN frame

The can cfg command is used to set the bitrate and other device settings. Once set, other commands will use these options.

For example, to set channels 0 and 1 to 500000 kbps, then dump all frames on all channels:

can cfg --channel 0 --bitrate 500000
can cfg --channel 1 --bitrate 500000
can dump

Use can help [subcommand] for additional documentation.

Rust Support

The driver can be used from Rust by installing the cantact-driver crate. Documentation for the crate can be found on docs.rs.

Python Support

CANtact supports Python 3.5+ on Windows, macOS, and Linux. The Python modules are hosted on PyPI. Installation requires pip 19.0+ (for manylinux2010 wheels).

Python end-users should not use this repository directly. Instead, install Python support using pip:

python3 -m pip -U pip
python3 -m pip install cantact

This will attempt to install a binary distribution for your system. If none exists, it will attempt to build from source. This requires nightly rust, which can be enabled by running rustup default nightly before installing.

See the examples/ folder for Python examples. python-can supports CANtact, and is recommended over using the cantact module directly. To install CANtact, python-can, and run a test:

python3 -m pip install cantact git+https://github.com/ericevenchick/python-can@cantact
can_logger.py -i cantact -c 0 -b 500000

Building Python Support

Building Python support is only required if you want to make modifications to the cantact Python module, or if you are using a platform that does not have packaged support.

Python support is implemented using PyO3, and is gated by the python feature. Thanks to rust-setuptools, the cantact Python module can be built like any other Python module using setuptools. PyO3 requires nightly Rust, which can be configured using rustup override.

cd driver
rustup override set nightly
python setup.py build

Python builds for Windows, macOS, and manylinux are automated using Github Actions. Tagged releases are automatically pushed to PyPI.

C / C++ Support

C / C++ support is provided by the driver. This is currently used to implement BUSMASTER support on Windows.

Metadata

Release files for cantact 0.1.3

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 cantact 0.1.3
File
cantact-0.1.3-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
cantact-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
cantact-0.1.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
cantact-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
cantact-0.1.3-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
cantact-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
cantact-0.1.3-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
cantact-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
cantact-0.1.3-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
cantact-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details

Total release size: 4.8 MB

Release files / cantact-0.1.3-cp312-cp312-win_amd64.whl

Download URL cantact-0.1.3-cp312-cp312-win_amd64.whl
Size 223.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c55a5427fe9db4f8ff446772ab657e83e4f6b28ef9cbe0d1c2f849e71bf919d7
BLAKE2b-256 checksum
How to use checksums
461c7ab0737bf8b6a96d0f73ca30318a9a3fcdf6e9aca607873939c02d0fcdcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / cantact-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cantact-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 738.6 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b1941c91840551b00398acc0f4e56ca07868e9ac01fd881cd4e90d65a3e56574
BLAKE2b-256 checksum
How to use checksums
6754a273cf222bce5b39fac7a397ee748369c5c698bb0ef5bdf716b41e7567d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / cantact-0.1.3-cp311-cp311-win_amd64.whl

Download URL cantact-0.1.3-cp311-cp311-win_amd64.whl
Size 223.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f0d4f994546104f14e25d6c59e3856743534bd7113a8c956afc2b1b7907a0fa7
BLAKE2b-256 checksum
How to use checksums
e9eedc97f76addbb3d7ad200aaabd342f4a052075f1baaec55d4e03be65ed9c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / cantact-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cantact-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 738.6 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
414b21a6ff1fa81b347539babb5affc25207c7ae487e9e8d1f223f9723d0b1ea
BLAKE2b-256 checksum
How to use checksums
6a39bebd34440499865fe95d579dae776940f4ed2e6582f59a34acad9f1877ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / cantact-0.1.3-cp310-cp310-win_amd64.whl

Download URL cantact-0.1.3-cp310-cp310-win_amd64.whl
Size 223.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b892b3c415ebd238d42f52fc21df6b84f5e2066839faea738920e5f19c422a0a
BLAKE2b-256 checksum
How to use checksums
db2c1642b884e0a55d7cdd0f211031f54ca9b6073ceff0746399a71a1f2006a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.11

Release files / cantact-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cantact-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 738.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1e606180b26526d39502a56b061c113bc0ad7d86179e9064672a15316456883e
BLAKE2b-256 checksum
How to use checksums
9e8adf36dffacb5800a466dcea0d2e046eec37740fc66284deb33461d8b66295
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / cantact-0.1.3-cp39-cp39-win_amd64.whl

Download URL cantact-0.1.3-cp39-cp39-win_amd64.whl
Size 223.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
f3fa3ac898c420db670361687adacbc7118ca8a6012fb20aad98e81173bd2464
BLAKE2b-256 checksum
How to use checksums
0e6ef19be0b5e40a8d4ce8d90133ed898b3a82c09582fea04e8e5855b18b62dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Release files / cantact-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cantact-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 738.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
99f94bb8e0a4f001f1a52bf10c01009f6a4056a7c9469030e4fea7597fdd9f66
BLAKE2b-256 checksum
How to use checksums
b89b65f489781309cf8253a1a56cb0b717b7f597f78139d8f5e800d1f29c5417
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release files / cantact-0.1.3-cp38-cp38-win_amd64.whl

Download URL cantact-0.1.3-cp38-cp38-win_amd64.whl
Size 223.8 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
69699309eabdc371d2fc209d9a46b30e2d353677ef19914346de102f129d1421
BLAKE2b-256 checksum
How to use checksums
7e8627a173a8047a1c2fa243dfd76370c8fab33fdb5e835c4e8909d02a8db042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release files / cantact-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cantact-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 738.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ab16abdb8f1fcb32a3a7fecf876c80904c0e0aa0a056a3eaa061df20b8644b73
BLAKE2b-256 checksum
How to use checksums
f754e9605f1c3681e8334b482a9425d6fb9813064c86b5acaf1b7ecd2e3a299d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

10 release files

0.1.2

14 release files

0.1.0

14 release files

0.0.6

13 release files

0.0.2

6 release files

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