Net Server / Net Client

(remote control your rotor and/or equipment)


Overview

This project uses the Raspberry Pi (RPi). This product and the Arduino are having a significant impact on our hobby. Young people interested in electronics are now able to build exciting projects with relative ease and low cost. A good example of the large number of people using these devices is a very talented young lady Limor Fried (aka ladyada). She started a small company in NYC (Adafruit) that designs and builds accessories for the RPi and the Arduino. This amazing woman has turned it into a $30 million dollar a year business in a relatively short period of time. Microsoft is also supporting these devices with their IoT program. I suspect many potential young electronic enthusiasts that may have become a ham back in the day will spend their time with these new devices. If they saw something during a presentation that they recognized it might help them connect to the hobby. I doubt many kids in high school today have ever seen a computer running XP with a parallel printer port connector on the back.

 

Net Server Beta

'Net Server' is a device used to create a network connection to an antenna rotor system. This is very useful when operating portable or from a remote location. The large number of new lightweight rotor projects is a good indication of the interest in this area of our hobby. There are many different ways to do this such as running gpredict on your RPi. This solution is designed to use as much of your existing hardware and software as possible. This example uses the 'Yaesu G-5500' as the rotor and an 'LVB Tracker' (USB interface) as the controller. 'Net Server' can optionally control 4 relays using a very high quality board currently available for about $10 on Amazon. These relays can control things like antenna polarity switches, amplifiers or can be used to turn equipment on and off remotely. The relay board is not required and could be easily added later. If you are interested in only the remote control relays the programs will run without an 'LVB Tracker' connected.

The hardware is a Raspberry Pi 2 (RPi) shown in the image below along with the relay board for controlling other devices. Three cables are connected to the RPi, an RJ-45 network cable, a USB cable from the 'LVB Tracker' and a power cable that goes to a common USB charger. Five wires connect the RPi to the optional relay board.

 

If you do not have a Raspberry Pi but are interested in them (as of this date) the Raspberry Pi 2 Model B is an excellent choice. If you do go ahead and get an RPi I suggest selecting the default Raspbian version of UNIX while doing the initial setup.

https://www.raspberrypi.org/help/quick-start-guide/

The initial setup of the RPi requires that a keyboard, mouse and monitor be connected to the device. After the initial setup the keyboard, mouse and monitor may be removed and the device operated using what is referred to as a remote desktop connection. Since the RPi uses a multi-tasking operating system it can run the 'Net Server' program and a server program to allow access from a remote device at the same time. This means that you do not need a monitor, keyboard or mouse connected to the RPi after the initial setup. It also means the little two line LCD monitor we often see on devices off this type is not required. An RPi operated this way is often referred to as 'headless'.

There are two parts to a remote desktop connection. The first part is a program named xrdp that runs on the RPi. This program can be easily installed by entering the following command into a terminal window after the initial setup.

sudo apt-get install xrdp

Once xrdp is installed and you have rebooted your RPi you can forget about xrdp. It will start automatically every time your RPi boots up.

The other part of the system is the remote desktop client that runs on your device. The device can be a PC, Mac or even an iPad.

Windows includes a remote desktop client called 'Remote Desktop Connection'. When you run this program on your device you should see a screen that looks like this.


Enter the address for your 'Net Server' in the Computer text box and click on the connect button. Note you do not have to enter a port number - the default RDC port number is selected automatically. When the connection is made you should see a screen that looks like this. Leave the Xvnc Module selected, enter your 'Net Server' username (defaults to pi) and password (defaults to raspberry) then click on the OK button. You will then be taken to a standard RPi GUI window.


For the iPad you will first have to download a free app from the Apple app store called 'Microsoft Remote Desktop'. This is an excellent app and in some ways is easier to use than the version on the PC.

After you have downloaded and run the app create a connection to your 'Net Server' by tapping on the little '+' in the upper right corner of the app screen. This will be stored so you only have to do it once. Tap on the connection that you created and you will see a screen that looks like this. Enter the user name and password as usual and tap on 'Done'. This will take you directly to the 'Net Server' GUI.


You may not realize how powerful the 'Net Server' - remote desktop connection is. Below is a partial screen shot of the iPad running 'Microsoft Remote Desktop' connected to the 'Net Server' which is currently running gpredict. This can also be done from a PC using 'Remote Desktop Connection'. It is a bit easier on a PC than the iPad because you can use a mouse on the PC but both work fine.




You can also use the remote desktop connection software on a PC or an iPad to connect to standard PC's. If you are using a PRO version of Windows the server side software is built in. Below is a partial screen shot from the iPad running 'Microsoft Remote Desktop' connected to a Windows 7 Pro desktop running SatPC32. If you are not using a PRO version of Windows there are other third party remote desktop servers available.



We have come a long way due the great work done by Erich DK1TB with SatPC32 on the PC, Mark N8MH with 'SAEBRTrack' on the Basic Stamp and Howard G6LVB with 'LVB Tracker' on the PIC. As they say "the only reason we can see so far is we stand on the shoulders of giants".

After you have established the remote desktop connection you can operate your RPi from your device the same way you would operate if you were using a keyboard, mouse and monitor connected directly to the RPi. This helps reduce clutter in the shack and also reduces the cost of the system. It is also a very important advantage when operating portable.

