Page 1 of 1

VERY simple question

Posted: Tue 11. Nov 2014, 06:09
by jspring
Hi there: I am using code written some years ago for monitoring CAN traffic on a Nissan Altima. We never had to send a telegram to the ECM (as a matter of fact we didn't WANT to send anything- dangerous if you make a mistake). Anyway, now I need to add OBD2 polling. I tried building the poll string, ala "m s 0x7df 2 1 0x10" (an OBD2 broadcast poll, requesting the value of the MAF sensor). But I didn't get any response. I noticed our original code used fgets to get a string. Now, fgets returns a pointer to a string ending in either a newline or EOF. So do I need to add a linefeed at the end of my string? (The documentation doesn't mention a termination character, so I didn't think I needed one.) Thanks!

Re: VERY simple question

Posted: Tue 11. Nov 2014, 13:40
by M.Maidhof
Hi,

can you please post the output of cat /proc/pcan to see the status of the driver and hardware. To send a message by the chardev driver through the PCAN-USB the string is as follows:

echo "m s 0x7DF 2 0x01 0x10">/dev/pcan32

Maybe you have built the driver for netdev, than you can“t receive anything with chardev devices, see dozens of other threads here in the Linux forum with the same issue.

regards

Michael