Skip to content

SLCAN problems retrieving the interface's serial number and version #1902

Closed
@rdiez

Description

@rdiez

I have a LAWICEL CAN bus adapter, which uses the SLCAN protocol.

After a long pause, I have started using this adapter again. The first thing I did was to install the current python-can version 4.5.0 on my Ubuntu MATE 22.04.5. The old Ubuntu Linux PC, which I no longer have, had some python-can development version before 4.0, as I needed the then-unreleased 'robotell' protocol too.

However, I did keep my simple CAN bus test script, and I noticed that getting the serial number from the adapter used to work, but it doesn't anymore. Now I am getting 'None' from bus.get_serial_number().

I do not actually know Python, so I am finding this whole subject a bit of a struggle.

I did some sniffing on the serial port with socat. The version number is being queried with the 'N' command in the SLCAN protocol, and the expected serial number is then sent as a reply. But python-can seems to not store it correctly. There is no error message or warning about it.

Is this problem already known?

Other than that, I can send and receive a single CAN bus message. I haven't done any further tests yet, but I have seen other people complaining here that SLCAN adapters do not work reliably.

bus.get_version() is returning (None, None), but I do not know whether that used to work in the past. The SLCAN protocol does have a 'V' command to retrieve version information, so that should be possible too.

I have a second, inexpensive CAN bus adapter which uses the 'robotell' protocol, and getting the interface serial number does work with the same test script.

The 'robotell' driver does not support getting version information though, so I cannot test it there:
AttributeError: 'robotellBus' object has no attribute 'get_version'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions