¿ªÔÆÌåÓý

Airband-Direwolf-APRS configuration


 

As requested.
?
I've been running RTLSDR_Airband from the day I found out about it. I was trying to write code for a multi-channel FM receiver and it was proving quite difficult, and I dropped the effort once I found out about it. It uses a very efficient algorithm mix and filter multiple frequencies to baseband RF, where AM and FM demodulation can be applied. FM demodulation is very efficient as well. On my Raspberry Pi I'm running 10 channels at present, with 4 recording audio from repeater outputs, 4 recording baseband RF from repeater inputs, and 2 FM audio channels piped into Direwolf. This consumes about 10% of one of the 4 processor cores on a Raspberry Pi 4. It is supposed to work on a Raspberry Pi 2 and Pi 3, using the on-board GPU to accelerate computation, but I've never tried it. It is also quite reliable, and I've had it running over a month at a time on the Pi.
?
The reason I was doing this was to hunt a repeater jammer in the area, and APRS was an afterthought. The jammer is now gone but new ones come from time to time so I record 4 repeaters 24 hours/day. The audio recordings are used for evidence, and the IQ recordings for analysis, especially experimentally with transmitter profiling. Experience using Direwolf made it obvious it would be a good fit - and it almost was. I now have about 40 GB of recordings. I also encouraged some fellow club members to run similar setups and devised a method by which they could upload their recordings to my system, making them all available for review or analysis. It still has some rough edges but basically works. The most difficult thing is managing security. I called the system Dragnet, which if you look at the files you'll see this as the user account for the programs.
?
The biggest issue I had, which I was dealing with today, was that Airband emits 32-bit floating point samples and Direwolf wants 8 bit unsigned or 16 bit signed integers. There are programs that would do the conversion but they are rather complex, so I decided to write one for the purpose to act as an intermediary between Airband and Direwolf. Initially I tried reading from Airband using an Internet socket, and writing to a socket for Direwolf to read but I ran into difficulties and just wrote the output to stdout and piped it into Direwolf. That worked well for APRS traffic on 144.390 and a couple of weeks ago I added the ISS APRS RS0ISS as a second channel. Yesterday I checked the logs and found that I was receiving the ISS about once per day with several transmissions during the pass and was pleased.
?
I started thinking that because I had two instances of Direwolf I would have 2 igate connections and thought that wasteful, so I decided to pursue the socket to socket sample format conversion again. This time I used Microsoft Copilot which sped things up a lot. The last thing I asked Copilot to do was add GPL V3 terms and conditions to make the code open source. After much back and forth I now have a version which will forward samples to another socket or to stdin based on the command line options. I wrote simple system services for airband, the two instances of the format converter (Terrestrial and ISS APRS) and one instance of Direwolf. It's all running nicely as I write.
?
The main components are
  • Configuration files for airband and Direwolf
  • Systemctl .service files for the 4 system services.
  • The sample converter code, which I called f32_i16.c due to lack of imagination (maybe I should call it AirWolf)
I'm happy to share all of it and will post some stuff in the replies. Use at your own risk of course.


 

¿ªÔÆÌåÓý


