W0JEC’s Projects |
Contents |
The W0JEC Station-DTS Control Program
I wrote this Visual Basic 2010 program to send the commands to the Picaxe microcontroller that controls the DTS-4/6 antenna switch and operates the other relays used to control other station accessories. For some operations, the Picaxe microcontroller not only receives commands from the program but sends data back to the program.
The program can be installed on your home computer for use in antenna and station control and for testing the Picaxe board and programming, but it is really intended to be used on your remote computer to control your station remotely. The program files for both the W0JEC Station-DTS Control program and the W0JEC Server program must be installed on your hard drive in a folder you will create named “C/:Remote Station Control” - this is an absolute requirement because when started these two programs search only this folder for the configuration files needed to load and run.
W0JEC Station-DTS Control Configuration
The first time you run the program, you will be taken to the Setup menu to personalize the program for your use. Using the Configuration screen, you can enter the names of the antennas and station accessories you want to control. After entering your list of antennas, you may check the selection box for the antenna you want to be connected when the program starts - or you may select the option “All Antennas Grounded” (I don’t recommend All Antennas Grounded because with this choice your rig will not be connected to any antenna when you begin HF remote operations.) You can also select one or more of the station accessory relays you want turned on at startup - for example, I select my Hygain Rotator Controller to be turned on at startup.
For remote operation (on your remote computer), click on “Setup TCP Client” to enter the IP address for your home computer (use the LogMeIn Hamachi² address) and the Firewall port on your home computer that the W0JEC Server is monitoring. If you are using the software on your home computer, uncheck the “Setup TCP Client” box and select the serial port to be use from a drop down list of available ports. After completing the entry of your antennas, station accessories, IP address and Firewall port (or serial port) information and choices, you must click on “Click to Save Configuration” to save the new configuration file. The program must then be restarted to incorporate your new configuration information.
W0JEC Server Configuration
The first time you start the W0JEC Server program, you will be taken to the Setup menu to personalize the program for your use. Enter the Firewall port the program will monitor and the serial port used to connect to the Picaxe board. There are over 65,000 firewall ports available - I use port 4002 for my installation (PstRotatorAZ defaults to port 4001). If you choose a port that is already in use, the software will force you to make another selection. You can also select whether the server will always start minimized or in normal screen configuration; I recommend you start minimized. Click on the Save Configuration button to save the setup file and restart the program. When you restart the program using the new configuration, your operating system should ask you if you will permit the firewall port to be used — answer yes. If not, open your Windows Firewall (Control Panel) and add W0JEC Server to the list of programs allowed through the firewall. For remote HF operation, this server must be running on your home computer at all times. Include it in your Startup directory so it will be restarted whenever your computer restarts.
Serial Communications with the Picaxe
Each time you start the W0JEC Station-DTS Control program, the software will communicate with the Picaxe chip that is connected to a serial port of the home computer. If you are operating the software on your home computer, the W0JEC Server running on the home computer must be turned off to prevent both programs from attempting to use the same com port (this won’t work!) If you are operating the software on your remote computer, the software will communicate with the Picaxe chip over the internet using the W0JEC Server running on your home computer. When operating from a remote computer, the W0JEC Station-DTS Control software must not be running on your home computer. For remote operation, run only the W0JEC Server on your home computer.
If connection to the Picaxe chip is successful, you will see the message “Serial Communications OK”. You will be able to turn on and off relays for any (or all) of the station control accessories that you have configured and you can change your antenna selection. Each time you change antennas, the Picaxe chip will send a message to the software verifying the antenna that is now connected to your rig. This will take a few seconds and the box for that antenna will not change color until this verification has been received.
The program will ‘ping’ the Picaxe chip every few seconds to confirm that there is still serial communication with the chip and if communications are lost for any reason you will see the message “Serial Communications Lost”. Loss of serial communications is not common but can occur for a variety of reasons such as loss of 12VDC power to the Picaxe board, unexpected shutdown of your home computer, or loss of internet access. If serial communications are lost, or if 12VDC power is lost to the Picaxe board, the chip has been programmed to ground all antennas and turn off all station accessory control relays. You must correct the serial communication problem and restart the W0JEC Station-DTS Control program before continuing your HF Remote operation.
Whenever you change antennas, the W0JEC Station-DTS Control program will verify that it has communications with the DTS Antenna switch and will warn you if communications with the switch have been lost. Loss of communication with the switch is usually a result of loss of 12VDC power to the switch or the removal of the stereo cable connecting the Picaxe board to the switch. When the switch loses power, all antennas are grounded. If you lose communication with the switch, you should not continue operating your transceiver as you very likely do not have an antenna connected to your rig. You will be required to restart the W0JEC Station-DTS Control program after you have corrected the problem with the antenna switch.
When you exit the W0JEC Station-DTS Control program, it sends commands to the Picaxe chip to turn off all station control relays and ground all antennas.
|