kopia lustrzana https://github.com/pa3gsb/Radioberry-2.x
update for image
rodzic
9f249a6581
commit
fec88bfc77
|
@ -7,8 +7,9 @@ radioberry.ko:
|
|||
|
||||
clean:
|
||||
@$(MAKE) -C $(KERNEL_HEADERS) M=$(PWD) clean
|
||||
|
||||
|
||||
install: radioberry.ko
|
||||
cp radioberry_ioctl.h /usr/local/include
|
||||
sudo insmod radioberry.ko
|
||||
sudo chmod 666 /dev/radioberry
|
||||
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
## Radioberry Device Driver
|
||||
|
||||
|
||||
This device driver is special made for the RPI-4.
|
||||
This device driver is a special for the RPI-4.
|
||||
|
||||
Iam a newbie in the world of device drivers, but as so much in making the radioberry, do and learn!
|
||||
|
||||
I have learned in the last hours that making a device driver on your local rpi is something
|
||||
I have learned that making a device driver on your local rpi is something
|
||||
different than deploying on the different rpi's running different kernel versions.
|
||||
|
||||
|
||||
This means, for now, that you need to build the driver yourself. Which is not that complex.
|
||||
|
||||
I will look to get the driver in the raspberrypi-kernel, also a new adventure for me!
|
||||
|
||||
|
||||
Build step:
|
||||
|
||||
|
@ -79,6 +74,21 @@ Step -5-
|
|||
|
||||
Optional step.
|
||||
|
||||
Execute: dtc -@ -I dts -O dtb -o radioberry.dtbo radioberry.dts
|
||||
|
||||
This results in an overlay fiel radioberry.dtbo
|
||||
|
||||
cp this radioberry.dtbo into /boot/overlays
|
||||
|
||||
add the following line in config.txt:
|
||||
|
||||
dtoverlay=radioberry
|
||||
|
||||
This loads the kernel module during boot.
|
||||
|
||||
|
||||
Alternative step:
|
||||
|
||||
If you like to load the device driver during boot, execute the following:
|
||||
|
||||
/etc/modules-load.d/modules.conf
|
||||
|
@ -103,8 +113,6 @@ radioberry
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
Step -6-
|
||||
|
||||
Optional step.
|
||||
|
@ -115,7 +123,6 @@ Makes it possible to run the radioberry firmware version for the device driver,
|
|||
|
||||
|
||||
|
||||
|
||||
Step -7-
|
||||
|
||||
Run using the command ./radioberry firmware or sudo ./radioberry
|
|
@ -34,4 +34,7 @@ $(PROGRAM): $(OBJS)
|
|||
clean:
|
||||
-rm -f *.o
|
||||
-rm -f $(PROGRAM)
|
||||
|
||||
install: $(PROGRAM)
|
||||
cp $(PROGRAM) /usr/local/bin
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
## Running Radioberry
|
||||
|
||||
The radioberry-SDR image is setup using a service in combination with a daemon process.
|
||||
|
||||
The service is installed in /etc/systemd/systemd/radioberry.service
|
||||
|
||||
The daemon is place in /etc/init.d/radioberryd
|
||||
|
||||
|
||||
Now you have control to the radioberry by using systemctl functions.
|
||||
|
||||
sudo systemctl enable radioberry
|
||||
sudo systemctl disable radioberry
|
||||
sudo systemctl start radioberry
|
||||
sudo systemctl stop radioberry
|
||||
sudo systemctl restart radioberry
|
||||
sudo systemctl status radioberry
|
||||
|
||||
|
||||
Using:
|
||||
|
||||
sudo journalctl -u radioberry
|
||||
|
||||
gives you logging information.
|
||||
|
||||
|
||||
Like to know the process id of the daemon: sudo /bin/pidof radioberry
|
||||
gives you the process id.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=Radioberry SDR
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=pi
|
||||
Group=pi
|
||||
ExecStart=/etc/init.d/radioberryd start
|
||||
ExecStop=/etc/init.d/radioberryd stop
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
|
||||
RADIOBERRYD=radioberry
|
||||
RADIOBERRYD_EXEC=/usr/local/bin/$RADIOBERRYD
|
||||
|
||||
case "$1" in
|
||||
|
||||
start)
|
||||
echo -n "Start radioberry firmware daemon: "
|
||||
sudo chmod 666 /dev/radioberry
|
||||
start-stop-daemon --start --background --exec $RADIOBERRYD_EXEC
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL TO START"
|
||||
fi
|
||||
date
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Stopping radioberry daemon: "
|
||||
start-stop-daemon --stop --exec $RADIOBERRYD
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL TO STOP"
|
||||
fi
|
||||
;;
|
||||
|
||||
status)
|
||||
if [ -n "`/bin/pidof $RADIOBERRYD`" ] ; then
|
||||
echo "radioberry daemon is running."
|
||||
else
|
||||
echo "radioberry daemon is not running."
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop && sleep 1 && $0 start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: /etc/init.d/radioberryd {start|stop|status|restart}"
|
||||
exit 1
|
||||
|
||||
esac
|
Ładowanie…
Reference in New Issue