Monday, November 24, 2025

Python and what I have been up too.

 

A snippet of the shutdown python script as actions are taken. 

Python and what I’ve been up to… well, let me tell you!
I’ve honestly surprised myself with the automation I’ve built for starting up and shutting down my contesting setup. Before Python, the startup routine was a long chain of manual steps: launching VSPE and waiting, then clicking on Win4Icom Suite and waiting again, then starting N1MM+ and waiting some more, then opening Firefox, navigating to the Reverse Beacon Network, entering my call, checking that I was spotted, and refreshing it every 10 minutes.

Now? Thanks to Python, all of that happens with a single mouse click. I LOVE IT!

 With one mouse click my Kasa plug turns on, powers on my Astron power supply and Pi4B and it begins its startup. Then VSPE starts, then Win4icom starts, N1MM+ starts and finally Firefox opens to Reverse beacon network were it logs in and then enters my call sign to show who is hearing my CQ contest calling and will refresh every 10 minutes. 

Now If you’re curious about the hiccups and challenges I ran into along the way, keep reading. Or, if you’d rather skip ahead, feel free to jump to the end where I share some of my upcoming Python-and-amateur-radio project—you might be surprised!

Let’s start with the Wi-Fi plug that kicks off the entire startup process. I needed a Python library to communicate with my Kasa plug—easy enough. Then I needed to find the plug’s IP address—again, no problem. But one day, my Python terminal that handles the whole start-and-stop sequence suddenly threw an error related to the Wi-Fi plug. After some investigating, I realized our router had restarted and reassigned the plug a new IP address. That completely broke my script.

More research led me to a great solution: I could assign a name to the plug and have Python search for the device by name, then automatically discover whatever IP address the router had given it. Problem solved—elegantly.

With the Wi-Fi plug sorted out, I moved on to scripting the rest of the startup sequence. I added every program I needed, in the exact order they had to launch, and it worked beautifully… until I noticed that some programs loaded slower than others. That meant certain tasks weren’t finished before the next program in the chain started, and everything just froze. The fix turned out to be simple: insert time delays between launches to give each program the breathing room it needs.

Next came Win4Icom. Tom, VE2FSQ, does an incredible job keeping his software updated—there’s a new version roughly every month with improvements and bug fixes. But once a new version came out, my Python script kept opening the old one. To fix that, I wrote code that automatically checks for the latest installed version every time and launches that one instead.

Then I ran into another issue: occasionally Python wasn’t shutting down my Icom 7610 correctly through the Win4Icom software. That meant the radio was being abruptly disconnected when the Wi-Fi plug powered off my power supply. NOT GOOD. So instead of relying on Win4Icom for shutdown, I added the Icom CI-V shutdown command directly into my Python script. That ensured the 7610 powered down properly every single time.

My Pi4B is also tied into the Wi-Fi plug, but that part is simple—when the plug turns on, the Pi boots normally, no Python needed. Shutting the Pi down, however, is a different adventure involving Windows and Python… and I’ll save that story for the next post.

As promised, here’s a preview of what I’m working on next. When a contest is over, I normally have to:

  1. Go to the 3830 scoring site and manually enter my score.

  2. Generate a CAB file and submit it to the contest sponsor.

  3. Generate an ADIF file within N1MM+.

  4. Submit that ADIF to my logging program Amateur Radio Contest Log then do the same for LOTW, Club Log, CWops, and QRZ.com

I’m developing a Python program that will do all of that automatically:
• Login to 3830, fill in the band breakdowns, multipliers, total contacts and multipliers and final score.
• Generate a CAB file from within N1MM+.
• Generate an ADIF file from N1MM+ and load it into Amateur Radio Contest Log.
• From within Amateur Contest Log program, automatically open Club Log and LOTW and submit the logs.
• Then log into QRZ.com and CWops and submit the score there as well.

All with one mouse click—while I sit back and watch it happen.

My next post will be dealing with the contest shutdown process. At this point I am just starting the new project I mentioned above.  

No comments: