RSS Feed

RSS
Comments RSS

a different kind of ham homebrewing

This little project just took on a life of its own this afternoon.  What started out as an experiment in writing a single program to read output data from my radio via the RS232 serial interface has turned into a full blown radio remote control program.

The current state of the program will let me control my rig from a remote PC across the local network at my QTH.

There are 4 separate programs involved in this.  Much of the code from my previous blog post comprises the heart of the system.

Here is how it all works. On the PC that is connected to the radio (we will call this the PC-Radio system) resides two programs – K2client.py and K2server.py.   On the remote PC across the network (we will call this the PC-operator system) resides two other programs – client.py and server.py.   On the PC-Radio system, the programs each have to communicate with both the network and the radio.   The K2client.py program takes any output data from the radio and sends it out to the network to be received as feedback from the radio by the server.py program on the PC-operator system. The K2server.py program receives any data sent to it from across the network by the client.py program on the PC-operator system and passes these as commands to the radio.  The radio takes the command, gives feedback, and cycle begins again.   As a diagram, it looks like this.

server.py[PC-operator system]client.py —————->K2server.py [PC-Radio system]K2client.py —>
^                   (operator)                    (network)                             (radio)                        |
|                                                                                                                                v
<——————–<———————————<—————————–<——————————-<——————–<—————————-

It was not as that this was all entirely necessary.  I could have downloaded software already designed to do this, and have used such in the past with my computers and radio.   However, for me, it is the difference between buying a radio and building a radio.  You can accomplish the very same thing in the end, e.g. communication.  Both ways are OK.  However, there are added benefits from building equipment such as the opportunity to learn, pride in the work one has done, the sense of accomplishment, etc.   The same is true for this type of homebrewing, the only difference is that it is homebrewed software rather than hardware.  The Python source code for the project is available.  This code is very minimalist and intended only to demonstrate the principles involved.  Please feel free to use, adapt, or modify it in any way you may wish.

NOTE:  The code from my previous blog post contains comments that explain how to take this Linux implementation of RS232 communications and adapt it for use on a Windows system.  Also note that there are hard coded IP addresses in the code that would need to be changed for implementation elsewhere.  Aside from those differences, this code should be fully cross-platform and usable anywhere as it pertains to the parts dealing with the serial and network communications.  The control codes and settings I am sending to my radio may not be applicable to your own, so please see the users or programming manual for your rig for appropriate codes, settings and methods for communicating and controlling it.   Additionally, the code found in this project that implements the network socket clients and servers are adaptations of code found at evolt.org.









*