P1 isn't picking up any CAN data

Hello everyone!

I recently got the P1 in the mail and I followed all the documentation provided. I connected it to the internet, did the updates and changed the 2 lines in uEnv.txt. Then I tried the candump command (at different bit rate’s) and nothing showed up. I also followed the mini project tutorial P1 CAN vehicle data and installed python-CAN library but when I run the command “python scripts/p1_data.py” everything goes just as planned until the CSV file created stage then nothing gets recorded. I left it for 5 minutes but the CSV files were empty and the terminal wasn’t printing out “Polling” like it shows in the screenshot.

I tried this on two cars:

  1. 2012 Dodge Grand Caravan RT
    
  2. 2013 Nissan Juke
    

What I think might the issue is that I have the wrong bit rate set (but I’m not sure how to find out my car’s bit rate) or the car’s don’t show any CAN data through the OBD-II connector which I’m not sure how to check either.

I am very new to car hacking and this my first time trying to read data from the OBD-II connector, so any help is appreciated!

500k bitrate is always the first one to try. Looks like Nissan Juke is 500k judging by a mention here… http://www.racelogic.co.uk/_downloads/vbox/Vehicles/Other/Docs/Nissan-Juke.pdf

1 Like

Yea, that’s what I had it set to but nothing shows up when I do candump. I even tried sending a can message

cansend can0 7df#0209020000000000

to see if anything comes back but nothing happens so I’m not sure what I’m doing wrong here.

One thing you could try to do is get hold of the wiring diagram for the car, and see if you can see how the CAN bus is wired, it might give you an idea of what you’re up against. Like, whether the car has a single bus connected to everything (in which case you should see data) or multiple busses with gateways. It’s possible you have to connect to the bus at a different location.

Even if stuff on the bus refuses to talk to you, nodes ACK messages, you would be able to use that to work out if you’re on an active bus or not. I have a USB dongle with an LED which shows me that, but looks like you can work that out from Linux stats… https://stackoverflow.com/questions/53870499/how-check-bus-state-in-socketcan

1 Like

When you’re using the cansend command, nothing should actually show up in the terminal unless you have the CAN 0 and 1 channels connected to each other. This tutorial here may be helpful with learning the basics of CAN frame sending and receiving. It requires an OBD3way board but you may be able to skip that and wire the CAN channels together yourself with some wires and resistors. (At your own risk of course!)

As for the vehicle data collection issue, nothing immediately comes to mind, but looking at the source code here may be helpful. Based on what you’ve said, it seems like you’re hanging up at around line 42, i.e. no messages received on the CAN bus.

1 Like

I will need to look into where I can find the wiring diagram. I followed the instructions from the link and ran this command

ip -details -statistics link show can0

and I got this as a reply. I’m not sure what to make of it.

What does the can state Error-active mean ?

I’m a bit confused, why do they have to be connected if I’m plugging the P1 into the car’s OBD-II? In the documentation it doesn’t mention anything about it ? all they do is write the cansend command and it shows the can messages. (Step 6 of the getting started docs) I’m only trying to follow the tutorial, I don’t really have any experience in car hacking in general.

I also downloaded that code and followed all the steps and ran it, everything was fine until like you said it reaches line 42, it doesn’t print the “Polling” output. I’m not really sure what’s causing that.

I’m observing what happens to my P1 when I connect and disconnect from the bus. When the device is connected, sending messages with cansend causes the TX counts to increase. When disconnected, it remains the same value - the messages get buffered because they aren’t acknowledged. Then reconnecting causes the messages to be re-transmitted, and the TX values increase.

I think, because you’re seeing TX bytes/packets at zero means your P1 isn’t connected to a bus properly. Either there’s no CAN bus present, or your device isn’t configured to correctly participate.

1 Like

The ERROR-ACTIVE state is to do with how devices respond to errors, not too relevant to this discussion. Devices maintain a counter of errors, and transition from ERROR-ACTIVE (will send error frames out when they see an error) to ERROR-PASSIVE (send passive error frames) to BUS-OFF (stop transmitting on the bus for a while).

Just my 2p… If you’re having trouble getting things working, and don’t mind spending a bit more cash, I would recommend getting some more equipment, say, a different CAN device (USB) and some way to connect devices like the OBD3way. When you’re dealing with something unknown, like an undocumented car CAN bus, being able to put a known working system together on your desk means you can differentiate between problems interfacing to the car bus, and problems in your own equipment setup.

1 Like

Sorry, I think we’re talking about different articles in the docs right now.
You need to connect CAN 0 and CAN 1 if you’re doing the P1 loopback (link here)
You do not need to connect CAN 0 and CAN 1 if you’re going through the P1 getting started (link here), but you will need to connect to a car at step 6 if you want to see some data.

As for why the P1 vehicle data program is hanging up at around line 42 (i.e. no CAN data received) I’m afraid I don’t have any immediate answers. What I would recommend though is trying the P1 loopback tutorial I was talking about which would at least eliminate the possibility of there being a CAN issue with the P1 itself.

2 Likes