Skip to main content

python-can interface for Netronics CANdo and CANdoISO devices

Project description

python-can-cando

PyPI - Implementation PyPI - Version PyPI Downloads PyPI - Python Version


Description

This module is a plugin that lets you use netronics' can adapters (namely the CANdo and CANdoISO devices) in python-can's plugin interface.

Installation

You should have installed the netronics' CANdo drivers before using this library; otherwise you will get a DLL error (or, under linux, a shared library error).

pip install python-can-cando

Usage

Just like any other python-can plugin, you can access the class like so:

import can
bus = can.Bus(interface="cando", channel=0)
# All of your other python-can code...

Or you could just instantiate it directly:

from can_cando import CANdoBus
bus = CANdoBus(channel=0)
# All of your other python-can code...

Extra information

There are some inherent limitations to this device; you should really check the programmer's guide and the actual implementation of some methods, such as the cando_transmit's documentation on how to use the device's internal repeat buffers; the number of such available buffers and message timing periodicity is fixed and limited. The implementation of BusABC.send_periodic is intentionally dummy-overridden for this reason.

Anyways, the programmer's guide and all the relative datasheets for the devices can be downloaded from netronics' download page.

A note on bus load

I found that the device tends to get the CANDO_CAN_RX_OVERRUN status if there is either too much bus load or sudden spikes of bus load (and therefore it loses some can messages); if you have other nodes in the network that send a lot of periodic messages with a short period, you might consider using the appropriate filters, rather that just reading all the messages and filtering them in software.

Compatibility

I developed this library with a CANdoISO device; I don't have a CANdo device to test it, but it should work just as well. There are some minor differences between the two (for example a different clock frequency), but from a software point of view the interfaces are very similar.

This library was developed and tested on Windows 10 and python 3.12, but it should be good to go with python up till 3.7 (checked with vermin) and non-Windows OSs.

Anyways, any feedback is appreciated and welcome; just open an issue or a pull request and I'll gladly take a look at it.

License

python-can-cando is distributed under the terms of the LGPL-3.0-or-later license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_can_cando-1.0.5.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

python_can_cando-1.0.5-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file python_can_cando-1.0.5.tar.gz.

File metadata

  • Download URL: python_can_cando-1.0.5.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for python_can_cando-1.0.5.tar.gz
Algorithm Hash digest
SHA256 354877f410084e6ad452feda2403784bc7c9d6057aa1186d2d1bb450645f52e0
MD5 676fc29176c36fcb966a9c1b09b0e30f
BLAKE2b-256 3c72f97f2ba0fee7982bf66b6fd406efcc704f690c39dd967ab6754bed71555e

See more details on using hashes here.

File details

Details for the file python_can_cando-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for python_can_cando-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 08a7bf6fb75af8eeb97387ddbfcbd61bd00fdfa9966f8f9c66e86f1c8da1b9ca
MD5 3fa0a8f0998c8c9f428c80736fac93c5
BLAKE2b-256 19faded8d2a3b4f4df2375296d809c083eb196c20906178c196fd9f0d6f59fee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page