Strangest issue you will ever see (I swear)

This has me completely stumped.

Basically, I have a fully functioning family of RPI5 dashes with heavily modified kernels and OS to boot quickly and run smoothly. However I was doing another dash recently and noticed some comms issues with the waveshare HAT I use.

I spent days and days diagnosing only to figure out that the CANBUS drops out/fails when loading a specific dash/theme. What could cause this? With the default dash I can “sudo ip link set can0 down” and back up just fine, but when I load this specific theme, the terminal hangs on up and only a hard reset can restore the terminal.

Okay, so if I switch to a known working dash like Super Lightweight - boot it up, and then switch back to the broken one - my template works for 3 seconds or so and then I get “Connecting… can0” in the bottom corner and it drops out. Only setting it back and then a hard reset fixes it.

Well that was a rollercoaster of emotions, turns out its an issue with GPIO.

I have GPIO40 being used to switch pages as a physical button on the dash. Removing this trigger fixes the issue. Is it even possible to use a CAN HAT and GPIO pins as inputs simultaneously?

Another update for anyone looking to do the same. It can’t be done AFAIK.

I just made simulated CAN data via GPIO with a fairly simple python scripts and match up some some arbritrary addresses in the XML

I think currently the gpiod library ‘steals’ all GPIO pins to its usage, so I’m afraid no.

Okay, another random issue which I have always had with Link G4+

CANBUS connects and seems ti be correct however the multipliers and data is slightly incorrect

For example TPS does move the TPS however a slight touch of the throttle goes to 100% instantly. I’m guessing it’s a simple fix but no can stream works correctly. I was going to send in Haltech stream but Link doesn’t have an LCS file for that

Not sure if this is the cause but I noticed the premade XML looks for big endian data. however in link ECU all the default streams use “LS FIRST UNSIGNED” format.

So if the ECU sends 0A 00 the dash would read it as 2560 instead of 1%(10).

Has anybody used Link ECU over CAN instead of USB?

Yes - have a look at the thread here @foes :
https://forums.linkecu.com/topic/8637-introducing-realdash-a-dashboard-app-for-android-windows/

There are about 15 pages discussing Link > RealDash CAN connections over USB and Bluetooth - have a look at the last 4-5 pages especially.

Keep in mind, some of the parameter scaling within the CANBus streams changed between Link G4+ and Link G4X - so a RealDash XML file suitable for Link G4+ won’t work 100% the same way with a Link G4X - some parameters “offset” and “multiplier” values within the Link CANBus stream may need slight tweaks if you are using a Link G4X, with a RealDash CAN XML based from a G4+