开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Raspberry Pi in sBITX V2


 

Ok, after a couple of hours of hacking, I was able to build the current software in 64-bit mode on Debian 11 also known as Bullseye with the new OS booted from the external USB SATA drive and the original sbitx sdcard inserted so I could copy stuff over like the sbitx data directory. Below are my cryptic notes, largely based on the ~/sbitx/install.txt file but also from various forum posts here and elsewhere. Let me know if I can clarify anything. As far as I can tell, everything is now working. Thanks to Rafael for the WiringPi repo!

# note: assumes running off external usb drive with sbitx sdcard inserted too
# build WiringPi from https://github.com/Rhizomatica/WiringPi
mkdir -p ~code/hamradio/
cd ~code/hamradio/
git clone https://github.com/Rhizomatica/WiringPi
cd WiringPi
./build |& tee build.log
sudo ldconfig
# get sbitx original code base
cd $HOME
# get afarhan sbitx source code repo
git clone https://github.com/afarhan/sbitx
# copy over my sbitx data from sdcard first, before I forget..
cd sbitx
mv data data.orig
cp -rp /media/*/rootfs/home/pi/sbitx/data .
# make symlinks from ~pi to my homedir
sudo mkdir /home/pi
sudo ln -s $HOME/sbitx  /home/pi/sbitx
# set up application settings
sudo ln -s $HOME/.local /home/pi/.local
cp /media/*/rootfs/home/pi/.local/share/applications/al* ~/.local/share/applications
# install required libraries
sudo apt-get install -y ncurses-dev libasound2-dev libgtk-3-dev libgtk+-3-dev
# fetch fftw tarball
cd /tmp
wget http://fftw.org/fftw-3.3.10.tar.gz
cd ~/code/sdr
tar xvf /tmp/fftw-3.3.10.tar.gz 
# make fftw in double precision
./configure
make |& tee make.log
sudo make install |& tee make-install.log
# make fftw in single precision
./configure --enable-float
make |& tee make-single.log
sudo make install |& tee make-install-single.log
# disable pulseaudio so that we run directly to alsa
sudo vi /etc/pulse/client.conf 
# add the line:
autospawn = no
#### sound card setup using alsa loopback driver
# we use snd-aloop to add three loopback 'virtual sound cards' to the system.
# enable=1,1,1 enables all the three and these three cards are numbered 1,2,3.
# card 0 is the physical audio device (speaker out, mic in).
# linux sound card naming is like "hw:1,0", where the first of the two
# digits represents the card number and the second digit is called a 'device'.
# when using the alsa loopback device, what you play to "hw:1,0" will be 
# avaiable to be recorded at "hw::1,1"
# sbitx plays audio to the speaker (hw:0,0) and to the input of the loopback
# device(s) (e.g. hw:1,0), whereas apps such as wsjtx sets its capture device
# to hw:1,1 to receive the wsjtx audio.
# wsjtx plays its modulated output to hw:2,0 and sbitx listens to hw:2,1
# The sbitx will not work if the loopback is not present. 
# You need to automatically run snd-aloop upon booting up by adding this line 
# to /etc/rc.local:
sudo modprobe snd-aloop enable=1,1,1 index=1,2,3 
#### ENABLING features in config.txt
# add these lines to the very end of /boot/config.txt for hardware setup:
# define gpio usage for sbitx radio 
gpio=4,17,27,22,10,9,11,5,6,13,26,16,12,7,8,25,24=ip,pu
gpio=24,23=op,pu
# disable under-voltage warning
avoid_warnings=1
# add wm8731 audio codec support
dtoverlay=audioinjector-wm8731-audio
#### DISABLING features in config.txt
# disable the built-in snd_bcm2835 audio "headphones" system by locating the 
# "dtparam=audio=on" line and add a "#" character before it to disable it
dtparam=audio=on  # comment this out!
# disable vc4-hdmi audio by locating the line that says "dtoverlay=vc4-kms-v3d"
# and adding ",noaudio" to the end
dtoverlay=vc4-kms-v3d,noaudio
#### Reboot to see config changes, in particular for sound cards:
$ cat /proc/asound/cards
 0 [audioinjectorpi]: audioinjector-p - audioinjector-pi-soundcard
                      audioinjector-pi-soundcard
 1 [Loopback       ]: Loopback - Loopback
                      Loopback 1
 2 [Loopback_1     ]: Loopback - Loopback
                      Loopback 2
 3 [Loopback_2     ]: Loopback - Loopback
                      Loopback 3
#### Supress low voltage warnings 
# remove the battery warning app
sudo apt remove lxplug-ptbatt
#### Install ntp and ntpstat
# ntp and ntpstat are useful to know if the radio is synched to realtime.
# this is important when the date/time in the logbook needs to be accruate.
# it is also useful for ft8 synchronization
sudo apt install -y ntp ntpstat
#### Redirect port 80 to port 8080 to connect to sbitx html page
# the webserver of sbitx runs on port 8080 this has
# to redirect to port 80. To do this...
sudo apt install -y iptables --fix-missing
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
# then install iptables-persistent so it saves the current iptables
sudo apt install -y iptables iptables-persistent --fix-missing
#### Make your sbitx appear as sbitx.local on the local network
Menu -> Preferences -> Raspberry Pi Coniguration -> System -> Hostname -> sbitx
#### If no logbook database already, create a fresh one in the data subdirectory
sudo apt update
sudo apt install -y sqlite3 libsqlite3-dev
cd data 
sqlite3 < create_db.sql
#### To make desktop short-cuts work w/ touch screen, open files w/ single click
Menu -> Accessories -> File Manager -> Edit -> Preferences -> General:
Check the "Open files with single click" tick box
### Make the ft8_lib software needed by sbitx
cd ~/sbitx/ft8_lib
make |& tee make.log
sudo make install |& tee make-install.log
### Make the sbitx software
cd ~/sbitx
bash -ex ./build sbitx
### Get the desktop short-cut from the sdcard and put it on the desktop
cp /media/*/rootfs/home/pi/Desktop/sBitx.desktop ~/Desktop
### Open desktop links without asking questions
Menu -> Accessories -> File Manager -> Edit -> Preferences -> General:
Check the "Don't ask options on launch executable file" box
# disable screen blanking
Menu -> Preferences -> Raspberry Pi Configuration Display 
Click 'disable' on Screen Blanking (or slide switch to 'off' position)
Click “OK” to apply the changes.
# reboot and everything should look pretty
sudo reboot

-- Regards, Dave, N1AI

Join [email protected] to automatically receive all group messages.