Server: Setting up SpyServer on Windows

Setting up a SpyServer server on Windows is extremely simple.

  1. Log on to the Windows PC that you want to be the remote server.
     

  2. Go to www.airspy.com/download and download the latest version zip file of SDR#. Extract all the files onto a folder on your PC.
     

  3. Run the install-rtlsdr.bat file to download the RTL-SDR drivers.
     

  4. In the SDR# folder find the file spyserver.config. Right click it and select 'Open With -> Notepad'.
     

  5. Edit the 'device_type' line to show 'device_type = RTL-SDR'.
     
     

  6. Save and close the spyserver.config text file.
     

  7. Double click on spyserver.exe to start the server.
     

  8. Open the start menu and type in 'cmd' and then press enter to open a command prompt.
     

  9. In the new command prompt type in 'ipconfig'. This will display a list of network adapters on your PC, with their current IP addresses. Find the one actively being used (likely Ethernet or Wireless) and note down the IPv4 Address. This is your server PCs IP address.

Server: Setting up SpyServer on Linux

  1. Log into the Linux device that you are using for the server, and open a terminal window if needed.
     

  2. First install prerequisites such as the RTL-SDR drivers and librtlsdr.

    sudo apt install rtl-sdr librtlsdr-dev
  3. Create a new folder for the spyserver and navigate into it.

    mkdir spyserver 
    cd spyserver
  4. Download the latest SpyServer and extract it using the commands below. NOTE: That you will need to download the correct version for the platform that you are using (e.g. 32 or 64-bit, ARM or x86). Go to airspy.com/download, and find the links for the SpyServer download that matches your platform. Replace the link below with it. The link used in this example is for the 32-bit ARM version which is what Raspberry Pi's and most other single board PCsww like Odroids and Orange Pi's use.

    wget -O spyserver.tgz http://airspy.com/?ddownload=4247 
    tar xvzf spyserver.tgz
  5. Use a text editor like nano to edit the spyserver.config file. Change the "device_type" to "device_type = RTL-SDR" (without quotes).
     
    If you are unfamiliar with Nano, then note that you cannot use the mouse. You will need to use the arrow keys to move the cursor. Editing is done with the bakspace/del keys and keyboard keys as usual. To save and exit, Press "Ctrl + X", and then the "y" key.

    nano spyserver.config
  6. Find your device's IP address using the "ifconfig" command. Note NOT "ipconfig" from windows, notice the "f". Write this IP address down as it is the address you'll use to connect to the SpyServer.
     

  7. Now you can run SpyServer

    ./spyserver

Note that if you get the error './spyserver: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./spyserver)', then you'll need to install the newer GCC-5 or GCC-6.

To do this use the following steps:

If you get error 'W: There is no public key available for the following key IDs:
EF0F382A1A7B6500' after running 'sudo apt-get update', then first install the following with 'sudo apt-get install debian-keyring debian-archive-keyring'

You'll be asked a few questions during the install and all the defaults are fine. Installation will take about 20 minutes. Once upgraded you should be able to run ./spyserver.

Tip: Setting up a headless Raspberry Pi

If you're setting up a Raspberry Pi as a server then you're probably not going to be connecting it to a monitor. This is called a headless setup. You'll also probably be using WiFi. This tip shows you how to enable SSH and enter the WiFi credentials on a Raspberry Pi without any monitor, keyboard or mouse. If you want you still can of course initially connect a monitor keyboard and mouse and set it up via the Raspbian GUI, or connect a network cable.

After writing the Raspbian image to the SD card, put it into a PC and open the boot drive partition in file explorer.

To enable SSH simply create an empty text file with the name 'SSH' in the root of the partition.

To allow a WiFi connection create a text file called 'wpa_supplicant.conf' in the root of the partition and fill it with the following text. NOTE: Make sure that it is not wpa_supplicant.conf.txt. You must set Windows to display the full file extension so you can change it to just wpa_supplicant.conf. This will set up a WiFi connection on boot and automatically connect it. (Only good for WPA2 secured systems)

network={
       ssid="YOUR SSID"
       psk="YOUR PASSWORD"
       key_mgmt=WPA-PSK
    }

Finally you'll need to look in your routers status page to find the IP address of the Raspberry Pi. Usually the routers access page can be accessed at http://192.168.1.1 or 192.168.1.254, but this address is entirely dependent on your router set up. Consult your router manual or ISP for these details if you do not know them.

Client PC: Connecting to the SpyServer

Once you've set up the server you can now connect to it from a client PC.

  1. Log on to the Windows PC that you want to browse the radio spectrum with (client PC). This PC should be on the same network as your server PC (or see below about port forwarding to use remotely over the internet).
     

  2. Download and extract the latest SDR# version on the client PC.
     

  3. Open SDR#.
     

  4. Under Source select 'Spy Server'.
     

  5. Enter the IP address of the server in the following format: 'sdr://IP_ADDR:5555' (without quotes).
     
     

  6. Press the play button.

You should now be connected to the remote SpyServer and the spectrum should be active.

There are some additional options that you'll see in the Source box. Apart from the standard gain and bandwidth settings there is an IQ format drop down box and a 'use full IQ' checkbox.

Use Full IQ - This essentially reverts SpyServer back into rtl_tcp, sending the entire IQ data over the network. Note that you'll need to press the stop button first or this option will be greyed out.

IQ Format - This enables/disables IQ compression. With an RTL-SDR in most cases you should use PCM 8bit to keep the network data as low as possible. If you experience problems you can try other options.

The limitation with 8-bit mode is that you might loose dynamic range, but for most signals (and the RTL-SDR which is 8-bits anyway) it will be fine. Higher end SDRs like the HF+ may benefit from PCB 16-bit or higher modes in some cases.

SpyServer OptionsSpyServer Options

Tweaking SpyServer

If you're having performance issues on slower hardware or networks like choppy audio then you might want to reduce the frame rate. You can do this in the spyserver.config text file by editing the 'fft_fps' variable. By default it is 15, try lower values to improve performance. Lower the frame rate results in a more pixelated waterfall in SDR#.

You may also want to play with increasing the 'buffer_size_ms' and 'buffer_count' variables if you experience choppiness especially over the internet.

After editing the file restart the server.

Using SpyServer with an Upconverter

This is simple, but you need to know your upconverters offset. For example the ham-it-up upconverter has an offset of 125 MHz (-125,000,000 Hz) and the SpyVerter upconverter has an offset of 120 MHz (-120,000,000 Hz). If you have another upconverter and are unsure of the offset then consult the manufacturer or it's documentation.

To set the offset in SpyServer edit the spyserver.config file with a text editor. Uncomment the 'converter_offset' variable by removing the '#' next to it (do not delete the '#' on the two lines above). You can then set the offset used by your upconverter after the equals sign.

Setting 'converter_offset' to -120,000,000 for a SpyVerter Upconverter.Setting 'converter_offset' to -120,000,000 for a SpyVerter Upconverter. Make sure to uncomment it by deleting the '#' next to it.

Running SpyServer Automatically on Boot (Raspberry Pi)

You may wish to set up your server so that it automatically starts on boot. Doing so is simple with crontab.

  1. Open crontab with nano

    crontab -e 
  2. Add the following line at the bottom.

    @reboot /home/pi/spyserver/spyserver /home/pi/spyserver/spyserver.config
  3. Press Ctrl + X and then 'y' to save and quit.

SpyServer Crontab - Start on boot