Cannot Monitor CANBUS Data
Posted: Tue Aug 27, 2019 10:56 am
This forum will not let me post the intended message. It says, "Not enough characters"?
Hello All,
I'm having trouble getting the CABNUS sniffing option to work with the Freematics product.
Hardware:
Freematics OBD-II (with removable harness)
Arduino MEGA 2560
Vehicle:
2006 Infiniti G35
2016 Chevrolet Equinox
2017 Chevrolet Cruze
I am able to initialize and receive Battery Voltage, DTC info, Supported PIDs, etc. However, the code will not allow the Single or Multi PID to work.
When I modify the code, I'm able to get Engine RPM, however the delay is 2-3 seconds per update and also lagging/behind in the update.
I know that the CANBUS data is available because I'm able to get it working with another product in real-time.
Thank you in advance for any help resolving this issue.
Code Used:
#include <Wire.h>
#include <SoftwareSerial.h>
#include <OBD.h>
#define mySerial Serial
COBD obd;
bool hasMEMS;
void readPIDSingle()
{
/*
int value;
mySerial.print('[');
mySerial.print(millis());
mySerial.print(']');
mySerial.print("RPM=");
if (obd.readPID(PID_RPM, value)) {
mySerial.print(value);
}
mySerial.println();
*/
if(obd.readPID(PID_RPM, value)){
Serial.println(value);
}
}
void setup()
{
mySerial.begin(115200);
while (!mySerial);
// this will begin serial
byte version = obd.begin();
delay(2000);
}
void loop()
{
readPIDSingle();
/* readPIDMultiple();
readBatteryVoltage();
if (hasMEMS) {
readMEMS();
}
*/
}
Output before code edit:
No DTC
1 DTC: 6200
[26015]Battery:11.9V
[44183]Battery:11.9V
[68262]Battery:11.9V
[86476]Battery:11.9V
Output after code edit (very slow):
No DTC
650
650
650
662
662
662
1500
1500
1500
1500
1500
2187
Hello All,
I'm having trouble getting the CABNUS sniffing option to work with the Freematics product.
Hardware:
Freematics OBD-II (with removable harness)
Arduino MEGA 2560
Vehicle:
2006 Infiniti G35
2016 Chevrolet Equinox
2017 Chevrolet Cruze
I am able to initialize and receive Battery Voltage, DTC info, Supported PIDs, etc. However, the code will not allow the Single or Multi PID to work.
When I modify the code, I'm able to get Engine RPM, however the delay is 2-3 seconds per update and also lagging/behind in the update.
I know that the CANBUS data is available because I'm able to get it working with another product in real-time.
Thank you in advance for any help resolving this issue.
Code Used:
#include <Wire.h>
#include <SoftwareSerial.h>
#include <OBD.h>
#define mySerial Serial
COBD obd;
bool hasMEMS;
void readPIDSingle()
{
/*
int value;
mySerial.print('[');
mySerial.print(millis());
mySerial.print(']');
mySerial.print("RPM=");
if (obd.readPID(PID_RPM, value)) {
mySerial.print(value);
}
mySerial.println();
*/
if(obd.readPID(PID_RPM, value)){
Serial.println(value);
}
}
void setup()
{
mySerial.begin(115200);
while (!mySerial);
// this will begin serial
byte version = obd.begin();
delay(2000);
}
void loop()
{
readPIDSingle();
/* readPIDMultiple();
readBatteryVoltage();
if (hasMEMS) {
readMEMS();
}
*/
}
Output before code edit:
No DTC
1 DTC: 6200
[26015]Battery:11.9V
[44183]Battery:11.9V
[68262]Battery:11.9V
[86476]Battery:11.9V
Output after code edit (very slow):
No DTC
650
650
650
662
662
662
1500
1500
1500
1500
1500
2187