P1 software support

Well I bought a P1 and going to start tinkering around with it. Does anyone have one of these devices yet?

I want to get to know this device before my current school term finishes so I can try and be up to speed on it. Currently this device should work with the canbus ports as is if I understand correctly with just about any linux based CANBUS tool.

My initial intent is to fork the SocketCAN system module and add support for the other protocols and likely call it something different such as SocketOBD. Will also require the updating of some software to support the additional functionality. My intent is that this new module will be able to replace the current SocketCAN interface but will be backwards compatible with it.

For those not familiar with the P1, it basically is a new Processor board that can be used with the protocol board that the M2 uses. It consists of an adapter board that allows a PocketBeagle to be connected to the protocol board. This adapter board also has a USB port to allow a WiFi module to be included. So as it sits, the P1 is a linux based unit that is slightly thicker than the original M2 but barely.

At this stage I will be just getting the source tree up and running so I can make my own OS card from scratch. Then start looking at the SocketCAN software and how it is setup.

Rodney

I have a P1 and i am really satisfied with it. It came with Ubuntu preinstalled, and because i was lazy i havent modified it much. The CAN-Interfaces work out of the box, however one of the LINs need some hardware mod. All in all i am satisfied, its a great tool for figuring out how your car work.

What you propose sounds pretty cool, so will be watching your progress. To answer your question, I do have one and currently working out the best way to get it to work on my Mercedes CL600.

Currently trying to figure out how to program the thing… I have some bigger SD cards coming so I can put the source code right on the P1. Probably will be the easiest way to go about it.

Still learning how to do things with this unit. It is not connecting via WiFi to my router, well I should say it connects but seems to stutter when I actually try to transfer anything over it and fails after about 10 seconds.

At this time I will be pulling the code to look at how it does the Socketcan stuff and go from there… I expect to do the following:
First get the “new” protocol up and running. This I will call SocketOBD and it will be expanded to support more than just CANBUS. But will be totally backward compatible with SocketCan and will support SocketCan as a fall back. The first protocol will be Canbus… Then J1850VPW… From there I will work on J1850PWM and the LIN protocols.

Second is converting the current SocketCAN Daemon that allows socketcan packets to be sent over the network to be converted to work with this new protocol.

Next I MAY try to see if I can get the external UART to work as a USB connection and use that to provide ELM 327 support as well as configure it to work with any other protocol as necessary. (This will duplicate my planned M2 framework.) Assuming the external UART is still there on the P1. This will provide a hook to allow it to work as any supported interface with the potential to be faster than anything currently out there that I am aware of as well as support onboard logging etc.

Lastly I will try to begin reworking some of the utilities that are out there to work with this configuration. Such as the cantool package and others…

I will have to do some research on some of the stuff because I know ELM devices now can broadcast over wifi so I MAY try to get that to work with the expanded socketcan daemon as well. We shall see… I don’t plan on making any major strides with this until summer but I will start tinkering with it and try to understand how the canbus stuff works now.

Rodney

I’d say the sluggishness sounds like a kernel issue or resource one, have you dug into dmesg and the likes?

No I have not… I have since set it up to connect to the internet through my PC to USB connection so I could do updates. I have new cables but haven’t had a chance to plug them in and see if it works right yet.

Rodney

You mention wifi issues - since it’s using a USB-WLAN adapter - which one are you using?
I’ve found that some USB wifi adapters perform absolutely horrendously under Linux. Others work spectacularly well. (Sadly, many of those are discontinued… Ralink getting bought out by MediaTek was a huge blow to Linux wifi.

Ralink WLAN chipsets = awesome under Linux
MediaTek products = universally garbage under Linux, including all post-purchase “Ralink” designs

I haven’t had the chance to test this out yet. The dongle came with the board so I assume it should work. I am having trouble on my final exam. Once I finish that I will be looking at this more.

Rodney

So my P1 finally came in. The included wifi dongle seems to perform OK. Not great, not horrible, about expected for a 2.4-only microdongle.

Not a fan of https://docs.macchina.cc/p1-docs/getting-started - especially the part about “Step 4 section is in flux, best do this instead”.

Ignore that. Follow the “in flux” step 4 instructions. They will work, the “alternative” instructions are a PITA. Also, if you want SWCAN working, you REALLY REALLY want to go the Step 4 route, and additionally add the PB-MCP2515-SPI1.dtbo overlay

After that lighting up all three CAN interfaces was easy, although I needed to write a small Python script to put the SWCAN PHY into Normal mode. You need to set P2_6 and P2_18 as GPIO outputs and set them to high.