Can't get P1 to send or receive on either CAN bus

Hi!

A P1 arrived today, along with the ODB-2 3-way kit.

I followed the P1 setup instructions, including the firmware pin settings. Debian updated, got it working on wifi, etc. Can’t get it sending and receiving to other devices.

I’ve tried the P1 CAN0 to CAN1 loopback, literally cut-n-paste the instructions. candump doesn’t show anything, cansend doesn’t cause any reception on other devices.

I can’t get the P1 to communicate on the CAN bus at all. I have other CAN equipment (Macchina M2, Arduino, USB dongle) and I can get those devices sending and receiving to each other through the 3-way.

The pin configuration is thus…

root@beaglebone:/home/debian/bbb-pin-utils# ./show-pins  | grep can
P9.20 / cape i²c sda              94 fast     up  2 can 0 tx         can@481cc000 (pinmux_dcan0_pins)
P9.19 / cape i²c scl              95 fast rx  up  2 can 0 rx         can@481cc000 (pinmux_dcan0_pins)
P9.26                             96 fast     up  2 can 1 tx         can@481d0000 (pinmux_dcan1_pins)
P9.24                             97 fast rx  up  2 can 1 rx         can@481d0000 (pinmux_dcan1_pins)

Any ideas what’s up?

Hey @alien.technology - sorry you are having trouble here. I know as part of our final testing, we do a CAN loopback test to confirm everything is functional. We use a “test” SD with everything already set up.

We’ll flash an image to a new SD card and confirm our instructions are accurate and not missing anything. I’ll post results up here after that…

1 Like

Aha! Worked it out.

I’ve been trying to get this working on USB power. There needs to be a 12V supply through the OBD-II connector to power the CAN circuitry in order to CAN send/receive. Everything is working fine using the OBD3way to power the P1.

Thanks for your support, @josh.

@alien.technology How did You make it work?
Im connected to the P1 through USB and it is connected to the OBD connector on my car. I can’t get it working, no candump, no communication between P1 and the car.
Thanks a lot!

I pretty much followed the instructions. I haven’t tried OBD power plus USB connection, I powered off OBD connector, and then logged in over wifi to interact with the device. I’ll list some things in case they help you…

  • You have to do the thing where you edit uEnv.txt file so that it sets up the pins for CAN activity.
  • You have to run something like ip link set dev can0 type can bitrate 500000, followed by ifconfig can0. Make sure the data rate is right for your car.
  • You have to make sure that the bus has the right 120-ohm termination, which I assume you will have since you’re jacking into the OBD port.
  • You have to be sure there’s something on the bus. In a modern car, the interesting CAN traffic may not be visible on the OBD port - the ECU may be on a different CAN bus behind a diagnostic gateway. You could try scanning for diagnostic services at the OBD port with Caring Caribou.
  • Your OBD port may not expose CAN services at all.

If it helps, I could try to connect over USB with OBD power on my setup and check that works, I’ve only connected over wifi so far.

Just to confirm, it works for me. I’m connected to the device over USB on power from the ODB port, captures CAN messages no problem.

Thx a lot! You helped so much! It works now:)

1 Like

Did you guys try connecting with the WiFi dongle on just the USB? Mine seemed to be very sporatic. I haven’t tried powering up with the OBD port yet. Can’t stay connected via WiFi long enough to accomplish anything.

@redheadedrod I’ve had no problems with the wifi. Mainly been using it over wifi while OBD-powered.

My wifi AP is real close to the desk, though. It’s a tiny dongle, I guess the antenna may have some limitations?

Mine is literally 3’ from a very powerful AP.
I haven’t had time to mess with it but if I pull the WiFi and just connect via USB to the internet it works fine. If I try to use the WiFi it is only sporatic. Ie it will connect for about 20 seconds then disconnect and I have to reconnect. It is NOT the AP or the distance. This AP is isolated and is only connected to about 3 or 4 devices wirelessly but is a tri-radio, gaming compatible AC router.

Maybe faulty wifi dongle, since mine can reach my home wifi from quite long distance through concetrace walls

Just using the USB cable?

Hi. I’m new on this forum. I’m having problems configuring my Macchina P1. I’m following all infoes I find but cannot send or receive any data. After sending the ifconfig can0 I receive:
can0: flags=128 mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 39
Could you help me.
Thanks.

@microwork oops! Error in my instructions way back, that should have been:

ifconfig can0 up

It looks like your CAN interface isn’t running, you should see UP. ifconfig can0 up will fix.

can0: flags=193<UP,RUNNING,NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 215697865  bytes 1205685594 (1.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 215697865  bytes 1205685594 (1.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Hi @alien.technology,
thanks for your support!
Despite your suggestion I’m unable to see the CAN0 interface working.
The output of command “ifconfig can0” is the same I wrote before.
Specifically I don’t understand the “device interrupt 39” and I think that it’s the issue!
Please can you help me ASAP?
Thanks

Here’s what my P1 CAN0 looks like…

can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 2  bytes 16 (16.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1680  bytes 5040 (4.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 39  

@microwork, I have the same interrupt 39. Have you got it so that the UP flag shows in ifconfig output? If you got that far, it means the Beaglebone setup is right, and you need to look at whether the CAN connection parameters are right. Definitely plugged in correctly? Is this a real car, or do you need to check the bus is terminated correctly? You definitely got the right bitrate for the CAN bus you’re plugged into?

Try sending some messages and see if they turn up in the TX packets count (as in my example). If you cansend a packet and it doesn’t turn up in the TX count, it means the packet wasn’t ACKed on the bus.

Hello @alien.technology!
Thanks for your quick response.
I confirm you that launching “ifconfig”, the output shows the UP flag and all the can0 details exactly like yours. I assure myself that plugged in correctly; Specifically, P1 is connected with Freematics Emulator OBDII and the bitrate is setup for P1 at 500000, on emulator GUI with 500Kbps/11bit. But changing different values trought Emulator GUI no messages received on can0.
Then I tried your latest suggestion sending a message trought “cansend”, sending ‘cansend can0 5A1#00.01.02.03.04’
and I see correctly the TX count incremented (see below):
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 5 (5.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 39

I checked also the termination on canbus I’m using (can0) under the board between CAN0L-CAN0H
and the resistance is 120Ohm.

1 Like

It does sound like you have everything set up right. I can’t think what you could look at next.

You say you checked the resistance, you measured the resistance across the CAN bus between CAN0L and CAN0H? It should be 60, there should be two 120 resistors at each end of the bus, two 120 ohm in parallel = 60 ohm.

Getting an ACK to the message you sent make it look like things are working.

I’m not familiar with the Freematics device. It looks like it is emulating OBD-II diagnostic messages, so I wouldn’t expect to see any output until you interact with it.

You could try sending a VIN request, which the Freematics says it supports. Log into Beagleboard twice. In one session, run candump as you have been doing. In the other, request vehicle VIN:

cansend can0 7DF#0209020000000000