Author Topic: CAN bus (automotive) sniffing tools?  (Read 4159 times)

0 Members and 1 Guest are viewing this topic.

Online linux-works

  • Super Contributor
  • ***
  • Posts: 1945
  • Country: us
    • netstuff
CAN bus (automotive) sniffing tools?
« on: March 01, 2018, 05:02:29 pm »
I'm wondering how good the rigol scopes are, for example, in decoding CAN bus signals?  I think the 2000 series (or is it just 4000 series?) can do CAN, but how well does it do it?

salae, maybe?  with a level converter or MCP transceiver?

we have Vector tools at work but they are very expensive and we only have a few of them to go around, so I am looking into using digital scopes for this, for realtime display and even if we buy multiple scopes, it will still be cheaper than just ONE vector brand dongle-based tool (sigh).

I know linux can support CAN nicely, but really like the idea of a scope being able to see the can-hi and can-low signals as well as decode them.

what are your experiences in this area?
 

Offline tridentsx

  • Regular Contributor
  • *
  • Posts: 96
  • Country: us
Re: CAN bus (automotive) sniffing tools?
« Reply #1 on: March 01, 2018, 05:14:50 pm »

I have used sigrok with a cheap LA + CAN transceiver on Linux. Not sure if you need to troubleshoot the electrical interface of CAN it should be handled by the transceiver chip.
 
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 368
  • Country: de
  • Sigrok associate
Re: CAN bus (automotive) sniffing tools?
« Reply #2 on: March 01, 2018, 11:04:35 pm »
Depends on what you want to do. If you're only interested in the data that's going over the bus, I'd say a RPi with a CAN shield (e.g. http://skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html) is going to be nice. If you want to examine the signal timings and such on a low level, sigrok can help you out.

A scope is mostly useful for checking signal integrity, it's not going to replace a logic or protocol analyzer because of the dead time and the limited acquisition memory.
 

Online linux-works

  • Super Contributor
  • ***
  • Posts: 1945
  • Country: us
    • netstuff
Re: CAN bus (automotive) sniffing tools?
« Reply #3 on: March 02, 2018, 03:40:54 am »
ok, it seems that there's not a lot of fans of using scopes to decode serial when LA's can do it more easily.

I did get hold of a 'logic' clone and installed sigrok.  quite good, in fact!  price is right, too.

thx
 

Offline Performa01

  • Frequent Contributor
  • **
  • Posts: 901
  • Country: at
Re: CAN bus (automotive) sniffing tools?
« Reply #4 on: March 02, 2018, 07:51:07 am »
ok, it seems that there's not a lot of fans of using scopes to decode serial when LA's can do it more easily.

Yes, indeed, even though some folks seem to look at serial decoding as the single most important feature of a DSO ;)

Yet certain scopes could be a near perfect match for the job, especially the 4000 series for on-site and automotive, but even the 2000 series for general purpose on a tight budget:

https://www.picotech.com/products/oscilloscope

 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 10660
  • Country: 00
Re: CAN bus (automotive) sniffing tools?
« Reply #5 on: March 02, 2018, 08:09:59 am »
ok, it seems that there's not a lot of fans of using scopes to decode serial

Twisting a knob to examine large amounts of serial data just seems like the wrong user interface to me. Entering search values by twisting a knob on a virtual "keyboard" is 100x worse, I want mouse+keyboard.

You can get USB logic analyzers for $6, I don't see the point in insisting that a box with a twisty knob as the only user interface should do more than look at the signal integrity.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3460
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: CAN bus (automotive) sniffing tools?
« Reply #6 on: March 02, 2018, 09:01:36 am »
If you're looking at buying a scope for real time CAN bus, you're doing it wrong. You can only view snapshots after trigger.
Just buy a CAN-USB interface from Kvaser or Peak.
 
The following users thanked this post: JPortici

Offline georgd

  • Regular Contributor
  • *
  • Posts: 53
