2023-04-07
For a while I have been thinking about running a radio BBS, because those always seemed cool to me.
Just imagine being hundreds of kilometers away from another radio station, transmitting ascii art or something like that and listening to the soothing sounds of a 1200 baud modem.
Making a radio BBS would also have a practical use, because sometimes I am far away from home without any credit on my sim card, and having a radio link to atleast use IRC or gemini(??) would be really nice.
But: there is a problem.
All the software needed to make this work is annoyingly complex and not really made for idiots like me.
Besides that most of these programs expect you to have an Amateur Radio or some special Interface, which I don't have.
All I have are some cheap PMR446 radios for testing.
So, what can I do?
Well, the solution was to glue some shell script monstrosity together using [minimodem], awk, grep, etc.
I have already experimented a bit with minimodem, so I was a bit familiar with it.
I randomly had the thought: Why not just pipe the output of minimodem into a shell script and process it there?
Then use audio sinks/Pulseaudio's "Monitor of xyz" to "pipe" the audio from the mic input to minimodem and vice-versa.
After having the basic input/output from/to minimodem working, I just have to parse what comes in and generate a response to be transmitted. The rest was pretty easy to implement.
I made the simple IRC mode, it just connects to a channel with [suckless ii] and sends everything it receives from the client to that channel, except the quit message, which quits out of the IRC mode.
To show messages to the Client, it saves the current list of messages in a variable, and when the user transmits "more", it checks if the old list of messages is different to the new list of messages and sends the literal diff(1) back.
I am sure this can be improved somehow in the future, because this has absolutely no error-checking and it looks very ugly.
Other than that, it also features these commands:
The actual BBS functionality however isn't there yet, mainly because I have been lazy and I had some issues with writing to the file and receiving properly.
This worked surprisingly well, atleast at 110/300bps, higher speeds don't really work and are very unreliable.
What I noticed was that the USB Soundcard link with aux cables to my cheap pmr446 radios was sometimes not working, but I think that is an issue with my radio and not with the script.
There is absolutely no authentication yet, and even if there was some login prompt, that doesn't stop anyone from just "hijacking" your connection and sending random/malicious garbage to the server.
If anyone has an idea on how to fix this, let me know!
In the end, I am quite happy with the results. If I work more on this, this could become something pretty cool.
For now, though, I put it up on my Codeberg Account. Feel free to fork it, work on it, whatever!