Cannot Monitor CANBUS Data
Re: Cannot Monitor CANBUS Data
Serial1.println("ATM1");
Re: Cannot Monitor CANBUS Data
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));
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
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
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
CAN sniffing/monitoring is only supported by ONE+.