Re: CAN bus (automotive) sniffing tools?
« Reply #7 on: March 02, 2018, 10:15:28 am »
As mentioned her there are three solution:
- scope with CAN decoder and with trigger on various CAN event
- USB logic analyzer like saleae or USBEE
- USB-CAN interface like Peak

I have all of three and use all of them in different situations. Scope is good for checking physical layer or use it's trigger unit when hunting for protocol violations or rare frames CAN.
Most of time I use USB-CAN interface in connection with Wireshark. A simple software written by me grabs Peak's output converts it into Wireshark capture format and put it in a named queue.
In Wireshark you can parse data with LUA and present it in format suitable for protocol you working on like TP2.0 or ISOO15765.

I like to emphasize  two things otherwise rare mentioned in conjunction with serial decoding: triggering on serial event on scope and as second present serial data in format suitable for higher level protocol.

Georg
 

Offline m_t

  • Contributor
  • Posts: 11
  • Country: de
    • GitHub
Re: CAN bus (automotive) sniffing tools?
« Reply #8 on: March 02, 2018, 01:22:30 pm »
You could just use a Linux single board computer of your choice, a CAN controller (if not already included) and a CAN transceiver. Then you can use SocketCAN to receive CAN messages. Here is a simple test program I wrote some time ago: https://github.com/m-thu/sandbox/tree/master/socketcan
You can even test this without any physical CAN bus by using the virtual CAN interface provided by the SocketCAN networking layer:

Code: [Select]
make
make vcan
./receiver vcan0

And in another terminal:
Code: [Select]
./sender vcan0
 

Offline Gabri74

  • Regular Contributor
  • *
  • Posts: 95
  • Country: it
Re: CAN bus (automotive) sniffing tools?
« Reply #9 on: March 02, 2018, 02:25:23 pm »
I second buying an USB/CAN adapter and using Wireshark.
I've bought this and I'm very happy, best price/performance ratio in my opinion:

https://www.8devices.com/products/usb2can

A note of caution: stay away from the cheap ebay/aliexpress/cineese USB adapters that pretend to work in Linux, they are often based on a serial interface via USB
(CAN <--> SERIAL <--> USB) and are not worth even the cheap price.
And the Windows drivers are really shady... I would never install them ;-)

Last minute edit: for fast analysis you could also use candump utility in linux, it has timestamps, filters, etc and for simple task is helpful.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3460
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: CAN bus (automotive) sniffing tools?
« Reply #10 on: March 02, 2018, 08:30:12 pm »
(CAN <--> SERIAL <--> USB) and are not worth even the cheap price.
They're not fast enough to handle average frames/s.
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 3593
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: CAN bus (automotive) sniffing tools?
« Reply #11 on: March 02, 2018, 08:46:04 pm »
I use a PEAK USB-CAN interface to record and analyse the data on the bus, and an Agilent MSO-X3000 scope with the (very fast, hardware) CAN decoding option to look at signal quality and timing. Both are equally valuable depending on what I'm debugging, and neither could replace the other.

Offline teste_

  • Newbie
  • Posts: 1
  • Country: br
Re: CAN bus (automotive) sniffing tools?
« Reply #12 on: March 04, 2018, 12:35:57 pm »
Use Busmaster: a free tool made by ETAS
https://rbei-etas.github.io/busmaster/
This software requires a CAN interface, which can be PEAK USB, Kvaser, some ETAS and even Vector hardware.

I like the Kvaser Leaf Light v2. It cost around 350USD. PeakUSB is cheaper (~180EUR)

It is also compatible with J1939 databases (you must convert the files from .dbc to .dbf)

edit: typo
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 3460
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: CAN bus (automotive) sniffing tools?
« Reply #13 on: March 04, 2018, 01:37:43 pm »
Kvaser also has an excellent driver to build custom applications around. No serial port rubbish. One API for all their devices, even the networked ones.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19425
  • Country: nl
    • NCT Developments
