Page 2 of 2

Re: Cannot Monitor CANBUS Data

Posted: Fri Nov 08, 2019 7:20 pm
by stanley
Serial1.println("ATM1");

Re: Cannot Monitor CANBUS Data

Posted: Tue Sep 07, 2021 10:57 pm
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));

Re: Cannot Monitor CANBUS Data

Posted: Tue Sep 07, 2021 11:04 pm
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

Re: Cannot Monitor CANBUS Data

Posted: Tue Sep 14, 2021 10:48 am
by stanley
CAN sniffing/monitoring is only supported by ONE+.