Installing drivers on patchbox (CANbus, etc), possible?

I’m attempting to install drivers for the kvaser leaf light v2 canbus data cable, as part of an automotive project, using puredata as a sound generator with canbus data signals as input

I’m following these instructions
but i suspect it’s having a hard time with the real time kernel patchbox uses, doesn’t have a makefile target

just wondering if this is normal, or if i’m missing something specific about installing things on patchbox

Hi, what is the exact error you’re getting? Try installing raspberrypi-kernel-headers-rt package.

the first error i encounter is from running make , and since i dont have an scp setup yet, here’s a phone pic

this is after running sudo apt-get install raspberrypi-kernel-headers-rt by the way. No rule to make target modules is curious because it implies the installer is missing something

It does build fine for me, though I’ve tested on a different kernel version than you’re using, but I’ve targeted the header version you’re using using KDIR. Try calling make like this:

KDIR=/usr/src/linux-headers-5.15.36-rt41-v7l+/ make 

Also, what output do you get from this command:

file /lib/modules/5.15.36-rt41-v7l+/build

yup that did it, or at least the make step

although the output of that file command shows nothing, i remember using touch to create the build directory when it was complaining about its absence but i think i did a full folder reset since then? either way its empty

Screenshot from 2022-08-28 20-52-14

edit: rest of the install process went fine, i think everything is good, time to test with my car vcu

1 Like

Ah, so creating an empty build directory was wrong - installing the correct headers package is responsible of dealing with it, it’s actually supposed to be a symbolic link to the location where the appropriate source code (or just headers and makefiles) are located for that kernel version. It being manually created may have prevented the headers package installer of setting it up correctly. To fix it up, try removing the build directory by hand and reinstall the headers package by running this command:

sudo apt install --reinstall raspberrypi-kernel-headers-rt