Awesome post Chris!? Please do post your configs or if you're willing, do a full write up and I'll try to implement, critique, etc. as I'm sure many of the the smart people on the list will also appreciate. I'm sure this will be a hugely popular solution for those who can grok the complexities (this won't be easy).

--David
KI6ZHD


On 02/09/2025 06:22 PM, Chris VE3NRT wrote:

As requested.
?
I've been running RTLSDR_Airband from the day I found out about it. I was trying to write code for a multi-channel FM receiver and it was proving quite difficult, and I dropped the effort once I found out about it. It uses a very efficient algorithm mix and filter multiple frequencies to baseband RF, where AM and FM demodulation can be applied. FM demodulation is very efficient as well. On my Raspberry Pi I'm running 10 channels at present, with 4 recording audio from repeater outputs, 4 recording baseband RF from repeater inputs, and 2 FM audio channels piped into Direwolf. This consumes about 10% of one of the 4 processor cores on a Raspberry Pi 4. It is supposed to work on a Raspberry Pi 2 and Pi 3, using the on-board GPU to accelerate computation, but I've never tried it. It is also quite reliable, and I've had it running over a month at a time on the Pi.
?
The reason I was doing this was to hunt a repeater jammer in the area, and APRS was an afterthought. The jammer is now gone but new ones come from time to time so I record 4 repeaters 24 hours/day. The audio recordings are used for evidence, and the IQ recordings for analysis, especially experimentally with transmitter profiling. Experience using Direwolf made it obvious it would be a good fit - and it almost was. I now have about 40 GB of recordings. I also encouraged some fellow club members to run similar setups and devised a method by which they could upload their recordings to my system, making them all available for review or analysis. It still has some rough edges but basically works. The most difficult thing is managing security. I called the system Dragnet, which if you look at the files you'll see this as the user account for the programs.
?
The biggest issue I had, which I was dealing with today, was that Airband emits 32-bit floating point samples and Direwolf wants 8 bit unsigned or 16 bit signed integers. There are programs that would do the conversion but they are rather complex, so I decided to write one for the purpose to act as an intermediary between Airband and Direwolf. Initially I tried reading from Airband using an Internet socket, and writing to a socket for Direwolf to read but I ran into difficulties and just wrote the output to stdout and piped it into Direwolf. That worked well for APRS traffic on 144.390 and a couple of weeks ago I added the ISS APRS RS0ISS as a second channel. Yesterday I checked the logs and found that I was receiving the ISS about once per day with several transmissions during the pass and was pleased.
?
I started thinking that because I had two instances of Direwolf I would have 2 igate connections and thought that wasteful, so I decided to pursue the socket to socket sample format conversion again. This time I used Microsoft Copilot which sped things up a lot. The last thing I asked Copilot to do was add GPL V3 terms and conditions to make the code open source. After much back and forth I now have a version which will forward samples to another socket or to stdin based on the command line options. I wrote simple system services for airband, the two instances of the format converter (Terrestrial and ISS APRS) and one instance of Direwolf. It's all running nicely as I write.
?
The main components are
  • Configuration files for airband and Direwolf
  • Systemctl .service files for the 4 system services.
  • The sample converter code, which I called f32_i16.c due to lack of imagination (maybe I should call it AirWolf)
I'm happy to share all of it and will post some stuff in the replies. Use at your own risk of course.


 

I'll briefly outline the steps as I remember them. I'd like to do a full write-up sometime, maybe for an article for the Canadian magazine.
?
Running a Pi 24x7 can be tricky. The first thing to worry about is the lifetime of the micro-SD card. They have a limited number of write operations so (a) bigger is better as the write operations are spread out over the available space - I have one with 128gb micro-SD and it has been running over a year, and/or, (b) You can set up an external boot device from a USB (preferably USB3) port. I use a USB3 to M.2/NVMe adapter with a low-cost 128 GB M.2/NVMe card. These devices have longer lasting SSD technology than the micro-SD. On the Raspberry Pi OS web site there are instructions on how to set up the Pi for USB boot instead of micro-SD boot. They provide a system image to load onto a micro-SD that you boot once to change it over to the USB. However, for experimentation the micro-SD is? fine.
?
The other one is power. USB devices can use a lot, and my Airband Pi has an RTL-SDR, the aforementioned SSD storage, a serial port (for receiving NMEA from a GPS receiver) and an external HDD (for the audio recordings), a keyboard and a mouse. The Pi is not capable of powering all of these so I use an external powered USB3 hub. You may not need this with a small number of devices but beware. You will see "Undervoltage" messages on the system console and in the logs (follow with "journalctl -f") if this is happening and it can have indeterminate results like devices going off-line, the dreaded "read-only file system" message, etc.
?
Brief outline of steps.
?
  1. Download and install the Raspberry Pi image on a microSD (or NVMe).
  2. Install the packages: $ sudo apt install rtl-sdr build-essential git?
  3. Install direwolf. You can install this as a package using apt install although I installed mine from source. The package version is 1.6, the latest stable is 1.7, and the current dev version is 1.8D. I've been running the dev version and also 1.7 successfully, but haven't tried 1.6. I'm reasonably certain it will work though. Installing from source will require a bunch of prerequisites that are mentioned in the README.md file. To get the Direwolf distribution, use "$ git clone https://github.com/wb2osz/direwolf.git". The README says to then use "$ git checkout dev", which I recommend against unless you want to be at the hairy edge of development.
  4. Install airband. Again use git. "$ git clone https://github.com/charlie-foxtrot/RTLSDR-Airband.git". Descend into the directory and install.
  5. Create a non-privileged user account. You can see in my examples I use ve3nrt for RTLSDR_Airband and dragnet for Direwolf. There's no particular reason to copy that. One is fine. I have separate accounts because of the system I have for collecting recordings from other receivers. That account should be a member of the "plugdev" group, which gives it the privilege of access the the RTL-SDR device without having to be root. Let's say the account name is "airband". The command "$ usermod -a -G plugdev airband" will add the plugdev group to the airband account.
  6. Use the configuration files, modified for your circumstances, that I've already posted. I put the conf files in /usr/local/etc. The .service files go in /etc/systemd/system/
  7. Create an airband directory in /var/log which is owned by the account you are using (e.g. $ mkdir /var/log/airband followed by $ chown airband:airband /var/log/airband)
  8. Run "$ sudo systemctl daemon-reload"
  9. Run "$ sudo systemctl? enable --now aprs" to start the aprs service, and the same command for the two f32_i16 services (I called them f32_i16_7355_7455 and f32_i16_7356_7456), and for the airband service.
  10. Use "$ systemctl status aprs" (and again for the other services) to check that each job is running )
Ask questions here or directly. There are sure to be things missing from the above.