Cannot Monitor CANBUS Data

Inquiry and support for Freematics products
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: Cannot Monitor CANBUS Data

Post by stanley »

Serial1.println("ATM1");
dbellairs
Posts: 4
Joined: Tue Sep 07, 2021 5:51 am

Re: Cannot Monitor CANBUS Data

Post by dbellairs »

Hi Stanley,

HW: Freematics One
SW: https://github.com/stanleyhuangyc/Freem ... ematicsONE

I'm stuck right now trying to determine if the ignition is on / off. My initial thought was to periodically check the accel and see if the vehicle is moving. This won't work for me because my client could be on a dyno where the accel would be very low. My next attempt was to use the monitor all feature that's listed in this thread. I tried:

COBDSPI obd;

In arduino startup function:
obd.begin();
obd.init();
char buf[32];
Serial.println("Turn monitoring on.");
obd.sendCommand("ATM1\r", buf, sizeof(buf));
dbellairs
Posts: 4
Joined: Tue Sep 07, 2021 5:51 am

Re: Cannot Monitor CANBUS Data

Post by dbellairs »

Sorry, I posted by accident before finishing my thought...

NOTE: I slightly altered the library to make receive a public function.

then in the arduino loop, I'm calling this:

Serial.println("Listen for data on the bus.");
boolean DataReceived = false;
char buf[32];
DataReceived = obd.receive(buf, sizeof(buf));
Serial.print("Data Received: ");
Serial.print(DataReceived);
Serial.print(" Data: ");
Serial.println(buf);

Here's what's printed:
Listen for data on the bus.
Data Received: 1 Data: $OBDOK

This is printed when the ignition is on, off, and also when the Freematics is unplugged from the vehicle OBD port.

I must be using the API incorrectly for "Monitor All".

Thanks
stanley
Site Admin
Posts: 1018
Joined: Sat Mar 01, 2014 3:15 am

Re: Cannot Monitor CANBUS Data

Post by stanley »

CAN sniffing/monitoring is only supported by ONE+.
Post Reply