D-Star Articles

The internet bandwidth to the WG2MSK repeater in NYC is via a Clear(wire) 4G modem, it has a tendency to lock up, loose signal and never re-acquire despite being less than 50m from their tower. I have been through their "tech support" and exchanged the modem several times.

Needless to say we found this very annoying and placed an electronic timer on it that would turn the modem off every two hours for one minute, not a very elegant solution to say the least. The other thing I tried was to write a series of scripts to be activated via D-Plus to control an APC Master Switch, this provided me with an endless source of frustration and many late nights. My wife finally removed the SNMP card from it and "politely" indicated I should find a simpler way to accomplish the goal.

Enter the USB PIC controlled relay.

I stumbled across USB relays while researching something completely different, and purchased several different ones.
The one I personally believe is not junk is made by KMtronic and sold/shipped out of Bulgaria (really!). It costs €19.50 from their website (http://www.sigma-shop.com/product/7/usb-relay-controller-one-channel.html) or $30 including shipping via their eBay store. You will need a USB A to B cable as one is not included. The device is based on the FTDI USB to serial converter and is directly supported by the modern Centos kernel, so no additional driver is required.

Setup, scriptwriting, and usage for this purpose is actually quite simple and explained in the steps below.

1- Plug the device into the USB port. Unless you have other USB to serial adapters attached it will be known as ttyUSB0 (you can always run dmesg to verify). The power LED should illuminate.

2- Log in as root and go to the scripts directory (cd /dstar/scripts).

3- Create a script using your favorite editor (vi exec-R.sh) and input the following (if using VI hit i for insert):
#!/bin/bash
# Set the port speed to 9600
stty -F /dev/ttyUSB0 9600
# Open relay contact
echo -e '\xFF\x01\x01' > /dev/ttyUSB0
# Wait 10 seconds
sleep 10
# Close relay contact
echo -e '\xFF\x01\x00' > /dev/ttyUSB0
exit 0

If using VI hit Esc then :x to save the file and exit.

4- Allow the script to be executable:
chmod +x exec-R.sh

5- Make sure SOMEONE (preferably you) is in the [adminusers] section of the dplus.conf file.
cd /dstar/util
cp dplus.conf dplus.conf.backup (in case of a screw up)
vi dplus.conf
Add the callsign (i.e. KB2BSL;)

6- Watch the board and run the script:
cd /dstar/scripts
./exec-R.sh

LED should light up (D5) and relay should click, 10 seconds later click and LED off.

7- Create a UR on your radio for "      RX" (should be 6 spaces and RX)
With RPT1 and RPT2 set correctly, key up with this UR. The relay will most likely engage before you let go of the PTT!

8- Connect your wiring to the appropriate side of the relay.

This is not an endorsement of any product or procedure, Your mileage may vary, or I could have made a mistake. If you have other scripts on the machine, make sure to change the name of this one to something more appropriate for your situation. It is of course possible to write something to monitor internet access, sense a problem and throw the relay. However this works for me. I could not find a solution like this documented, so I thought I would share.

I met several people at Dayton who had similar issues with their DSL modems occasionally locking up, or maybe you would just like to turn some fans on for additional cooling in the summer, or control an analog repeaters logic input via D-star.

Hopefully someone will find this useful.

 

Add comment


Security code
Refresh

1000 characters left