HackRF in LXC container
The key requirement is to run a few commands on the host after plugging it in.
mkdir -p /var/lib/lxc/grid22/rootfs/root/bus/usb
umount /var/lib/lxc/grid22/rootfs/root/bus/usb
mount -o bind /dev/bus/usb /var/lib/lxc/grid22/rootfs/root/bus/usb
This has to be done every time the gadget is unplugged. There might be a way to automate it by polling /dev/bus on the host or editing a udev script.
On the container, you have to run
ln -s /root/bus /dev/bus
This stays around when the gadget is unplugged.
The container configuration file /var/lib/lxc/grid22/config might require an extra line
lxc.cgroup.devices.allow = c 189:* rwm
The X server as always requires
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir,ro
mkdir -p /var/lib/lxc/grid22/rootfs/tmp/.X11-unix
The mane problem is the container's /dev/ directory is a virtual filesystem not part of /var/lib/lxc/grid22/rootfs/. Anything in /dev/ has to be created after starting the container. The only way for the container to see anything in the host /dev is to mount it in the visible part of /rootfs & make a symbolic link in the container /dev
Hackrf/libusb in particular needs to see /dev/bus/usb in the /dev/ directory
The easiest spectrum analyzer to get working was
https://github.com/pavsa/hackrf-spectrum-analyzer/releases
You have to download the .zip file. That works for Linux.
apt install openjdk-11-jre
apt install hackrf
Then run hackrf_sweep_spectrum_analyzer_linux.sh
Fully utilizing the hackrf for transmitting, demodulating, hearing audio, capturing digital TV would require a full gnuradio installation.
Spent a while trying to get the spectrum analyzer to work in obsolete ubunt 16 but it seems everything is going to require a container now, with the rapid evolution of the C library, no convenient way to keep Ubunt up to date, & no way to have simultaneous versions of the C library.
Some captures of the lion kingdom's truck & camera controllers showed their packetized FSK emissions & hardly any harmonics. The receiver antenna was 915Mhz though.
qspectrumanalyzer ran into a lot of python dependencies. It made lions wonder how hard a minimal spectrum analyzer would be. The mane limitation is no way to control the waterfall time scale.


Comments
Post a Comment