NefMoto

Technical => Diagnostics => Topic started by: Lechuga on December 27, 2019, 02:35:43 AM



Title: CAN bus sniffing
Post by: Lechuga on December 27, 2019, 02:35:43 AM
Forgive me if this has already been discussed but I have become interested in this topic as a means of data logging without the expense of a pro data logger.

I realise it will be hard work to translate each CAN message, but I reckon with the right SW it can be done. I would like to get some feedback on the amount of interest in going down this path.

There are already some open source projects such as "https://github.com/CaringCaribou/caringcaribou/ (https://github.com/CaringCaribou/caringcaribou/)" which aims to test the vulnerabilities of existing vehicle CAN buses in order to make them more secure. And "https://github.com/Hive13/CANiBUS (https://github.com/Hive13/CANiBUS)" to (if I understood correctly) scan, identify and sort messages on a central server.

Cheers!
Chris


Title: Re: CAN bus sniffing
Post by: woj on December 27, 2019, 03:33:14 AM
Don't over do it before you even start ;) Get yourself a Linux installation (can be virtualized), a decent native SocketCAN compatible USB-CAN interface (I advise against all SLCAN shit, they simply do not keep up), Wireshark if you want to be fancy, or just the text based cansniff tool (does not work with extended IDs) and you should be all set. It got me very far (all the way in fact) in my endeavors. 


Title: Re: CAN bus sniffing
Post by: Lechuga on December 29, 2019, 01:03:15 AM
Thanks woj! I hadn't seen your response until now. I have been using linux actively since 1995 and I have a number of different can interfaces I can try. I'll start my dev work and hopefully others will chip in.


Title: Re: CAN bus sniffing
Post by: ruan on December 31, 2019, 05:29:25 AM
For cheaps on Linux, I can recommend getting yourself a CANtact interface: https://linklayer.github.io/cantact/

I had some PCBs done by OSH Park, ordered up the components and made one myself, flashed it with a gs_usb compatible firmware which works much better in my opinion, (the gs_usb kmod is in most modern Linux kernels - https://github.com/candle-usb/candleLight_fw). Works great, super quick, never had a single problem with it.


Title: Re: CAN bus sniffing
Post by: woj on December 31, 2019, 06:59:18 AM
Or you can use Leonardo-CAN device with my gs_usb compatible firmware ;)

https://github.com/woj76/gs_usb_leonardo


Title: Re: CAN bus sniffing
Post by: Lechuga on January 02, 2020, 01:09:14 AM
Already started working on this project. I should have some code to show shortly.