Re: CAN bus (automotive) sniffing tools?
« Reply #14 on: March 04, 2018, 03:57:54 pm »
The relatively cheap Canusb adapter from Lawicel and 'CAN monitor pro' software from WGSoft work well for me for occasional use. Like AndyC_772 I use an oscilloscope to look at the signal quality. I use the Canusb +   'CAN monitor pro' to look at the data and packet rates.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline gedass2000

  • Newbie
  • Posts: 2
  • Country: lt
Re: CAN bus (automotive) sniffing tools?
« Reply #15 on: February 27, 2019, 11:58:31 am »
TouCAN USB to CAN bus non serial converter works under Linux (SocketCAN).
Using opensource QT.io GUI you can easy analyze CAN bus.
www.rusoku.com/products
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1397
  • Country: us
Re: CAN bus (automotive) sniffing tools?
« Reply #16 on: February 27, 2019, 12:12:37 pm »
I have had great experiences with the PiCAN hat for an RPi. You could buy a dozen of those setups for $1000 and use those typically. Having the filtering and recording capability of the Linux subsystem is very helpful (arguably critical) in automotive CAN reverse engineering.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4578
  • Country: au
  • Question Everything... Except This Statement
Re: CAN bus (automotive) sniffing tools?
« Reply #17 on: February 27, 2019, 12:19:10 pm »
I should flag that a number of tools struggle depending on what you want to do, There is 11 bit can, mainly used in cars, there is 29 bit can mainly used in trucks, and there is now the new CANFD which most of the older tools do not like (newer protocol),

I mentioned the identifier lengths as some buses and trucks like to mix them for no good reason, and a number of tools don't like trancieving both standards at once.

This has resulting in us using an IAXXT and a USB based ELM327 device hooked up to a Y Splitter cable. so we know we can handle whatever it throws in most situations.

I do also have access to a vector (Ironically got from an Expo, its stupid money, but hey freebie), However its not that nice to drive as the others at least for me. you tell it to send a message once, it didn't see an ACK so sent it 22 times, fun stuff like that, that needs far more digging into the driver definition than I cared to.
 

Offline can2sky

  • Newbie
  • Posts: 1
  • Country: by
Re: CAN bus (automotive) sniffing tools?
« Reply #18 on: March 31, 2020, 04:44:32 pm »
Hi to all!

There are many users who try to scan onboard CAN bus networks of cars with a help of CAN utils. Result of scan is raw test output. Someone who is experienced enough to recognize some CAN IDs in raw log but it is difficult to analyze anyway.
I've tried to make things easier with a cloud CAN bus decoder which can use raw output file.
It is completely free and you can use it here - can2sky.com

main idea:


some screenshots





You can upload your log and analyze data if service already has decoder for your vehicle. Some of parameters will be recognized, some not. Service has tools for manual decoding of parameters. Now we are working over sharing logs and decoders between users to establish collaborative decoding.

manual
https://drive.google.com/open?id=1ik4rbaMyAFXXszg3OeMeZ5QGxne66nFdd2u_GT8W8kE

I hope you will like it.
Regards, Andrew

 
The following users thanked this post: Gabri74

Offline Gabri74

  • Regular Contributor
  • *
  • Posts: 95
  • Country: it
Re: CAN bus (automotive) sniffing tools?
« Reply #19 on: March 31, 2020, 05:10:09 pm »
Impressive work, thanks for sharing  :-+

May I suggest you to open a dedicated thread? I think this project deserves its own thead!
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: us
  • Metrology Nut
Re: CAN bus (automotive) sniffing tools?
« Reply #20 on: March 31, 2020, 07:43:47 pm »
I use a picoscope at work for decoding CAN.  It works decently well

Sometimes when an automobile manufacturer updates their CAN protocol with proprietary messages, this is what is used to sniff those new messages out.
All your volts are belong to me
 

Offline Miti

  • Frequent Contributor
  • **
  • Posts: 663
  • Country: ca
Re: CAN bus (automotive) sniffing tools?
« Reply #21 on: March 31, 2020, 07:46:43 pm »
That big spark at power up was by design!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf