diff --git a/README.md b/README.md index 094b378..75e4ae7 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,12 @@ to RF using software-defined radio (SDR) platforms, such as $ gcc gpssim.c -lm -O3 -o gps-sdr-sim ``` -## Realtime +## Realtime by Gnuradio Use -n option can connect to a TCP source in Gnuradio for realtime simulation. The tcp source should be set in "Server" mode, listening to port 1234 (as default, it can be changed by.option -n). + See tcp.grc as a example. ### Generating the GPS signal file @@ -76,7 +77,7 @@ Options: -b I/Q data format [1/8/16] (default: 16) -i Disable ionospheric delay for spacecraft scenario -v Show details about simulated channels - -n Use tcp connect to gnuradio for realtime simulation + -n Use TCP connection to Gnuradio TCP-Source for realtime simulation. (Default 1234). ``` The user motion can be specified in either dynamic or static mode: @@ -93,6 +94,12 @@ The user motion can be specified in either dynamic or static mode: > gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 ``` +Use Gnuradio to realtime simulate 3000s: + +``` +> gps-sdr-sim -e brdc3540.14n -l 30.286502,120.032669,100 -n 1234 -d 3000 +``` + ### Transmitting the samples The TX port of a particular SDR platform is connected to the GPS receiver diff --git a/gpssim.c b/gpssim.c index fa114be..f4165b5 100644 --- a/gpssim.c +++ b/gpssim.c @@ -1661,7 +1661,7 @@ void usage(void) " -b I/Q data format [1/8/16] (default: 16)\n" " -i Disable ionospheric delay for spacecraft scenario\n" " -v Show details about simulated channels\n", - " -n Use TCP connect to Gnuradio TCP-Source for\n realtime simulation and port(default 1234)\n", + " -n Use TCP connect to Gnuradio TCP-Source for\n realtime simulation. (default 1234)\n", (USER_MOTION_SIZE)/10.0,STATIC_MAX_DURATION); return; @@ -1867,7 +1867,7 @@ int main(int argc, char *argv[]) llh[2] = 10.0; } - if (duration<0.0 || (duration>((double)USER_MOTION_SIZE)/10.0 && !staticLocationMode) || (duration>STATIC_MAX_DURATION && staticLocationMode)) + if (duration<0.0 || (duration>((double)USER_MOTION_SIZE)/10.0 && !staticLocationMode) || (duration>STATIC_MAX_DURATION && staticLocationMode)&&usesocket==false) { printf("ERROR: Invalid duration.\n"); exit(1); diff --git a/tcp.grc b/tcp.grc index 2361b06..dee5c85 100644 --- a/tcp.grc +++ b/tcp.grc @@ -124,7 +124,7 @@ _coordinate - (272, 200) + (280, 200) _rotation @@ -152,7 +152,7 @@ port - 2345 + 1234 vlen @@ -1071,7 +1071,7 @@ args - hackrf=81320f + hackrf _enabled diff --git a/top_block.py b/top_block.py index 49ae3d6..5551b95 100644 --- a/top_block.py +++ b/top_block.py @@ -2,7 +2,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Top Block -# Generated: Sun Apr 23 01:40:34 2017 +# Generated: Sun Apr 23 02:13:05 2017 ################################################## if __name__ == '__main__': @@ -60,7 +60,7 @@ class top_block(gr.top_block, Qt.QWidget): ################################################## # Blocks ################################################## - self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + "hackrf=81320f" ) + self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + "hackrf" ) self.osmosdr_sink_0.set_sample_rate(samp_rate) self.osmosdr_sink_0.set_center_freq(100e6, 0) self.osmosdr_sink_0.set_freq_corr(0, 0)