Monday, February 10, 2025

HamRadio.AI, An AI autoresponder for Winlink.

With AI infiltrating all aspects of our lives, I figured it was time to make use of it with ham radio. In this article I'll walk you through how I setup an AI bot to reply to messages received through Winlink.


A while back when ChatGPT was all the craze, I read an article on a fellow ham that connected his radio up and used voice to text in order to allow interaction with ChatGPT over the air.(https://hackaday.com/2023/01/28/the-voice-of-chatgpt-is-now-on-the-air/) I thought it was a neat concept, but thought something more along the lines of text correspondence would be a better option. 

Fast forward to today and the new popular kid on the block is now the DeepSeek LLM, which is open source and allows you to run the model on self hosted hardware. This got me thinking how it may be entertaining, if not slightly useful to have a way to use DeepSeek via ham radio.

I did a bit of searching and to my surprise didn't find any existing projects that fit my criteria. My goal was to send a Winlink message to Deepseek and have it generate a reply.

I'm not much of a python coder, so I prompted my local instance to generate code to use Ollama to check for emails from the Winlink system, generate a response, and reply automatically. 

A response to the question "What area of the world do callsigns starting with VA7 or VE7 originate?"

The code it came up with worked like a champ. On first run it generates a config file that you need to edit with your own information for the script to connect to Gmail. After that, the script will check for new messages every 30 seconds and reply if it meets the correct criteria. 

Current testing is promising, however as you can expect, the distilled version I'm running doesn't get the facts right every time. So take whatever it gives you with a grain of salt. I'm also working on getting it connected to the internet so it can access more up to date information. 

I think it would be great to have "someone" always available on the other side of an Winlink message to give you a weather report, a summary of the latest news, or just to bounce a test message off of.

Anyway, to test it yourself, just use Winlink to send a message to hamradio.ai@gmail.com and wait a few minutes for a reply. Just don't forget the period in the email address name, the Winlink system will reject replies if you do. This is a work in progress running on my home machine, so it may not always be active. I'll also post the code once I'm done working on it. 

--Update 2.13.25--

I've been working on the script more and finally got it to do basic web searches in order to make the reply more accurate and useful. In testing it seems to work a lot better and will even cite where it found its answers. The downside is that the model takes longer to reply to emails. The "offline" original script could crank out an answer in about 30 seconds. The "web connected" version, can take several minutes to compile all of the information and then send a reply. 

No comments:

Post a Comment