OBD UART CAN Sniffing challenges

Inquiry and support for Freematics products
Post Reply
speedneed
Posts: 5
Joined: Wed Nov 27, 2019 8:00 pm

OBD UART CAN Sniffing challenges

Post 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
stanley
Site Admin
Posts: 932
Joined: Sat Mar 01, 2014 3:15 am

Re: OBD UART CAN Sniffing challenges

Post by stanley »

Freematics OBD UART adapter V2 supports CAN sniffing.
speedneed
Posts: 5
Joined: Wed Nov 27, 2019 8:00 pm

Re: OBD UART CAN Sniffing challenges

Post 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?
speedneed
Posts: 5
Joined: Wed Nov 27, 2019 8:00 pm

Re: OBD UART CAN Sniffing challenges

Post 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
speedneed
Posts: 5
Joined: Wed Nov 27, 2019 8:00 pm

Re: OBD UART CAN Sniffing challenges

Post 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.
speedneed
Posts: 5
Joined: Wed Nov 27, 2019 8:00 pm

Re: OBD UART CAN Sniffing challenges

Post 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.
Elijah
Posts: 4
Joined: Fri Jun 15, 2018 6:47 am

Re: OBD UART CAN Sniffing challenges

Post 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
stanley
Site Admin
Posts: 932
Joined: Sat Mar 01, 2014 3:15 am

Re: OBD UART CAN Sniffing challenges

Post by stanley »

Sniffing commands are different from standard ELM327. So it makes no sense to referring to ELM327 documentation.
Elijah
Posts: 4
Joined: Fri Jun 15, 2018 6:47 am

Re: OBD UART CAN Sniffing challenges

Post 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.
Post Reply