Page 1 of 1

OBD UART CAN Sniffing challenges

Posted: Fri Nov 29, 2019 7:46 pm
by speedneed
I'm currently working on a project based on the Nano kit. My code is almost ready and shows different information on the oled. Currently I'm using a switch button to switch between the different screens. https://imgur.com/bcjKzpC

The next step is to switch the screen based on built-in button of the car (for example cruise control lower speed). I need to sniff the CAN message for the button press to be able to program an action. So the logic will be:
- listen to specific CAN <message>
- Update a counter in the code
- switch to a next page

Now i'm facing difficulties to get the can sniffing feature working. I understood that the OBD UART adapter has a Micro USB socket to connect directly to a laptop. When I connect to my laptop I get an USB malfunction error. Could someone explain the process to get CAN Sniffing to work with the OBD UART adapter? I'm not getting further at the moment. I tried to search on the internet but there is limited information available.

thank you

Re: OBD UART CAN Sniffing challenges

Posted: Tue Dec 03, 2019 9:07 pm
by stanley
Freematics OBD UART adapter V2 supports CAN sniffing.

Re: OBD UART CAN Sniffing challenges

Posted: Mon Dec 09, 2019 10:14 pm
by speedneed
in that case, I ordered the wrong Adapter..Any option for me to get the adapter only, without paying the 30 dollar shipping costs?

Re: OBD UART CAN Sniffing challenges

Posted: Tue Mar 09, 2021 9:47 pm
by speedneed
Bump as I currently have the correct adapter that supports can sniffing. I there any guide on how exactly to sniff from a laptop for example. I connected the OBD connector to the usb port but I'm not able to connect. Any help is appreciated

Re: OBD UART CAN Sniffing challenges

Posted: Sat Mar 13, 2021 4:27 am
by speedneed
I got a bit further with the adapter. I hooked it up to the laptop and used Tera Term to connect to the adapter Freematics OBD-II UART Adapter V2.1.

I'll put some info here that can be useful for other people.

With teraterm
- Speed 115200
- Data 8 bits
- Parity none
- Stop bits 1 bit
- Flow control none
- Select CR in terminal setup
- Select local Echo in terminal setup

Commands to connect:
Once setup you can use the following commands to create a connection
- ATR This will reset the device/setting
- ATZ This will reboot the device
- ATSP0 This will connect to your car's canbus. 0 = the setting for auto. My car uses ATSP6 for example. Both work.
- ATE 0 | 1 Echo on/off. Not exactly sure what this does
- ATH 0 | 1 Display headers on/off
After executing these commands you should have a connection.

Next step is to enable the setting for CAN sniffing:
ATSH 7EB This will set the header to 7EB
ATCM FFFFFFFF This will set the subnet mask. I'm not sure exactly about this command. FFFFFFF0 will ignore the last bytes I think
ATM1 This will start sniffing
ATM0 This will stop sniffing.


Now my problem is that after following this procedure I only get the same results. I'm getting the result of 0100 (All supported PIDS in HEX. Whatever I try I'm not getting any other data. Does anyone have some information about this? Am I missing some steps? It looks like the adapter is not picking up the broadcast messages.

Re: OBD UART CAN Sniffing challenges

Posted: Thu Aug 26, 2021 9:47 pm
by speedneed
@Stanley can you answer that please? According the documentation sniffing is supported but until now I didn't find any proof that this really works.

Re: OBD UART CAN Sniffing challenges

Posted: Fri Oct 15, 2021 1:54 pm
by Elijah
As far as I know, can_sniffer.ino is not caple of sniffing. It's not functional. AT+M0 and AT+M1 are memory on/off commands for sniffing we need AT+MA command which is not supported. The STM32 firmware needs huge amount of improvements and debugging. @stanley @speedneed

Re: OBD UART CAN Sniffing challenges

Posted: Fri Oct 15, 2021 7:33 pm
by stanley
Sniffing commands are different from standard ELM327. So it makes no sense to referring to ELM327 documentation.

Re: OBD UART CAN Sniffing challenges

Posted: Sat Oct 16, 2021 1:59 am
by Elijah
That's perfect if it's true then. We need a reference document, in this case, to refer to it. Without having a functional co-process there is no way to develop CAN-related stuff any further. Personally, I have never been able to work with Sniffer and it's something as we can see other people are also struggling with it. According to your word the co-processor is supposed to support ELM327 V1.5 and before but as you may know better there are many commands (OBD and CAN) that are not supported although some of them are supported from version 1.0.