Set Up a TDOA System

Requirements for the low-cost TDOA system

Raspberry PI based Receivers:

Master PC:


Set up a Raspberry PI RTL-SDR Receiver

Download the SD card image and write it to an SD card (recommended software: Win32DiskImager). Login with username alarm and the (default) password alarm. The command to start a reception at the receiver is:

/home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 filename.dat

Establishing the SSH connections

In order to be able to start the reception of all receivers at least roughly at the same time (recommended is within 100 ms), it is required to configure SSH for key-based authentication instead of the default password-based login. For that purpose the user at the master (client) generates a pair of keys once. Then the public key is copied to the Rasperry PIs (server). Lots of good and detailed tutorials can be found in the web.

Establishing the SSH connections from the master to the receivers depends on the type of network connections your receivers have:

Scenario 1: Master PC and receiver in the same LAN (easy):

All receivers in the same LAN

If your receivers and the master PC are connected to the same LAN operation of the system is quite easy. This single command start the specified command successively in all three receivers:

ssh alarm@<ip-address1> <remote_linux_command> &
ssh alarm@<ip-address2> <remote_linux_command> &
ssh alarm@<ip-address3> <remote linux_command>

Example:

ssh alarm@192.168.0.4 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 1_filename.dat  &
ssh alarm@192.168.0.5 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 2_filename.dat &
ssh alarm@192.168.0.9 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 3_filename.dat

Scenario 2: Master PC and receivers in different private LANs (quite easy):

One of the receivers in an other LAN

This is scenario is probably the most common setup: The receivers are located at different locations (e.g. your friends house) in private LANs. Establishing a ssh connection from master to a receiver is usually not straightforward, because the receiver is hidden behind a router and its firewall. So you need to provide access from the public internet to the Raspberry PI in the private LAN. Two things are required here

  • First, the master needs to know the public IP address of the receiver LAN’s router. Note, that usually the public IP address changes from time to time. For comfortable operation a “dynamic DNS” service can be used, such that the router can be accessed by a fixed domain name (e.g. a_router.something.org).
  • Second, the router of the receiver’s LAN needs to be configured with port forwarding to make the receiver accessible to the public internet. Port forwarding simply maps a network port at the router to a device (PC, Raspberry PI) behind the router. Example: Router address (public) is 1.2.3.4, receiver LAN address is: 192.168.0.99, port configured by port forwading: 1111, then the receiver is publicly accessible with 1.2.3.4:1111. Port forwarding needs to be configured in your router settings, the exact procedure is dependent on your router model.

The command for recording signals at the 3 receivers is the same as above, except that the forwarded ports need to be specified (the IP address is then the public router address):

ssh alarm@<ip-address1> [-p <port>] <remote_linux_command> &
ssh alarm@<ip-address2> [-p <port>] <remote_linux_command> &
ssh alarm@<ip-address3> [-p <port>] <remote linux_command>

Example: RX3 is located in other LAN behind router with the IP address 15.16.17.18, port forwarding is configured to port 1111:

ssh alarm@192.168.0.4 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 1_filename.dat  &
ssh alarm@192.168.0.5 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 2_filename.dat &
ssh alarm@15.16.17.18 -p 1111 /home/alarm/librtlsdr-2freq/build/src/rtl_sdr -f <freq_1_hz> -h <freq_2_hz> -n 1.2e6 3_filename.dat

Scenario 3: Master PC and receivers in other networks (advanced):

Receivers in LAN without possibility for port forwarding, external server required

If one of the receivers is located in a non-private network, such as in a company, mobile network (3G, LTE etc.) or in another network, for which you do not have any administration rights, establishing a SSH connection is more difficult. One possibility requires an external online server. The Raspberry PI connects itself to that server to open a SSH tunnel (reverse tunneling). Further action may be required, such as applying autossh to keep the connection open.


Recommended Operation

  • Always capture 3x 1.2M samples with 2 Msps, i.e. use the setting proposed above
  • Recorded filenames must be 1_<name>.dat, 2_<name>.dat and 3_<name>.dat for the three receivers
  • After reception the files can copied to the master with the scp command.
  • Matlab processing of the master: First, adapt the configuration file, then execute the script

Recent Posts