Skip to content

Commit 899ddd3

Browse files
committed
Updated GUI to only have sf and msg in test parameters
2 parents d54fd05 + ce0b0d2 commit 899ddd3

File tree

9 files changed

+119
-35
lines changed

9 files changed

+119
-35
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ uw_env/
99
__pycache__/
1010
*.nmea
1111
.venv
12-
.coverage
12+
.coverage
13+
.vscode/

auto_config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameter_sets:
33
mult_amp: 0.2
44
rx_mix_freq: -12000
55
tx_mix_freq: 12000
6-
tx_rx_bw: 5000
6+
tx_rx_bw: 6000
77
tx_cr: 1
88
tx_rx_sf: 7
99
tx_rx_sync_word: [18]
@@ -12,7 +12,7 @@ parameter_sets:
1212
mult_amp: 0.15
1313
rx_mix_freq: -12000
1414
tx_mix_freq: 12000
15-
tx_rx_bw: 5000
15+
tx_rx_bw: 6000
1616
tx_cr: 1
1717
tx_rx_sf: 7
1818
tx_rx_sync_word: [18]
@@ -21,7 +21,7 @@ parameter_sets:
2121
mult_amp: 0.1
2222
rx_mix_freq: -12000
2323
tx_mix_freq: 12000
24-
tx_rx_bw: 5000
24+
tx_rx_bw: 6000
2525
tx_cr: 1
2626
tx_rx_sf: 7
2727
tx_rx_sync_word: [18]
@@ -30,7 +30,7 @@ parameter_sets:
3030
mult_amp: 0.2
3131
rx_mix_freq: -12000
3232
tx_mix_freq: 12000
33-
tx_rx_bw: 5000
33+
tx_rx_bw: 6000
3434
tx_cr: 1
3535
tx_rx_sf: 8
3636
tx_rx_sync_word: [18]
@@ -39,7 +39,7 @@ parameter_sets:
3939
mult_amp: 0.15
4040
rx_mix_freq: -12000
4141
tx_mix_freq: 12000
42-
tx_rx_bw: 5000
42+
tx_rx_bw: 6000
4343
tx_cr: 1
4444
tx_rx_sf: 8
4545
tx_rx_sync_word: [18]
@@ -48,7 +48,7 @@ parameter_sets:
4848
mult_amp: 0.1
4949
rx_mix_freq: -12000
5050
tx_mix_freq: 12000
51-
tx_rx_bw: 5000
51+
tx_rx_bw: 6000
5252
tx_cr: 1
5353
tx_rx_sf: 8
5454
tx_rx_sync_word: [18]
@@ -57,7 +57,7 @@ parameter_sets:
5757
mult_amp: 0.2
5858
rx_mix_freq: -12000
5959
tx_mix_freq: 12000
60-
tx_rx_bw: 5000
60+
tx_rx_bw: 6000
6161
tx_cr: 1
6262
tx_rx_sf: 9
6363
tx_rx_sync_word: [18]
@@ -66,7 +66,7 @@ parameter_sets:
6666
mult_amp: 0.15
6767
rx_mix_freq: -12000
6868
tx_mix_freq: 12000
69-
tx_rx_bw: 5000
69+
tx_rx_bw: 6000
7070
tx_cr: 1
7171
tx_rx_sf: 9
7272
tx_rx_sync_word: [18]
@@ -75,12 +75,12 @@ parameter_sets:
7575
mult_amp: 0.1
7676
rx_mix_freq: -12000
7777
tx_mix_freq: 12000
78-
tx_rx_bw: 5000
78+
tx_rx_bw: 6000
7979
tx_cr: 1
8080
tx_rx_sf: 9
8181
tx_rx_sync_word: [18]
8282

83-
# BW is 5000 for all
83+
# BW is 6000 for all
8484
# CR is same for all (4/5, which corresponds to 1 in the source code)
8585
# sync word is same for all (default 18)
8686
# mix frequency is 12000 +/- for all (center freq)

