LoRa
LoRa copied to clipboard
make file not working
make make -C /lib/modules/5.4.51-v7l+/build M=/home/pi/sahilsoni/lora/LoRa/LoRa modules make[1]: *** /lib/modules/5.4.51-v7l+/build: No such file or directory. Stop. make: *** [Makefile:8: all] Error 2
I'm assuming this is from a build on a raspberry pi? Do you have the correct kernel headers installed?
- Reboot to ensure the current kernel is the installed kernel
systemctl reboot
- If you might upgrade in the future/aren't trying to stick to a specific kernel version, upgrade to the latest kernel and reboot (we want to obtain the correct kernel headers and build against your installed kernel)
sudo apt update && sudo apt upgrade
systemctl reboot
Obtain RPi Kernel Source
Install RPi-Source utility program to get the kernel source
# Dependencies
sudo apt install git bc bison flex libssl-dev
sudo apt install libncurses5-dev
# Download and install
sudo wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
Obtain the Kernel:
mkdir -p ~/RPiKernel
rpi-source -d ~/RPiKernel