Geschwister Schneider and candleLight#
Windows/Linux/Mac CAN driver based on usbfs or WinUSB WCID for Geschwister Schneider USB/CAN devices and candleLight USB CAN interfaces.
pip install "python-can[gs_usb]"
Usage: pass device
index (starting from 0) if using automatic device detection:
import can bus = can.Bus(interface="gs_usb", channel=dev.product, index=0, bitrate=250000)
address to open a specific device. The parameters can be got by
pyusb as shown below:
import usb import can dev = usb.core.find(idVendor=0x1D50, idProduct=0x606F) bus = can.Bus( interface="gs_usb", channel=dev.product, bus=dev.bus, address=dev.address, bitrate=250000 )
Geschwister Schneider USB/CAN devices and bytewerk.org candleLight USB CAN interfaces such as candleLight, canable, cantact, etc.
Windows, Linux and Mac.
The firmware implementation for Geschwister Schneider USB/CAN devices and candleLight USB CAN can be found in candle-usb/candleLight_fw. The Linux kernel driver can be found in linux/drivers/net/can/usb/gs_usb.c.
gs_usb interface in
python-can relies on upstream
gs_usb package, which can be found in
gs_usb package uses
pyusb as backend, which brings better cross-platform compatibility.
Note: The bitrate
1M are supported in this interface, as implemented in the upstream
Message filtering is not supported in Geschwister Schneider USB/CAN devices and bytewerk.org candleLight USB CAN interfaces.
- class can.interfaces.gs_usb.GsUsbBus(channel, bitrate, index=None, bus=None, address=None, can_filters=None, **kwargs)[source]#
channel – usb device name
index – device number if using automatic scan, starting from 0. If specified, bus/address shall not be provided.
bus – number of the bus that the device is connected to
address – address of the device on the bus it is connected to
can_filters – not supported
bitrate – CAN network bandwidth (bits/s)
- send(msg, timeout=None)[source]#
Transmit a message to the CAN bus.
CanOperationError – if the message could not be sent