base_station_gui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,8 @@ def run_tests(self):
912912
# Send test commands
913913
for bue_id, config in self.bue_configs.items():
914914
command = f"TEST,{config['file']},{unix_timestamp},{config['sf']} {config["msg"]}"
915-
for i in range(3):
916-
self.base_station.ota.send_ota_message(bue_id, command)
917-
time.sleep(0.1)
915+
self.base_station.ota.send_ota_message(bue_id, command)
916+
time.sleep(0.1)
918917
logger.info(f"Sent test command to bUE {bue_id}: {command}")
919918

920919
bue_names = [bUEs.get(str(bue_id), str(bue_id)) for bue_id in self.bue_configs.keys()]

base_station_main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def message_listener(self):
208208
elif message_body.startswith("UPD"): # 40,55,UPD:LAT,LONG,STDOUT: [helloworld.py STDOUT] TyGoodTest,-42,8
209209
if not bue_id in self.testing_bues:
210210
self.testing_bues.append(bue_id)
211+
logger.bind(bue_id=bue_id).info(f"Received UPD from {bue_id} but it was not in testing_bues. Adding it now.")
211212
header, lat, long, stdout = message_body.split(",", maxsplit=3)
212213
# logger.info(f"Received UPD from {bue_id}. Currently at Latitude: {lat}, Longitude: {long}. Message: {stdout}")
213214
logger.bind(bue_id=bue_id).info(f"Received UPD from {bue_id}. Message: {stdout}")
@@ -239,6 +240,7 @@ def message_listener(self):
239240
logger.bind(bue_id=bue_id).info(f"Received CANCD from {bue_id}")
240241
if bue_id in self.testing_bues:
241242
self.testing_bues.remove(bue_id)
243+
242244
elif message_body.startswith("BAD"):
243245
logger.bind(bue_id=bue_id).info(f"Received BAD from {bue_id}")
244246
self.stdout_history.append(f"Received a BAD from {bUEs[str(bue_id)]}")

constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
bUEs = {
44
"10": "Doof",
5-
"20": "Candace",
5+
"80": "Candace",
66
"30": "Major",
77
"40": "Buford",
88
"50": "Carl",
@@ -11,7 +11,7 @@
1111

1212
bUEs_inverted = {
1313
"Doof": "10",
14-
"Candace": "20",
14+
"Candace": "80",
1515
"Major": "30",
1616
"Buford": "40",
1717
"Carl": "50",

tdo_rup.grc

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ blocks:
6565
bus_sink: false
6666
bus_source: false
6767
bus_structure: null
68-
coordinate: [600, 752.0]
68+
coordinate: [480, 792.0]
6969
rotation: 0
7070
state: true
7171
- name: analog_sig_source_x_0_0
@@ -88,7 +88,7 @@ blocks:
8888
bus_sink: false
8989
bus_source: false
9090
bus_structure: null
91-
coordinate: [360, 136.0]
91+
coordinate: [352, 152.0]
9292
rotation: 0
9393
state: true
9494
- name: audio_sink_0
@@ -124,7 +124,32 @@ blocks:
124124
bus_sink: false
125125
bus_source: false
126126
bus_structure: null
127-
coordinate: [232, 696.0]
127+
coordinate: [144, 720.0]
128+
rotation: 0
129+
state: enabled
130+
- name: band_pass_filter_0
131+
id: band_pass_filter
132+
parameters:
133+
affinity: ''
134+
alias: ''
135+
beta: '6.76'
136+
comment: ''
137+
decim: '1'
138+
gain: '1'
139+
high_cutoff_freq: tx_rx_mix_freq + (tx_rx_bw /2) + 1000
140+
interp: '1'
141+
low_cutoff_freq: tx_rx_mix_freq - (tx_rx_bw /2) - 1000
142+
maxoutbuf: '0'
143+
minoutbuf: '0'
144+
samp_rate: samp_rate
145+
type: fir_filter_ccf
146+
width: '1000'
147+
win: window.WIN_HAMMING
148+
states:
149+
bus_sink: false
150+
bus_source: false
151+
bus_structure: null
152+
coordinate: [592, 564.0]
128153
rotation: 0
129154
state: enabled
130155
- name: blocks_complex_to_float_0
@@ -187,7 +212,7 @@ blocks:
187212
bus_sink: false
188213
bus_source: false
189214
bus_structure: null
190-
coordinate: [488, 664.0]
215+
coordinate: [400, 664.0]
191216
rotation: 0
192217
state: enabled
193218
- name: blocks_message_strobe_0
@@ -240,7 +265,7 @@ blocks:
240265
bus_sink: false
241266
bus_source: false
242267
bus_structure: null
243-
coordinate: [840, 648.0]
268+
coordinate: [808, 664.0]
244269
rotation: 0
245270
state: true
246271
- name: blocks_multiply_xx_0_0
@@ -297,7 +322,7 @@ blocks:
297322
maxoutbuf: '0'
298323
minoutbuf: '0'
299324
pay_len: '255'
300-
print_rx: '[True,True]'
325+
print_rx: '[False,True]'
301326
samp_rate: samp_rate
302327
sf: tx_rx_sf
303328
soft_decoding: 'True'
@@ -490,10 +515,11 @@ connections:
490515
- [analog_sig_source_x_0, '0', blocks_multiply_xx_0, '1']
491516
- [analog_sig_source_x_0_0, '0', blocks_multiply_xx_0_0, '0']
492517
- [audio_source_0, '0', blocks_float_to_complex_0, '0']
518+
- [band_pass_filter_0, '0', blocks_multiply_xx_0, '0']
493519
- [blocks_complex_to_float_0, '0', audio_sink_0, '0']
494520
- [blocks_complex_to_float_1, '0', blocks_wavfile_sink_0, '0']
495521
- [blocks_conjugate_cc_0, '0', blocks_complex_to_float_0, '0']
496-
- [blocks_float_to_complex_0, '0', blocks_multiply_xx_0, '0']
522+
- [blocks_float_to_complex_0, '0', band_pass_filter_0, '0']
497523
- [blocks_message_strobe_0, strobe, lora_sdr_payload_id_inc_0, msg_in]
498524
- [blocks_message_strobe_0, strobe, lora_tx_0, in]
499525
- [blocks_multiply_const_vxx_0, '0', blocks_conjugate_cc_0, '0']

tdo_rup.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
from gnuradio import audio
1414
from gnuradio import blocks
1515
import pmt
16-
from gnuradio import gr
16+
from gnuradio import filter
1717
from gnuradio.filter import firdes
18+
from gnuradio import gr
1819
from gnuradio.fft import window
1920
import sys
2021
import signal
@@ -60,7 +61,7 @@ def __init__(self, message_str='TEST', mult_amp=0.5, tx_cr=1, tx_rx_bw=8000, tx_
6061
samp_rate=samp_rate,
6162
sf=tx_rx_sf,
6263
ldro_mode=2,frame_zero_padd=1280,sync_word=tx_rx_sync_word )
63-
self.lora_rx_0 = lora_sdr.lora_sdr_lora_rx( bw=tx_rx_bw, cr=1, has_crc=True, impl_head=False, pay_len=255, samp_rate=samp_rate, sf=tx_rx_sf, sync_word=tx_rx_sync_word, soft_decoding=True, ldro_mode=2, print_rx=[True,True])
64+
self.lora_rx_0 = lora_sdr.lora_sdr_lora_rx( bw=tx_rx_bw, cr=1, has_crc=True, impl_head=False, pay_len=255, samp_rate=samp_rate, sf=tx_rx_sf, sync_word=tx_rx_sync_word, soft_decoding=True, ldro_mode=2, print_rx=[False,True])
6465
self.blocks_wavfile_sink_0 = blocks.wavfile_sink(
6566
wav_file_path,
6667
1,
@@ -77,6 +78,16 @@ def __init__(self, message_str='TEST', mult_amp=0.5, tx_cr=1, tx_rx_bw=8000, tx_
7778
self.blocks_conjugate_cc_0 = blocks.conjugate_cc()
7879
self.blocks_complex_to_float_1 = blocks.complex_to_float(1)
7980
self.blocks_complex_to_float_0 = blocks.complex_to_float(1)
81+
self.band_pass_filter_0 = filter.fir_filter_ccf(
82+
1,
83+
firdes.band_pass(
84+
1,
85+
samp_rate,
86+
(tx_rx_mix_freq - (tx_rx_bw /2) - 1000),
87+
(tx_rx_mix_freq + (tx_rx_bw /2) + 1000),
88+
1000,
89+
window.WIN_HAMMING,
90+
6.76))
8091
self.audio_source_0 = audio.source(samp_rate, 'hw:3,0', True)
8192
self.audio_sink_0 = audio.sink(samp_rate, 'hw:3,0', True)
8293
self.analog_sig_source_x_0_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, tx_rx_mix_freq, 1, 0, 0)
@@ -90,10 +101,11 @@ def __init__(self, message_str='TEST', mult_amp=0.5, tx_cr=1, tx_rx_bw=8000, tx_
90101
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1))
91102
self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0_0, 0))
92103
self.connect((self.audio_source_0, 0), (self.blocks_float_to_complex_0, 0))
104+
self.connect((self.band_pass_filter_0, 0), (self.blocks_multiply_xx_0, 0))
93105
self.connect((self.blocks_complex_to_float_0, 0), (self.audio_sink_0, 0))
94106
self.connect((self.blocks_complex_to_float_1, 0), (self.blocks_wavfile_sink_0, 0))
95107
self.connect((self.blocks_conjugate_cc_0, 0), (self.blocks_complex_to_float_0, 0))
96-
self.connect((self.blocks_float_to_complex_0, 0), (self.blocks_multiply_xx_0, 0))
108+
self.connect((self.blocks_float_to_complex_0, 0), (self.band_pass_filter_0, 0))
97109
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_conjugate_cc_0, 0))
98110
self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_complex_to_float_1, 0))
99111
self.connect((self.blocks_multiply_xx_0, 0), (self.lora_rx_0, 0))
@@ -126,6 +138,7 @@ def get_tx_rx_bw(self):
126138