After you have the RPi up and running create a directory under your home directory for the 'Net Server' program. The directory name is not critical. I used 'net_server' for the directory name. You can use the RPi GUI or a terminal window.

Download and install the Wiring Pi interface library. This library provides access to the input/output pins on the RPi GPIO connector.
http://wiringpi.com/download-and-install/

When you are ready to try out the program on your RPi send me an email and I will send the program to you. It is a compiled binary named netServer designed to run on the RPi not X86 boxes.

Copy the program into the directory you created earlier. Due to UNIX security you will probably not be able to run the program until you change the access rights. You can do this with 'chmod' in a terminal window but I find it easier to use the 'File Manager' program available in the RPi GUI. Note all the permissions for the netServer file have been set to anyone.

You should now be able to run the 'netServer' program. This is a console program that is designed to be run from a terminal window. For this example I opened a terminal window in the GUI. When you open a terminal window it defaults to your home directory. The default user name is pi so I left it as that for this example.

In the terminal window image below you can see the two commands necessary to start the program.
'cd net_Server' moves you into the directory we created earlier that contains the netServer program. 'sudo ./netServer' causes the program to run.

The 'USB Serial Device:' is the USB connection to the 'LVB Tracker'. If you do not have the 'LVB Tracker' plugged in it will complain but that is ok - just shutdown and if you have one plug it into the RPi and start the RPi back up (you probably could do a hot swap but just to be safe power down and reboot). You can continue on even if you do not have the 'LVB Tracker' connected. The 'Network Device:' is the Ethernet connection to your network through the RJ-45 connector. You will need the IP Address and the Port Number later so write them down.

When the program runs, a configuration file will be created in the same directory as the program named NetServerConfig.txt. You can see it opened in the RPi GUI 'Text Editor'. This editor is very nice. Having been stuck with VI for many many years back in the day it is a real treat to use this editor. If you need to change the Port, Network Device or USB device you can do it here. Do not change any of this unless you are sure you know what you are doing.


 

Net Client Beta

The 'Net Client' program is used to communicate over the network with the 'Net Server'. It is a Windows program. When you run it you should see something similar to what is shown in the image below. Ignore any message about the Serial Port not being configured - we have no need the serial port at this time. Enter the IP address and Port number you saw in the terminal window for the RPi when you ran the 'netServer' program. After you have entered in the correct IP Address and Port click on the 'Save/Restart' button at the bottom of the window (the button should have turned yellow when you changed a value to remind you to save it). When you do this the updated values will be saved and the program will restart. The little button to the right of the Network label should turn green if you have a good network connection (it was most likely red when you first ran the program) .

If you have an 'LVB Tracker' connected to the RPi you should see the current AZ and EL for your rotor in the lower left part of the window in the section labeled 'Rotor'. This value is updated at an interval shown in 'Interval ms' box. Unless you have some really old slow hardware you should not have to change it. If you make the value too low you will have a UUE (Unsatisfactory User Experience).

The group of four buttons and indicators in the bottom right of the window (S1-S4) control the four relays you saw in the pictures of the RPi 'Net Server ' system. For example if you click on the 'S1' button a message will be sent to the 'Net Server' telling it to activate relay 1. When this is done the 'Net Server' will send a message back indicating that relay 1 is activated and the little button indicator to the left of the 'S1' button will turn from Red to Green. This means that the indicator button will not turn Green immediately after you click on the button or it may not change at all if you do not have a network connection and a working 'NetServer'. This system is smart in that waits to see if the message was received by the 'Net Server'. It is however not brilliant - it can not tell if you have a relay board installed.

If you enter a valid 'LVB Tracker' Yaesu GS-232 move rotors command like 'W140 000' as shown in the example and click on the 'Send' button the rotor should move to the new position and the position information shown in the 'Rotor' portion of the display will track the move with updates at an interval specified in the 'Interval ms' text box.

If you make any changes to the values in the window other than the 'TX Data' text box the 'Save/Restart' button will turn yellow to remind you to save your changes. When you click on the 'Save/Restart' button the values will be saved and the program will automatically restart. When deciding what to hook up to the relays remember that the relays will all be turned to the off state when ever the 'Net Server' starts up.

The 'Serial' portion of the screen shows the controls used to configure the serial port that is used to connect 'Net Server' to satellite tracker programs that have a serial interface. Use the K5FR 'VSP Manager' program to set up a pair of virtual serial ports. Connect one of the ports to your tracker program and the other port to ' Net Client' using the boxes in the 'Serial' part of the 'Net Client' window. When the serial port connection is made the indicator button to the right of the word Serial will turn green. For this example I have 'Net Client' connected to virtual port COM6 at 9600 Baud and the other virtual port of the pair COM7 is connected to the tracking program. This way the tracking program can control the rotor. The image below shows the path from the tracking program to the rotor controller and relay board. It is not quite as complicated as it looks.

When you are ready to try the 'Net Client' program send me an email and I will send it to you.

F.A.Q.

Q: 2B or not 2B
A: The only supported platform is the Raspberry Pi model 2 B with the default raspbian wheezy installed. This does not mean it will not work on other platforms it just means if you use something else and it does not work I may not be able to help.

If you are interested in Amateur Radio Satellites be sure to visit http://www.amsat.org/

73 de W9KE