As you might have read earlier in this blog, I put up a VARA FM / packet VHF dual-mode Winlink Gateway AD6DM-10 at the tail end of 2021. This system is still going, through both a Windows Update-induced tiny PC death, and more recently, a bloated aging laptop battery. It runs on Windows 10, and is currently on an Evolve III “jankapotamus” laptop. Moreover, I managed to fry my Windows 10 ruggedized tablet that I got from Huntsville Hamfest last year. (I thought I was trying a safe voltage while testing a barrel plug, but after 2 seconds I heard a pop and then saw the magic smoke.)
Anyway, with the latest problems with these PCs, though not related to Windows, I decided it was a great chance to find a replacement system and use an operating system that is known for uptime and reliability: Linux.
I wanted to buy a replacement laptop. At first I looked at the “ruggedized” ones, and the MS Surface laptops, due to various hams who talk about them a lot. In the end, I couldn’t move myself to hit the “buy” button for the several hundred dollars these kinds of laptops cost (with all the needed peripherals), especially as an experimental project. So I ended up with two used Maestro Evolve III laptops on eBay for $95.00 + tax.
Almost immediately after sharing about these replacements on Twitter, people came out of the woodwork and started recommending Linux. But little did they know, I already wiped one of them and installed Linux Mint on it via USB drive install.
Linux Mint is a flavor of Ubuntu that I had not tried yet, but have been hearing people liked and/or use more. I thought I’d give it a try, and after playing with it for a few minutes I realized I liked the user interface a lot.
Standing on the shoulders of giants, I then went on to KM4ACK’s 73 Linux scripts which is the latest incarnation of his years-long project at digital ham radio and computing called “Build-a-Pi”. I’ve passively monitored the developments of Build-a-Pi and 73 Linux since the beginning, but never really delved into the deeper-most parts of it. Now was a great time to jump in, now that VARA FM was shown to be working in a Linux environment. I cannot thank Jason enough for his selfless and steadfast work in making digital ham radio more accessible to the ham radio community.
With this foundation, I was all set and ready to script my way into hopes and daydreams of elegant linux reliability. It would JustWork™ right? Wrong…
Almost immediately I discovered that any one app using the digirig sound card would get an exclusive lock on the it and ban any other process or application from accessing it. I couldn’t wrap my head around this. So I couldn’t launch direwolf (packet soft-modem) and VARA FM at the same time?? Preposterous! No one else has had this problem? Hams seriously only ran one app at a time?? Come on!
I thought my problem was just with Wine, but it seemed to be true for any other native linux app. The problem was with ALSA, linux’s low-level sound system, and how it’s implemented. Various contributors have created methods for dealing with this issue: Jack (obsolete), Pulseaudio, and Pipewire (newest). All of those require extensive hacks for apps to see their interfaces, and they may not work.
The answers came when I reached out to the very active and responsive digirig forum. The winning answers came from AG7GN, who shared his own ALSA hacks for running JS8Call and fldigi at the same time. With his hacks I was able to get things like they worked on my old Windows gateway. (I did have to do something extra in Wine, also a tip from AG7GN, in order to get VARA FM to respect the new ALSA plugs.)
The other side of my journey was setting up linbpq, which was to take the place of Windows’ RMS Packet sysop software. BPQ would serve to tie all the modems together and route the calling client to Winlink’s email servers for mail sending and retrieval. I have run BPQ32 in Windows in the past, a failed attempt at making a BBS in 2021, but it is a cryptic piece of software. I was always guessing when I had to enter values for variables such as: NODECALL, CMSCALL, PORTCALL, Application SSID, CMS user, and the like.
The thing is, it would work for VARA FM, but not for packet. No matter what variation I tried, packet would just sit and acknowledge the connection and then do nothing. It never would bounce me to the Winlink mail servers and pick up mail. I was so ready to give up, once again.
The answers came after another day of frustration from none other than John G8BPQ, the creator of BPQ. The BPQ forum on Groups.io is a very responsive forum, and people just seem to automatically know when something’s off in a config file you share.
I now have a drop-in replacement in Linux for my Winlink gateway. When I first thought about this a few years ago, and even recently during the many tests and restarts, I didn’t think it was possible to have a dual-mode linux gateway due to: 1) VARA FM as Windows-only (which Jason solved in 73 Linux), 2) Winlink dev team support for linux (turns out they support linbpq as a CMS relay), and 3) Linux soundcard issues, of which there always seems to be a hack someone figured out.
So now I have a way of creating a lean Winlink gateway that doesn’t rely on a randomly updating/rebooting bloated OS and doesn’t phone home telling some company all my clickstream and activity. It’s perfectly happy to run on 4GB of RAM and 64GB of hard drive space. And more than that, it’s just plain cool!
All during this time I was DM’ing KM4ACK with my questions and frustrated rants. He was super patient and helpful. As a last step, we tackled having the applications start gracefully from reboot. This, too, had its debug sessions as we found that simple reboot cronjob would lead to a frozen VARA FM and/or a crashed direwolf. We arrived at different solutions that centered around the same idea: Set proper start delay timing. Jason used tmux startup commands in a script with 1 minute start delay while I did everything within the Linux Mint Startup Applications GUI. Both seem to work well and are stable.
And before people start telling or asking me about Raspberry Pi, let me say that Wine (and therefore VARA FM) on Pi requires (as of this writing) adding another layer of emulation (arm to x86). That and the number of failed microSD cards I’ve experienced (too many to count), and no thanks! Don’t even want to try it. No, I won’t buy a new dongle or board for a SSD. No, I won’t run VNC on a tablet or extra computer to access the tiny SBC pi. I want a compact self-contained computer, not an octopus of dongles, pins, and peripherals. The laptop only cost me $45.99, and I get a free keyboard and monitor with it!
In summary, Many years ago I didn’t think such a system would be possible in linux. There was always a compromise like “who needs VARA anyway? Packet is the way.” Fast-forward to the time of this writing and I was expecting this journey to be something many had gone through already. I did not anticipate the difficulty I would encounter to duplicate a conceptually simple dual-mode Windows RMS gateway. But it seems this is pioneering ground. Everyone just defaults to Windows apps and puts up with the Windows reboots, hoping their remote EMCOMM stations don’t need a visit due to an unresponsive machine. It is my hope that people will look more to linux and make robust solutions with this resource-friendly, privacy-respecting, efficient and reliable OS.
KM4ACK and I plan to talk about this on a Hamdom Thoughts livestream this Sunday 4/14/2024 on my YouTube channel.
For some final code and configuration snippets on my setups, check out these links:
- direwolf.conf for a digirig sound device: https://gist.github.com/denmojo/1a28431e72604d081efd272696f36ca2
- ALSA hack to expose multi-app access to USB sound device:https://gist.github.com/denmojo/22be858a88ee7dd736479476105309b9
- Registry edits to Wine to see ALSA PCM plugs instead of just hardware interfaces: https://gist.github.com/denmojo/2cac118ae79ecee610d70bbad3a11dda
- bpq32.cfg configuration: https://gist.github.com/denmojo/afb667bba6607a712be99f17bc506be1
- In Wine, I made sure to do KM4ACK’s wine regedit to set the COM port for VARA FM PTT. I set it to COM9.
Please note that during all of this I also used ‘alsamixer‘ in a terminal to make sure Automatic Gain Control was off, and ‘pavucontrol-qt‘ to tweak the sound input and output levels on the USB Sound Device to reach optimal levels for the radio. That and the Auto-Tune function of VARA FM allowed me to get the best levels for talking to nearby stations. Packet seemed to work well with these sane audio settings.
As with all digital ham radio endeavors, be prepared for a lot of tweaking and testing. It’s a long chain of spells you must cast, each one just right, for the magic to happen. It will take the help of others at times, but in the end, it will be glorious.