SoftRadar is a software defined radio that can transmit and receive (synchronoulsy) radar waveforms. Currently, it targets Universal Software Radio Peripheral (USRP) based hardwares only that support simultaneous Tx and Rx.
The main streaming program is written in C++ and is responsible for configuring the hardware, transmitting and receiving radar signals. Some of the hardware settings (frequency, gain, bandwidth,...) are configured via a configuration file (located in config/radarConfig.xml). Other real-time controls are handled through a UDP socket for possible remote control.
I) Compilation
-
Create out-of-source build directory
$ cd ../path-to-this-source code--/ $ mkdir build $ cd build
-
Configure and build the source
$ cmake .. $ make
-
Copy the binary to the workspace folder
$ cp apps/deviceManager ../workspace/
Make sure the compilation goes without error (which happend if you have not yet installed UHD driver, or if you have older versions of cmake,boost. If you make any changes to the C++ source files, you need to repeat the steps 2 and 3.
II) Usage:
SoftRadar can be run from the commnand-line or through a web-interface
Before executing the streamer, make sure you set appropriate parameters in the configuration file (located in config/radarConfig.xml).
II-a) Command-line option:
-
Open a terminal window and change directory to 'workspace'
$ cd ../path-to-this-source code--/workspace/
-
Make sure you set the parameters in the configuration file correctly.
-
Execute the program ('deviceManager') with appropriate command-line arguments. Type the following to see available options.
$ ./deviceManager --h which prints the following softRadar options: --help help message --burstlen arg (=1000) Burst size (1:12000) samples --record record received data --wmfilename arg Waveform file name --logfilesize arg (=1000000) Log file size (samples) --dir arg (=Data) Log data directory --srcport arg (=5700) Port for sending commands --destport arg (=5701) Port for receiving replies
-
Once the device manager is running, it is controled through UDP socket.
Commands are sent via 'srcport' and replies are received via 'destport'
Here is the list of commands that can be sent
START - starts the streamer STOP - suspends the streamer TERMINATE - shutdown the radio. This will terminate the program! GETSTATE - request for device state (ACTIVE / IDLE) GETCONFIG - request for configuration LOAD [fname] - upload new waveform file with the name [fname] Every command should start with CMD Eg. "CMD LOAD Desktop/smprf_01.wm" For commands that expect replies, the device manager sends the response via 'destport'. Responses start with RSP Eg. "RSP STATE ACTIVE" "RSP BURSTLAG FAILURE file not found"
-
Check the demo script in python/testCapture.py to see how to control the device manager. You might need to change the 'burstlen' to match it with configured value in config/radarConfig.xml.
II-b) Web interface:
This is the easiest option to run and control the radar. All you need to do is run the python webserver (radarHTTPSever.py) that automatically runs the device manager and provides a graphical interface for viewing configuration information and executing real-time controls.
Note: You need to set your current directory to ---/workspace/ This keeps the source files clean from log files generated by the streamer if you enable recording of received samples.
Running the webserver:
$ ../python/radarHTTPSever.py -p [port number] -b [burst length (samples)]
Set [portnumber] to a port that is not reserved for other TCP/IP
services. The default value is 8888.
Set [burst length (samples)] to the number of radar waveform samples that are repeatedly transmitted.
When you run the server multiple-times, it might fail to connect to the UDP port. This usually happens when the client web browser is still running. To avoid this, use other port number (8889,...), and it is good to stop the server from the web interface (with TERMINATE button) so that the webserver forces all its threads to terminate, and the browser leaves that port.