candleLight, CANable, CANnectivity and cantact adapters speak gs_usb. On Linux and macOS the kernel driver exposes them as SocketCAN interfaces, so SavvyCAN already reached them through Qt SerialBus. Windows has no such driver, which left those adapters unusable there. Add a GSUSBConnection that talks to the hardware directly over WinUSB: - one connection per physical device, one SavvyCAN bus per CAN channel - CAN FD including BRS, plus RTR, extended IDs and error frames - known good bit timings for 16/48/80/160/170 MHz device clocks, with a generic solver for clocks the tables do not cover - hardware timestamps, unwrapped across the 32 bit rollover and anchored to the host clock so they line up with the rest of SavvyCAN gs_usb multiplexes every channel over a single USB bulk IN endpoint, so a single reader thread drains it and hands frames to the connection thread in batches, coalescing the wakeups. That keeps one producer on the lock free queue, which the tx echo path already writes to. Device scans skip adapters that a live connection holds. candle_dev_open() shares the file handle and queues read URBs immediately, so probing a device in use would consume frames the open connection is waiting for. connections/candle_api is an unmodified copy of the candle Windows API, LGPL 3.0 rather than MIT and only compiled into Windows builds. See its README for provenance. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZnuZJ7zc3e8hk6C8bGDZN
5.4 KiB
Adding a new connection
At the moment it is possible to use any QT SerialBus compatible device and any GVRET compatible device in any of the supported operating systems. SerialBus supports socketcan on linux, passthrough on Linux and Windows 32 bit, and Vector, PeakCAN, and TinyCAN on supported OS's.
At this time GVRET compatible devices are: EVTVDue, EVTV CANDue (1.3/2/2.1/2.2), Teensy 3.1-3.6, Macchina M2, Macchina A0, EVTV ESP32 Due.
You can also use a variety of network based connections to gain access to remote capture hardware.
Connecting To GVRET Devices
SavvyCAN is able to connect to GVRET compatible devices to capture new traffic. These devices will present as serial ports on the connected PC. To connect to a dongle select "Serial Connection." This will bring up a list of serial ports on the machine. Select the proper one and then press "Create New Connection". This will close the window and bring you back to the connection manager window. If connection succeeds the status will show "Connected" for your newly set up device.
You can also connect to some GVRET devices over the network (A0, EVTV ESP32Due). These devices broadcast their address. Once you've selected "Network Connection (GVRET)" you should see a list of IP addresses that appear to have GVRET devices on them. You can also manually enter the proper IP address but if the device did not automatically register itself it is unlikely to work with a manual entry either.
Connecting to QT SerialBus Compatible Devices
SavvyCAN can also connect to a wide variety of CAN hardware through the built-in QT SerialBus drivers. These drivers vary by operating system but support socketcan on LINUX and Vector tools on both LINUX and Windows. When you select "QT SerialBus Devices" you will get a list of device types supported. Select a device type and for most devices you should see the Port list fill out with all registered and valid ports for that driver. Socketcan devices, for instance, are automatically detected now. Then push "Create New Connection" and you should see the new connection in the table on the left of the window. Note that SocketCAN devices don't support changing the baud rate within a program. You must do this when you set up the connection via console commands. This is outside the scope of this documentation. Consult the SocketCAN documentation for details on configuring such devices.
QT also includes a "virtualcan" device type. You can use this to create a bus that will loop back anything you send to it. This is useful for testing without needing to connect any devices or load any log files.
Connecting to gs_usb Devices (Windows)
gs_usb is the USB protocol spoken by candleLight, CANable (candleLight firmware), CANnectivity, cantact and similar open hardware adapters. On LINUX and macOS these devices are handled by the kernel gs_usb driver and show up as ordinary SocketCAN interfaces, so use the "QT SerialBus Devices" option there. Windows has no such driver, which is why SavvyCAN talks to them directly over WinUSB.
Select "gs_usb", pick your device from the list, choose a bus speed and, for FD capable hardware, tick CAN FD and pick a data rate. Multi channel adapters appear as a single connection with one SavvyCAN bus per channel, each of which can be configured separately once the connection exists.
The device interface has to be bound to WinUSB. Recent candleLight and CANnectivity firmware declares this itself through WCID descriptors, so Windows installs the driver automatically when the adapter is first plugged in. Older firmware may need the WinUSB driver assigned manually with a tool such as Zadig. If the device does not show up in the list, that binding is the first thing to check.
Connecting to Socketcand
This is a LINUX only solution which allows one to connect to a socketcan device that is registered on the local network. You can also set up SSH tunnels or VPN to expand the reach over the internet. It should fill out a list of any available socketcand interfaces. Setting up socketcand is outside the scope of this help file but may your GoogleFu be strong.
Connecting over MQTT
Lastly, it is possible to connect to an MQTT broker to send and receive CAN traffic over the internet. This is much like socketcand but more cross platform and also supports easy broadcasting. For instance, for capture the flag events, it would be possible to connect the device over MQTT and have multiple participants and/or watchers all connected at once. Connection to the MQTT broker is set up in the main SavvyCAN preferences. In this window you merely select the topic name to subscribe to. There is currently no automatic way to list these topics so you will need to know the topic to subscribe to ahead of time. It should be noted that the bidirectional nature of this interface means that everyone is on equal footing. You can create an MQTT interface that others can connect to or you can connect to a topic that is currently being sent to from elsewhere and get the traffic. Additionally, the SavvyCAN source code at GitHub has a python script which can be used to connect a socketcan interface to MQTT. You can use this script on a remote system to connect it to the internet so that you can run SavvyCAN somewhere apart from the device under test.
