Unable to sniff CAN traffic
Posted: Tue Oct 20, 2020 9:23 am
Hello, I recently purchased the Freematics ONE+ B. I was able to get an example sketch (datalogger) working and am working on developing my own program. I'd like to use the sniff functionality to passively capture CAN frame data, however I don't seem to be able to do so.
I loaded the can_sniffer example sketch from the firmware_v5 folder in the Freematics repo and plugged the device into my car with the USB serial attached to my laptop. I see no output over serial. In my own custom sketch, which is based on can_sniffer, I also see no data. I tried changing the header mask from 0xFFFFFFF0 to 0x0 (which should allow all messages) and I still see nothing. I then tried to query a PID by myself, letting the can_sniffer code sniff the result. To do this, I did:
I would expect that the sniffer should sniff the OBD-II response to this RPM request, especially since readPID works for that PID, but I again see no data. Does anyone have any ideas why I'm unable to sniff ANY data?
I loaded the can_sniffer example sketch from the firmware_v5 folder in the Freematics repo and plugged the device into my car with the USB serial attached to my laptop. I see no output over serial. In my own custom sketch, which is based on can_sniffer, I also see no data. I tried changing the header mask from 0xFFFFFFF0 to 0x0 (which should allow all messages) and I still see nothing. I then tried to query a PID by myself, letting the can_sniffer code sniff the result. To do this, I did:
Code: Select all
char buffer[64];
sprintf(buffer, "%02X%02X\r", obd.dataMode, PID_RPM);
link->send(buffer);