pa3gsb / Radioberry-2.x

Ham Radio hat for Raspberry PI
473 stars 90 forks source link

Installing Radioberry driver... modprobe: FATAL: Module radioberry not found #36

Closed seelenreiter closed 1 year ago

seelenreiter commented 1 year ago

Hi,

i bought a Radio Berry V5.0 Board from Aliexpress. "Radio berry v5.0 software definierte Funkgeräte ad9866 10 cl016 für himbeer pi4b rpi4"

I installed a fresh Raspian OS installation (i tried both 32 and 64) I did the apt updat & upgrade and a firmware update.

now, i try to install radioberry_install.sh:

**============================================ Radioberry software installation.

You will install the following versions:

Gateware version 73.2
Driver version 0.92
Firmware version 2021.09.10

============================================

--- Installing dependency: raspberrypi-kernel-headers Reading package lists... Done Building dependency tree... Done Reading state information... Done raspberrypi-kernel-headers is already the newest version (1:1.20230405-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. --- Installing dependency: linux-headers-rpi Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package linux-headers-rpi --- Installing dependency: git Reading package lists... Done Building dependency tree... Done Reading state information... Done git is already the newest version (1:2.30.2-1+deb11u2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. --- Installing dependency: device-tree-compiler Reading package lists... Done Building dependency tree... Done Reading state information... Done device-tree-compiler is already the newest version (1.6.0-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. --- Installing dependency: pigpio Reading package lists... Done Building dependency tree... Done Reading state information... Done pigpio is already the newest version (1.79-1+rpt1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Cloning into 'Radioberry-2.x'... remote: Enumerating objects: 1021, done. remote: Counting objects: 100% (1021/1021), done. remote: Compressing objects: 100% (700/700), done. remote: Total 1021 (delta 407), reused 759 (delta 279), pack-reused 0 Receiving objects: 100% (1021/1021), 28.47 MiB | 16.79 MiB/s, done. Resolving deltas: 100% (407/407), done. Removed /etc/systemd/system/multi-user.target.wants/radioberry.service. Installing Radioberry gateware Cyclone 10 CL016...

Radioberry gateware Cyclone 10 CL016 installed. Installing Radioberry driver... modprobe: FATAL: Module radioberry not found. make[1]: /lib/modules/6.1.41-v8+/build: No such file or directory. Stop. make: [Makefile:6: radioberry.ko] Error 2 cp: cannot stat 'radioberry.ko': No such file or directory modprobe: FATAL: Module radioberry not found in directory /lib/modules/6.1.41-v8+ chmod: cannot access '/dev/radioberry': No such file or directory modinfo: ERROR: Module radioberry not found.

Radioberry driver installed. Installing Radioberry firmware... rm -f version.o gcc -g -O3 -c -o register.o register.c register.c: In function ‘process_http’: register.c:105:2: warning: implicit declaration of function ‘write’; did you mean ‘fwrite’? [-Wimplicit-function-declaration] 105 | write(sockfd, sendline, strlen(sendline)); | ^~~~~ | fwrite register.c:107:14: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration] 107 | while ((n = read(sockfd, recvline, MAXLINE)) > 0) { | ^~~~ | fread register.c: In function ‘postRadioberryConfiguration’: register.c:132:73: warning: implicit declaration of function ‘inet_ntop’ [-Wimplicit-function-declaration] 132 | if (hptr->h_addrtype == AF_INET && (pptr = hptr->h_addr_list) != NULL) inet_ntop(hptr->h_addrtype, *pptr, str, sizeof(str)); | ^~~~~ register.c:137:2: warning: implicit declaration of function ‘inet_pton’ [-Wimplicit-function-declaration] 137 | inet_pton(AF_INET, str, &servaddr.sin_addr); | ^~~~~ register.c:141:2: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration] 141 | close(sockfd); | ^~~~~ | pclose gcc -g -O3 -c -o bias.o bias.c bias.c: In function ‘init_I2C_bias’: bias.c:15:10: warning: ‘return’ with a value, in function returning void 15 | return fd_i2c_bias; | ^~~ bias.c:8:6: note: declared here 8 | void init_I2C_bias() { | ^~~~~ bias.c:17:21: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration] 17 | i2c_bias_handler = ioctl(fd_i2c_bias, I2C_SLAVE, ADDR_BIAS); | ^~~~~ bias.c: In function ‘close_I2C_bias’: bias.c:35:18: warning: comparison between pointer and integer 35 | if (fd_i2c_bias != NULL) close(fd_i2c_bias); | ^~ gcc -g -O3 -c -o measure.o measure.c measure.c: In function ‘openI2C_measure’: measure.c:30:10: warning: ‘return’ with a value, in function returning void 30 | return fd_i2c_measure; | ^~~~~~ measure.c:21:6: note: declared here 21 | void openI2C_measure() { | ^~~~~~~ measure.c:32:24: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration] 32 | i2c_measure_handler = ioctl(fd_i2c_measure, I2C_SLAVE, ADDR_MEAS); | ^~~~~ measure.c: In function ‘close_I2C_measure’: measure.c:48:21: warning: comparison between pointer and integer 48 | if (fd_i2c_measure != NULL) close(fd_i2c_measure); | ^~ gcc -g -O3 -c -o radioberry.o radioberry.c In file included from radioberry.c:56: radioberry.h:57:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 57 | mask(val) { return val & (CAPACITY - 1); } | ^~~~ radioberry.h: In function ‘mask’: radioberry.h:57:1: warning: type of ‘val’ defaults to ‘int’ [-Wimplicit-int] radioberry.h: At top level: radioberry.h:58:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 58 | push(val) { assert(!full()); spi_commands[mask(p_write++)] = val; } | ^~~~ radioberry.h: In function ‘push’: radioberry.h:58:1: warning: type of ‘val’ defaults to ‘int’ [-Wimplicit-int] In file included from radioberry.h:18, from radioberry.c:56: radioberry.h:58:22: warning: implicit declaration of function ‘full’ [-Wimplicit-function-declaration] 58 | push(val) { assert(!full()); spi_commands[mask(p_write++)] = val; } | ^~~~ In file included from radioberry.c:56: radioberry.h: At top level: radioberry.h:59:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 59 | pop() { assert(!empty()); return spi_commands[mask(p_read++)]; } | ^~~ In file included from radioberry.h:18, from radioberry.c:56: radioberry.h: In function ‘pop’: radioberry.h:59:22: warning: implicit declaration of function ‘empty’ [-Wimplicit-function-declaration] 59 | pop() { assert(!empty()); return spi_commands[mask(p_read++)]; } | ^~~~~ In file included from radioberry.c:56: radioberry.h: At top level: radioberry.h:60:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 60 | empty() { return p_read == p_write; } | ^~~~~ radioberry.h:61:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 61 | full() { return size() == CAPACITY; } | ^~~~ radioberry.h: In function ‘full’: radioberry.h:61:21: warning: implicit declaration of function ‘size’ [-Wimplicit-function-declaration] 61 | full() { return size() == CAPACITY; } | ^~~~ radioberry.h: At top level: radioberry.h:62:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 62 | size() { return p_write - p_read; } | ^~~~ In file included from radioberry.c:57: filters.h: In function ‘initFilters’: filters.h:347:21: warning: implicit declaration of function ‘ioctl’ [-Wimplicit-function-declaration] 347 | i2c_alex_handler = ioctl(fd_i2c_alex, I2C_SLAVE, ADDR_ALEX); | ^~~~~ radioberry.c: In function ‘initRadioberry’: radioberry.c:121:2: warning: implicit declaration of function ‘init_I2C_bias’; did you mean ‘write_I2C_bias’? [-Wimplicit-function-declaration] 121 | init_I2C_bias(); | ^~~~~ | write_I2C_bias radioberry.c:125:2: warning: implicit declaration of function ‘pthread_create’ [-Wimplicit-function-declaration] 125 | pthread_create(&pid1, NULL, packetreader, NULL); | ^~~~~~ radioberry.c:128:2: warning: implicit declaration of function ‘start_rb_control_thread’ [-Wimplicit-function-declaration] 128 | start_rb_control_thread(); | ^~~~~~~ radioberry.c:129:2: warning: implicit declaration of function ‘start_rb_measure_thread’ [-Wimplicit-function-declaration] 129 | start_rb_measure_thread(); | ^~~~~~~ radioberry.c:186:2: warning: implicit declaration of function ‘start_rb_register_thread’ [-Wimplicit-function-declaration] 186 | start_rb_register_thread(); | ^~~~~~~~ radioberry.c: In function ‘runRadioberry’: radioberry.c:200:2: warning: implicit declaration of function ‘start_timer_thread’ [-Wimplicit-function-declaration] 200 | start_timer_thread(); | ^~~~~~ radioberry.c: At top level: radioberry.c:485:6: warning: conflicting types for ‘start_rb_control_thread’ 485 | void start_rb_control_thread() { | ^~~~~~~ radioberry.c:128:2: note: previous implicit declaration of ‘start_rb_control_thread’ was here 128 | start_rb_control_thread(); | ^~~~~~~ radioberry.c:512:6: warning: conflicting types for ‘start_rb_measure_thread’ 512 | void start_rb_measure_thread() { | ^~~~~~~ radioberry.c:129:2: note: previous implicit declaration of ‘start_rb_measure_thread’ was here 129 | start_rb_measure_thread(); | ^~~~~~~ radioberry.c:527:6: warning: conflicting types for ‘start_rb_register_thread’ 527 | void start_rb_register_thread() { | ^~~~~~~~ radioberry.c:186:2: note: previous implicit declaration of ‘start_rb_register_thread’ was here 186 | start_rb_register_thread(); | ^~~~~~~~ radioberry.c:542:6: warning: conflicting types for ‘start_timer_thread’ 542 | void start_timer_thread() { | ^~~~~~ radioberry.c:200:2: note: previous implicit declaration of ‘start_timer_thread’ was here 200 | start_timer_thread(); | ^~~~~~ gcc -o radioberry register.o bias.o measure.o radioberry.o -lrt -lm -lpthread

Radioberry firmware installed. Installing radioberry service ... Radioberry service installed. Created symlink /etc/systemd/system/multi-user.target.wants/radioberry.service → /etc/systemd/system/radioberry.service.

============================================ Radioberry software is installed! Have fun using the SDR Radioberry

73 Johan PA3GSB ============================================**

sudo modinfo radioberry

modinfo: ERROR: Module radioberry not found.

Any hint?

LoyalServant commented 1 year ago

The simple answer is that the kernel headers are missing. I am trying to figure out how to resolve it since the package manager is brain-dead.

if you run 'uname -a' it will tell you the kernel version.

in my case....

mark@raspberrypi:/lib/modules $ uname -a Linux raspberrypi 6.1.42-v8+ #1668 SMP PREEMPT Thu Jul 27 15:34:18 BST 2023 aarch64 GNU/Linux

So, its expecting a symlink to the kernel headers for this version. This is why you get a ... make[1]: *** /lib/modules/6.1.41-v8+/build: No such file or directory. Stop.

That's because you need a symlink from [version]/build -> /usr/src/linux-headers-[version] But, it's not installed. This seems to be a chronic problem in my googling that the raspberry pi doesn't seem to keep the kernel sources in sync with what the system is running..... things get disconnected.

So........ root@raspberrypi:/# apt-get install raspberrypi-kernel-headers Reading package lists... Done Building dependency tree... Done Reading state information... Done raspberrypi-kernel-headers is already the newest version (1:1.20230405-1).

Yep. the package manager has lost the plot. (yes, I already tried numerous updates) I am going to try to wipe the card and reimage.....

n7gtb commented 1 year ago

For what it's worth, changing to 6.1.21-v7l+ worked for me and was very simple to do,

Ref: https://forums.raspberrypi.com/viewtopic.php?t=352066

LoyalServant commented 1 year ago

@n7gtb I bet that's exactly what the issue is... but I reimaged already and didn't get to try that. Thanks.

I did get it to work when I reimaged.... So, I reimaged the card using the image '2023-05-03-raspios-bullseye-arm64' downloaded from the website with the raspberry pi imager... created my user, set timezone, etc.... Then apt-get update. Then apt-get install raspberrypi-kernel-headers Verifed that the symlink from 'build' was in fact created, so the correct headers were now installed and matched uname -a. Module build proceeeded as expected...

Now, the service configuration expects a 'pi' user and group. I didn't create this as my user at setup. I simply changed the user/group in radioberry.service, reloaded systemd, and then I was able to start the service.

This shoud probably be mentioned in the wiki that the scripts expect a 'pi' user and need to be changed depending on whatever user you create. As I am not a regular pi user I am out of my element... and wonder if this is some change where this 'pi' user is no longer created....

seelenreiter commented 1 year ago

Thank you, i'll do a retry. Well, i used '2023-05-03-raspios-bullseye-arm64' and User pi...

seelenreiter commented 1 year ago

Thank you, it's working now.

It seems to be a temporary problem in 2023-05-03-raspios-bullseye-arm64. now it is fixed.