127139
def set_tx_rx_bw(self, tx_rx_bw):
128140
self.tx_rx_bw = tx_rx_bw
141+
self.band_pass_filter_0.set_taps(firdes.band_pass(1, self.samp_rate, (self.tx_rx_mix_freq - (self.tx_rx_bw /2) - 1000), (self.tx_rx_mix_freq + (self.tx_rx_bw /2) + 1000), 1000, window.WIN_HAMMING, 6.76))
129142

130143
def get_tx_rx_mix_freq(self):
131144
return self.tx_rx_mix_freq
@@ -134,6 +147,7 @@ def set_tx_rx_mix_freq(self, tx_rx_mix_freq):
134147
self.tx_rx_mix_freq = tx_rx_mix_freq
135148
self.analog_sig_source_x_0.set_frequency((-self.tx_rx_mix_freq))
136149
self.analog_sig_source_x_0_0.set_frequency(self.tx_rx_mix_freq)
150+
self.band_pass_filter_0.set_taps(firdes.band_pass(1, self.samp_rate, (self.tx_rx_mix_freq - (self.tx_rx_bw /2) - 1000), (self.tx_rx_mix_freq + (self.tx_rx_bw /2) + 1000), 1000, window.WIN_HAMMING, 6.76))
137151

138152
def get_tx_rx_sf(self):
139153
return self.tx_rx_sf
@@ -162,6 +176,7 @@ def set_samp_rate(self, samp_rate):
162176
self.samp_rate = samp_rate
163177
self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
164178
self.analog_sig_source_x_0_0.set_sampling_freq(self.samp_rate)
179+
self.band_pass_filter_0.set_taps(firdes.band_pass(1, self.samp_rate, (self.tx_rx_mix_freq - (self.tx_rx_bw /2) - 1000), (self.tx_rx_mix_freq + (self.tx_rx_bw /2) + 1000), 1000, window.WIN_HAMMING, 6.76))
165180

