diff --git a/apps/lora_receive_file.grc b/apps/lora_receive_file.grc index fdeedc4..10d5c99 100644 --- a/apps/lora_receive_file.grc +++ b/apps/lora_receive_file.grc @@ -105,7 +105,7 @@ value - sf * (1 / (2**sf / bw)) + sf * (1 / (2**sf / float(bw))) @@ -132,7 +132,7 @@ value - 125e3 + 125000 @@ -228,7 +228,7 @@ _coordinate - (376, 13) + (384, 12) _rotation @@ -267,7 +267,7 @@ value - bw / (2**sf) + float(bw) / (2**sf) @@ -409,10 +409,18 @@ lora_lora_receiver + + bandwidth + bw + alias + + crc + True + center_freq capture_freq @@ -421,17 +429,33 @@ channel_list [target_freq] + + cr + 4 + comment + + conj + False + affinity - threshold - 0.002 + decimation + 10 + + + disable_channelization + False + + + disable_drift_correction + False _enabled @@ -439,7 +463,7 @@ _coordinate - (416, 164) + (416, 156) _rotation @@ -449,6 +473,10 @@ id lora_lora_receiver_0 + + implicit + False + maxoutbuf 0 @@ -458,16 +486,16 @@ 0 - out_samp_rate - 1000000 + reduced_rate + False - in_samp_rate + samp_rate samp_rate sf - 7 + sf @@ -510,7 +538,7 @@ _coordinate - (416, 276) + (416, 300) _rotation diff --git a/apps/lora_receive_file.py b/apps/lora_receive_file.py index b668a5e..605de53 100755 --- a/apps/lora_receive_file.py +++ b/apps/lora_receive_file.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Lora Receive File -# Generated: Wed Jan 3 10:08:32 2018 +# Generated: Mon Jan 8 15:44:58 2018 ################################################## if __name__ == '__main__': @@ -40,12 +40,12 @@ class lora_receive_file(grc_wxgui.top_block_gui): ################################################## self.sf = sf = 7 self.samp_rate = samp_rate = 10e6 - self.bw = bw = 125e3 + self.bw = bw = 125000 self.target_freq = target_freq = 868.1e6 - self.symbols_per_sec = symbols_per_sec = bw / (2**sf) + self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) self.capture_freq = capture_freq = 866.0e6 - self.bitrate = bitrate = sf * (1 / (2**sf / bw)) + self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks @@ -66,7 +66,7 @@ class lora_receive_file(grc_wxgui.top_block_gui): peak_hold=False, ) self.Add(self.wxgui_fftsink2_1.win) - self.lora_lora_receiver_0 = lora.lora_receiver(samp_rate, capture_freq, ([target_freq]), 7, 1000000, False, 4, True) + self.lora_lora_receiver_0 = lora.lora_receiver(samp_rate, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, False, 10, False, False) self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True) self.blocks_file_source_0 = blocks.file_source(gr.sizeof_gr_complex*1, 'counting_cr4_sf7.cfile', True) @@ -82,8 +82,9 @@ class lora_receive_file(grc_wxgui.top_block_gui): def set_sf(self, sf): self.sf = sf - self.set_symbols_per_sec(self.bw / (2**self.sf)) - self.set_bitrate(self.sf * (1 / (2**self.sf / self.bw))) + self.set_symbols_per_sec(float(self.bw) / (2**self.sf)) + self.lora_lora_receiver_0.set_sf(self.sf) + self.set_bitrate(self.sf * (1 / (2**self.sf / float(self.bw)))) def get_samp_rate(self): return self.samp_rate @@ -99,9 +100,9 @@ class lora_receive_file(grc_wxgui.top_block_gui): def set_bw(self, bw): self.bw = bw - self.set_symbols_per_sec(self.bw / (2**self.sf)) + self.set_symbols_per_sec(float(self.bw) / (2**self.sf)) self.set_firdes_tap(firdes.low_pass(1, self.samp_rate, self.bw, 10000, firdes.WIN_HAMMING, 6.67)) - self.set_bitrate(self.sf * (1 / (2**self.sf / self.bw))) + self.set_bitrate(self.sf * (1 / (2**self.sf / float(self.bw)))) def get_target_freq(self): return self.target_freq diff --git a/apps/lora_receive_file_nogui.py b/apps/lora_receive_file_nogui.py index e95c521..bcec708 100755 --- a/apps/lora_receive_file_nogui.py +++ b/apps/lora_receive_file_nogui.py @@ -22,13 +22,13 @@ class lora_receive_file_nogui(gr.top_block): ################################################## # Variables ################################################## - self.internal_sample_rate = 1e6 + self.decimation = 1 ################################################## # Blocks ################################################## self.message_socket_sink = lora.message_socket_sink('127.0.0.1', 40868, 1) - self.lora_receiver = lora.lora_receiver(sample_rate, capture_freq, ([lc.freq]), lc.sf, self.internal_sample_rate, lc.implicit, lc.cr_num, lc.crc) + self.lora_receiver = lora.lora_receiver(sample_rate, capture_freq, ([lc.freq]), 125000, lc.sf, lc.implicit, lc.cr_num, lc.crc, reduced_rate=False, decimation=self.decimation) self.blocks_throttle = blocks.throttle(gr.sizeof_gr_complex, sample_rate, True) self.blocks_file_source = blocks.file_source(gr.sizeof_gr_complex, sample_file, False) diff --git a/apps/lora_receive_realtime.grc b/apps/lora_receive_realtime.grc index cb37e6a..a5331f8 100644 --- a/apps/lora_receive_realtime.grc +++ b/apps/lora_receive_realtime.grc @@ -105,7 +105,7 @@ value - sf * (1 / (2**sf / bw)) + sf * (1 / (2**sf / float(bw))) @@ -132,7 +132,7 @@ value - 125e3 + 125000 @@ -162,6 +162,64 @@ 868e6 + + variable + + comment + The decimation determines the oversampling rate. +A sample rate of 1e6 and decimation of 1 equals +8 times oversampling, a decimation of 2 is 4 times +oversampling, and so on. Set higher decimation +for better performance, but worse accuracy. + + + _enabled + True + + + _coordinate + (640, 76) + + + _rotation + 0 + + + id + decimation + + + value + 1 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (384, 76) + + + _rotation + 0 + + + id + downlink + + + value + False + + variable @@ -189,36 +247,6 @@ firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) - - variable - - comment - The internal sampling rate determines the -oversampling rate. 1e6 is 8 times oversampling, -5e5 is 4 times oversampling, and so on. Set higher -for better accuracy, but worse performance. - - - _enabled - True - - - _coordinate - (640, 76) - - - _rotation - 0 - - - id - internal_sampling_rate - - - value - 5e5 - - variable @@ -297,7 +325,7 @@ for better accuracy, but worse performance. value - bw / (2**sf) + float(bw) / (2**sf) @@ -312,7 +340,7 @@ for better accuracy, but worse performance. _coordinate - (280, 77) + (280, 76) _rotation @@ -329,10 +357,18 @@ for better accuracy, but worse performance. lora_lora_receiver + + bandwidth + bw + alias + + crc + True + center_freq capture_freq @@ -341,17 +377,33 @@ for better accuracy, but worse performance. channel_list [target_freq] + + cr + 4 + comment + + conj + downlink + affinity - threshold - 0.002 + decimation + decimation + + + disable_channelization + False + + + disable_drift_correction + False _enabled @@ -359,7 +411,7 @@ for better accuracy, but worse performance. _coordinate - (392, 172) + (392, 212) _rotation @@ -369,6 +421,10 @@ for better accuracy, but worse performance. id lora_lora_receiver_0 + + implicit + False + maxoutbuf 0 @@ -378,12 +434,12 @@ for better accuracy, but worse performance. 0 - out_samp_rate - internal_sampling_rate + reduced_rate + False - in_samp_rate - samp_rate + samp_rate + 1e6 sf @@ -392,14 +448,6 @@ for better accuracy, but worse performance. lora_message_socket_sink - - loraphy - True - - - loratap - False - alias @@ -418,7 +466,7 @@ for better accuracy, but worse performance. _coordinate - (640, 220) + (640, 236) _rotation @@ -432,6 +480,10 @@ for better accuracy, but worse performance. ip 127.0.0.1 + + layer + 0 + port 40868 @@ -661,7 +713,7 @@ for better accuracy, but worse performance. _coordinate - (24, 140) + (24, 188) _rotation @@ -1876,7 +1928,7 @@ for better accuracy, but worse performance. _coordinate - (16, 340) + (16, 388) _rotation @@ -2071,7 +2123,7 @@ for better accuracy, but worse performance. _coordinate - (392, 292) + (392, 340) _rotation diff --git a/apps/lora_receive_realtime.py b/apps/lora_receive_realtime.py index 6c5f19e..14ebd96 100755 --- a/apps/lora_receive_realtime.py +++ b/apps/lora_receive_realtime.py @@ -3,7 +3,7 @@ ################################################## # GNU Radio Python Flow Graph # Title: Lora Receive Realtime -# Generated: Wed Jan 3 10:08:54 2018 +# Generated: Mon Jan 8 15:32:44 2018 ################################################## if __name__ == '__main__': @@ -40,13 +40,14 @@ class lora_receive_realtime(grc_wxgui.top_block_gui): ################################################## self.sf = sf = 11 self.samp_rate = samp_rate = 1e6 - self.bw = bw = 125e3 + self.bw = bw = 125000 self.target_freq = target_freq = 868.1e6 - self.symbols_per_sec = symbols_per_sec = bw / (2**sf) - self.internal_sampling_rate = internal_sampling_rate = 5e5 + self.symbols_per_sec = symbols_per_sec = float(bw) / (2**sf) self.firdes_tap = firdes_tap = firdes.low_pass(1, samp_rate, bw, 10000, firdes.WIN_HAMMING, 6.67) + self.downlink = downlink = False + self.decimation = decimation = 1 self.capture_freq = capture_freq = 868e6 - self.bitrate = bitrate = sf * (1 / (2**sf / bw)) + self.bitrate = bitrate = sf * (1 / (2**sf / float(bw))) ################################################## # Blocks @@ -81,7 +82,7 @@ class lora_receive_realtime(grc_wxgui.top_block_gui): self.osmosdr_source_0.set_bandwidth(0, 0) self.lora_message_socket_sink_0 = lora.message_socket_sink('127.0.0.1', 40868, 0) - self.lora_lora_receiver_0 = lora.lora_receiver(samp_rate, capture_freq, ([target_freq]), sf, internal_sampling_rate, False, 4, True) + self.lora_lora_receiver_0 = lora.lora_receiver(1e6, capture_freq, ([target_freq]), bw, sf, False, 4, True, False, downlink, decimation, False, False) ################################################## # Connections @@ -95,9 +96,9 @@ class lora_receive_realtime(grc_wxgui.top_block_gui): def set_sf(self, sf): self.sf = sf - self.set_symbols_per_sec(self.bw / (2**self.sf)) + self.set_symbols_per_sec(float(self.bw) / (2**self.sf)) self.lora_lora_receiver_0.set_sf(self.sf) - self.set_bitrate(self.sf * (1 / (2**self.sf / self.bw))) + self.set_bitrate(self.sf * (1 / (2**self.sf / float(self.bw)))) def get_samp_rate(self): return self.samp_rate @@ -113,9 +114,9 @@ class lora_receive_realtime(grc_wxgui.top_block_gui): def set_bw(self, bw): self.bw = bw - self.set_symbols_per_sec(self.bw / (2**self.sf)) + self.set_symbols_per_sec(float(self.bw) / (2**self.sf)) self.set_firdes_tap(firdes.low_pass(1, self.samp_rate, self.bw, 10000, firdes.WIN_HAMMING, 6.67)) - self.set_bitrate(self.sf * (1 / (2**self.sf / self.bw))) + self.set_bitrate(self.sf * (1 / (2**self.sf / float(self.bw)))) def get_target_freq(self): return self.target_freq @@ -129,19 +130,24 @@ class lora_receive_realtime(grc_wxgui.top_block_gui): def set_symbols_per_sec(self, symbols_per_sec): self.symbols_per_sec = symbols_per_sec - def get_internal_sampling_rate(self): - return self.internal_sampling_rate - - def set_internal_sampling_rate(self, internal_sampling_rate): - self.internal_sampling_rate = internal_sampling_rate - self.lora_lora_receiver_0.set_out_samp_rate(self.internal_sampling_rate) - def get_firdes_tap(self): return self.firdes_tap def set_firdes_tap(self, firdes_tap): self.firdes_tap = firdes_tap + def get_downlink(self): + return self.downlink + + def set_downlink(self, downlink): + self.downlink = downlink + + def get_decimation(self): + return self.decimation + + def set_decimation(self, decimation): + self.decimation = decimation + def get_capture_freq(self): return self.capture_freq diff --git a/docs/test-results/decode_long_hackrf.md b/docs/test-results/decode_long_hackrf.md index f17802a..1453742 100644 --- a/docs/test-results/decode_long_hackrf.md +++ b/docs/test-results/decode_long_hackrf.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_hackrf' -*Results on 2018-01-05 15:45:02.728810* +*Results on 2018-01-09 08:20:28.388091* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/decode_long_rtl-sdr.md b/docs/test-results/decode_long_rtl-sdr.md index e41aaa9..6c37eee 100644 --- a/docs/test-results/decode_long_rtl-sdr.md +++ b/docs/test-results/decode_long_rtl-sdr.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_rtl-sdr' -*Results on 2018-01-05 15:43:46.791893* +*Results on 2018-01-09 08:19:12.473520* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/decode_long_usrp.md b/docs/test-results/decode_long_usrp.md index e36edfc..459bfd9 100644 --- a/docs/test-results/decode_long_usrp.md +++ b/docs/test-results/decode_long_usrp.md @@ -1,6 +1,6 @@ # Test suite: 'decode_long_usrp' -*Results on 2018-01-05 15:44:23.389284* +*Results on 2018-01-09 08:19:49.042810* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_hackrf.md b/docs/test-results/short_hackrf.md index 213afda..01bfc3f 100644 --- a/docs/test-results/short_hackrf.md +++ b/docs/test-results/short_hackrf.md @@ -1,6 +1,6 @@ # Test suite: 'short_hackrf' -*Results on 2017-12-21 08:45:09.865970* +*Results on 2018-01-09 08:29:44.926497* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_rtl-sdr.md b/docs/test-results/short_rtl-sdr.md index 850c6b0..63cf3ac 100644 --- a/docs/test-results/short_rtl-sdr.md +++ b/docs/test-results/short_rtl-sdr.md @@ -1,6 +1,6 @@ # Test suite: 'short_rtl-sdr' -*Results on 2017-12-21 08:36:30.594450* +*Results on 2018-01-09 08:21:05.747845* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/docs/test-results/short_usrp.md b/docs/test-results/short_usrp.md index 02b668d..529e685 100644 --- a/docs/test-results/short_usrp.md +++ b/docs/test-results/short_usrp.md @@ -1,6 +1,6 @@ # Test suite: 'short_usrp' -*Results on 2017-12-21 08:40:33.854584* +*Results on 2018-01-09 08:25:08.965237* ### 868.1 MHz, SF 7, CR 4/8, BW 125 kHz, prlen 8, crc on, implicit off diff --git a/python/qa_testsuite.py b/python/qa_testsuite.py index f58fc47..8732cce 100755 --- a/python/qa_testsuite.py +++ b/python/qa_testsuite.py @@ -237,7 +237,7 @@ class qa_testsuite(): transmit_freq = capture_meta["lora:frequency"] sf = capture_meta["lora:sf"] cr = capture_meta["lora:cr"] - bw = capture_meta["lora:bw"] + bw = int(capture_meta["lora:bw"]) prlen = capture_meta["lora:prlen"] crc = capture_meta["lora:crc"] implicit = capture_meta["lora:implicit"] @@ -251,7 +251,7 @@ class qa_testsuite(): # Build flowgraph tb = gr.top_block() file_source = blocks.file_source(gr.sizeof_gr_complex, data_file, False) - lora_receiver = lora.lora_receiver(sample_rate, capture_freq, [868100000], sf, 1000000, False, 4, True) + lora_receiver = lora.lora_receiver(sample_rate, capture_freq, [868100000], bw, sf, False, 4, True, reduced_rate=False, decimation=1) throttle = blocks.throttle(gr.sizeof_gr_complex, sample_rate, True) message_socket_sink = lora.message_socket_sink("127.0.0.1", 40868, 2) freq_xlating_fir_filter = filter.freq_xlating_fir_filter_ccc(1, (firdes.low_pass(1, sample_rate, 200000, 100000, firdes.WIN_HAMMING, 6.67)), frequency_offset, sample_rate)