- Raspberry Pi 4 and case
- Nooelec NESDR SMArt Bundle RTL-SDR
- 32 GB microSD
- keyboard and mouse
- HDMI cable and display
- USB memory card reader
- Install the Raspberry Pi Imager and create Raspbian microSD
- Install the microSD and setup OS
- Continue configuring the OS through the Raspberry Pi Software Configuration Tool
- Run
sudo raspi-configto open the config tool
- Configure the keyboard first. A bad keyboard layout can mess up other steps.
- Select Localisation Options
- Select Change Keyboard Layout
- Select Generic 105-key PC
- If the keyboard list is showing non US layouts
- Select Other
- Select English (US)
- The layout list will reload with english layouts.
- Select English (US)
- Select The default for the keyboard layout
- Select No compose key
- Select Change User Password to change the default password
- Select Network Options to change the hostname
- Select Hostname and follow the instructions
- Select Network Options to connect to wifi
- Select Wi-fi and follow the instructions
- Select Interfacing Options to configure SSH
- Select SSH and follow the instructions
- Exit the config tool
- Run
ifconfigto make sure thatwlan0has received an IP address
- Select Change User Password to change the default password
- Select Network Options to change the hostname
- Select Hostname and follow the instructions
- Select Interfacing Options to configure SSH
- Select SSH and follow the instructions
- Exit the config tool
- Run
ifconfigto make sure thatwlan0has received an IP address
- Run
sudo apt install ufwto install Uncomplicated Firewall - Run
sudo ufw allow from 192.168.100.0/24 to any port 22substitute the IP address with the domain ranges - Run
sudo ufw default deny incoming && sudo ufw default allow outgoingto configure default rules - Run
sudo ufw enableto enable the firewall - Run
sudo systemctl enable ufwto start the service on boot
- Run
sudo apt install rtl-sdrto install RTL-SDR libraries - Run
sudo apt install soxto install SoX which will stream audio
This command will stream audio through the hdmi port
sudo rtl_fm -g 50 -f 89.5M -M wbfm -s 256k | play -r 32k -es -t raw -b 16 -c 1 -| omxplayer -o hdmi -p
Install PIP for package management
sudo apt install python3-pip
Don't install through pip, instead install pipenv which can be used to generate an environment for the project much like npm.
pip3 install pipenv
pipenv install pyrtlsdr
install the python rtlsdr wrapper. this wraps the librtlsdr
pip3 install pyrtlsdr
- https://mode-s.org/decode/
- https://www.allaboutcircuits.com/projects/track-overhead-flights-raspberry-pi-zero-w-software-defined-radio/
- https://pypi.org/project/pyrtlsdr/
- https://inst.eecs.berkeley.edu/~ee123/sp16/labs.html
- https://wiki.gnuradio.org/index.php/Guided_Tutorial_GNU_Radio_in_Python
- https://github.com/itdaniher/rtlsdr-rds-demod
Streaming links
- https://pypi.org/project/pyrtlsdr/
- https://docs.python.org/3/library/asyncio.html
- https://pyrtlsdr.readthedocs.io/en/latest/Overview.html
- https://pyrtlsdr.readthedocs.io/en/latest/rtlsdraio.html
- https://realpython.com/async-io-python/
Kubernetes
- https://microk8s.io/#get-started
- https://github.com/obsidiandynamics/kafdrop
- https://github.com/kubernetes/dashboard
- https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux
Using k3s
- https://github.com/teamserverless/k8s-on-raspbian/blob/master/GUIDE.md
- https://medium.com/parkbee/life-on-the-edge-a-first-look-at-ranchers-lightweight-kubernetes-distro-k3s-15a3aab1f0fb
show the nodes
sudo k3s kubectl get node
taint the master node
sudo k3s kubectl taint nodes brian-zenbook key=value:NoSchedule
remove swap to increase k8s performance
sudo dphys-swapfile swapoff && \
sudo dphys-swapfile uninstall && \
sudo update-rc.d dphys-swapfile remove
sudo systemctl disable dphys-swapfile
add a role to the new node
sudo k3s kubectl label node raspberrypi node-role.kubernetes.io/node=""
delete a label
sudo k3s kubectl label node raspberrypi node-role.kubernetes.io/node-
show node labels
sudo k3s kubectl get nodes --show-labels
use nginx-test.yml
deploy pod
sudo k3s kubectl apply -f nginx-test.yml
delete pod
sudo k3s kubectl delete -f nginx-test.yml
get all pods on all nodes
kubectl get pod -o=custom-columns=NODE:.spec.nodeName,NAME:.metadata.name --all-namespaces
Add the current user to the docker group to avoid needing sudo to run the docker command:
sudo usermod -aG docker $USER
relogin into user for group to take affect or su - $USER
The problem with building images is that the Pi is ARMv7 (armhf) so we need to enable the experimental buildx for docker to build multi architecture containers
https://github.com/docker/buildx
export DOCKER_CLI_EXPERIMENTAL=enabled export DOCKER_BUILDKIT=1 docker build --platform=local -o . git://github.com/docker/buildx mkdir -p ~/.docker/cli-plugins mv buildx ~/.docker/cli-plugins/docker-buildx
docker --help should confirm the new buildx command
grab the latest QEMU (amd64 version) https://hub.docker.com/r/docker/binfmt/tags
docker pull docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64-amd64
this doesnt last a reboot?
docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64-amd64
check QEMU
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
http://www.guoyiang.com/2016/11/04/Build-My-Own-Raspbian-Docker-Image/
losetup -f will find the next unused loop device location
sudo losetup -Pr `losetup -f` <file>
losetup --list to list all devices
This will create a tar that doesn't have a '.' directory in the beginning.
sudo find /mnt/rpi/ -printf "%P\n" | sudo tar -C /mnt/rpi -czpf ~/Downloads/2020-02-13-raspbian-buster-lite.tar.gz --numeric-owner --no-recursion -T -
useful links
- https://gqrx.dk/doc/practical-tricks-and-tips
- https://payatu.com/getting-started-radio-hacking-part-2-listening-fm-using-rtl-sdr-gqrx
- https://www.nooelec.com/store/downloads/dl/file/id/72/product/0/nesdr_installation_manual_for_ubuntu.pdf
Install docker https://linuxconfig.org/how-to-install-docker-on-ubuntu-20-04-lts-focal-fossa