166181

167182

tup_rdo.grc

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ blocks:
8888
bus_sink: false
8989
bus_source: false
9090
bus_structure: null
91-
coordinate: [336, 176.0]
91+
coordinate: [336, 192.0]
9292
rotation: 0
9393
state: true
9494
- name: audio_sink_0
@@ -124,7 +124,32 @@ blocks:
124124
bus_sink: false
125125
bus_source: false
126126
bus_structure: null
127-
coordinate: [232, 696.0]
127+
coordinate: [152, 696.0]
128+
rotation: 0
129+
state: enabled
130+
- name: band_pass_filter_0
131+
id: band_pass_filter
132+
parameters:
133+
affinity: ''
134+
alias: ''
135+
beta: '6.76'
136+
comment: ''
137+
decim: '1'
138+
gain: '1'
139+
high_cutoff_freq: tx_rx_mix_freq + (tx_rx_bw /2) + 1000
140+
interp: '1'
141+
low_cutoff_freq: tx_rx_mix_freq - (tx_rx_bw /2) - 1000
142+
maxoutbuf: '0'
143+
minoutbuf: '0'
144+
samp_rate: samp_rate
145+
type: fir_filter_ccf
146+
width: '1000'
147+
win: window.WIN_HAMMING
148+
states:
149+
bus_sink: false
150+
bus_source: false
151+
bus_structure: null
152+
coordinate: [552, 548.0]
128153
rotation: 0
129154
state: enabled
130155
- name: blocks_complex_to_float_0
@@ -171,7 +196,7 @@ blocks:
171196
bus_sink: false
172197
bus_source: false
173198
bus_structure: null
174-
coordinate: [712, 640.0]
199+
coordinate: [736, 624.0]
175200
rotation: 0
176201
state: enabled
177202
- name: blocks_float_to_complex_0
@@ -187,7 +212,7 @@ blocks:
187212
bus_sink: false
188213
bus_source: false
189214
bus_structure: null
190-
coordinate: [488, 664.0]
215+
coordinate: [392, 664.0]
191216
rotation: 0
192217
state: enabled
193218
- name: blocks_message_strobe_0
@@ -297,7 +322,7 @@ blocks:
297322
maxoutbuf: '0'
298323
minoutbuf: '0'
299324
pay_len: '255'
300-
print_rx: '[True,True]'
325+
print_rx: '[False,True]'
301326
samp_rate: samp_rate
302327
sf: tx_rx_sf
303328
soft_decoding: 'True'
@@ -490,10 +515,11 @@ connections:
490515
- [analog_sig_source_x_0, '0', blocks_multiply_xx_0, '1']
491516
- [analog_sig_source_x_0_0, '0', blocks_multiply_xx_0_0, '0']
492517
- [audio_source_0, '0', blocks_float_to_complex_0, '0']
518+
- [band_pass_filter_0, '0', blocks_conjugate_cc_0, '0']
493519
- [blocks_complex_to_float_0, '0', audio_sink_0, '0']
494520
- [blocks_complex_to_float_0_0, '0', blocks_wavfile_sink_0, '0']
495521
- [blocks_conjugate_cc_0, '0', blocks_multiply_xx_0, '0']
496-
- [blocks_float_to_complex_0, '0', blocks_conjugate_cc_0, '0']
522+
- [blocks_float_to_complex_0, '0', band_pass_filter_0, '0']
497523
- [blocks_message_strobe_0, strobe, lora_sdr_payload_id_inc_0, msg_in]
498524
- [blocks_message_strobe_0, strobe, lora_tx_0, in]
499525
- [blocks_multiply_const_vxx_0, '0', blocks_complex_to_float_0, '0']

0 commit comments

Comments
 (0)