SocketCAN support

Any progress with SocketCAN support? I’ve seen some comments about this other topics (from last summer). As I understand it, the CAN chip STN2120 has a serial interface, compatible with ELM327. But is it compatible with the slcan driver; does it work in practice?

I’ve investigated this a bit. Unfortunately, I think it will be very difficult (read impossible) to provide generic SocketCAN support with the existing STN2120 hardware. This chip is a OBD interface; not a generic CAN interface:

  • Sending arbitrary RAW messages is possible with some care, and as I understand it is possible even with the existing obd.send function.
  • However, receiving all messages from the bus can only be done in “monitoring” modes. When monitoring, no commands can be executed, thus you cannot transmit.
    If you exit monitoring mode to send something and then return to monitoring, you will miss the data in between. I’m surprised that the ELM/STN developers did not add a mode similar to CANUSB and similar adapters.

Due to this, STN2120 cannot be supported properly by “slcan”. I think it would have been more useful if another chip has been select, such as SJA1000 or similar. Then, the OBD part could have been done in software instead. You would have lost the support for non-CAN vehicles though.

Hi Peter

You are spot on.
We are discussing how we can solve this, because being able to both monitor the traffic, while requesting specific PID’s is something we would really really like to be able to do.

Best regards

1 Like