fix(rx): minor fixes and improvements

This commit is contained in:
2025-12-05 15:38:03 +01:00
parent 0f4f05af03
commit 235c2dd60d
2 changed files with 378 additions and 48 deletions

View File

@@ -37,7 +37,7 @@ blocks:
id: variable id: variable
parameters: parameters:
comment: '' comment: ''
value: '25' value: '100'
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
@@ -75,7 +75,7 @@ blocks:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
bus_structure: null bus_structure: null
coordinate: [192, 92.0] coordinate: [192, 96.0]
rotation: 0 rotation: 0
state: true state: true
- name: rx_gain - name: rx_gain
@@ -103,7 +103,7 @@ blocks:
id: variable id: variable
parameters: parameters:
comment: '' comment: ''
value: 1e4 value: 1e6
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
@@ -126,18 +126,18 @@ blocks:
- name: ONBEAT_Demod_1 - name: ONBEAT_Demod_1
id: ONBEAT_Demod id: ONBEAT_Demod
parameters: parameters:
FULL_PACKET_LEN: '4096' FULL_PACKET_LEN: 8*(4*255+2*16)
OVERSAMPLING: '10' OVERSAMPLING: OVERSAMPLING
RRC_ALPHA: '0.35' RRC_ALPHA: RRC_ALPHA
affinity: '' affinity: ''
alias: '' alias: ''
comment: '' comment: ''
maxoutbuf: '0' maxoutbuf: '0'
minoutbuf: '0' minoutbuf: '0'
roc_tolerance: '1' roc_tolerance: '0.8'
samp_rate: 1e6 samp_rate: samp_rate
symbol_map: '[0, 1, 3, 2]' symbol_map: symbol_map
syncword: '"0000011100001001000110110010110101110111100110001010100111111010"' syncword: syncword
states: states:
bus_sink: false bus_sink: false
bus_source: false bus_source: false
@@ -145,37 +145,6 @@ blocks:
coordinate: [728, 412.0] coordinate: [728, 412.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: iio_pluto_source_0
id: iio_pluto_source
parameters:
affinity: ''
alias: ''
bandwidth: '20000000'
bbdc: 'True'
buffer_size: '32768'
comment: ''
filter: ''
filter_source: '''Auto'''
fpass: '0'
frequency: lo_freq * 1000000
fstop: '0'
gain1: '''slow_attack'''
len_tag_key: packet_len
manual_gain1: '64'
maxoutbuf: '0'
minoutbuf: '0'
quadrature: 'True'
rfdc: 'True'
samplerate: int(samp_rate)
type: fc32
uri: ''
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [344, 380.0]
rotation: 0
state: disabled
- name: network_socket_pdu_1 - name: network_socket_pdu_1
id: network_socket_pdu id: network_socket_pdu
parameters: parameters:
@@ -402,7 +371,7 @@ blocks:
autoscale: 'False' autoscale: 'False'
average: '1.0' average: '1.0'
axislabels: 'True' axislabels: 'True'
bw: samp_rate*OVERSAMPLING bw: samp_rate
color1: '"blue"' color1: '"blue"'
color10: '"dark blue"' color10: '"dark blue"'
color2: '"red"' color2: '"red"'
@@ -415,7 +384,7 @@ blocks:
color9: '"dark green"' color9: '"dark green"'
comment: '' comment: ''
ctrlpanel: 'False' ctrlpanel: 'False'
fc: lo_freq fc: lo_freq*10e6
fftsize: '1024' fftsize: '1024'
freqhalf: 'True' freqhalf: 'True'
grid: 'False' grid: 'False'
@@ -562,6 +531,363 @@ blocks:
coordinate: [1104, 484.0] coordinate: [1104, 484.0]
rotation: 0 rotation: 0
state: enabled state: enabled
- name: rtlsdr_source_0
id: rtlsdr_source
parameters:
affinity: ''
alias: ''
ant0: ''
ant1: ''
ant10: ''
ant11: ''
ant12: ''
ant13: ''
ant14: ''
ant15: ''
ant16: ''
ant17: ''
ant18: ''
ant19: ''
ant2: ''
ant20: ''
ant21: ''
ant22: ''
ant23: ''
ant24: ''
ant25: ''
ant26: ''
ant27: ''
ant28: ''
ant29: ''
ant3: ''
ant30: ''
ant31: ''
ant4: ''
ant5: ''
ant6: ''
ant7: ''
ant8: ''
ant9: ''
args: '""'
bb_gain0: '20'
bb_gain1: '20'
bb_gain10: '20'
bb_gain11: '20'
bb_gain12: '20'
bb_gain13: '20'
bb_gain14: '20'
bb_gain15: '20'
bb_gain16: '20'
bb_gain17: '20'
bb_gain18: '20'
bb_gain19: '20'
bb_gain2: '20'
bb_gain20: '20'
bb_gain21: '20'
bb_gain22: '20'
bb_gain23: '20'
bb_gain24: '20'
bb_gain25: '20'
bb_gain26: '20'
bb_gain27: '20'
bb_gain28: '20'
bb_gain29: '20'
bb_gain3: '20'
bb_gain30: '20'
bb_gain31: '20'
bb_gain4: '20'
bb_gain5: '20'
bb_gain6: '20'
bb_gain7: '20'
bb_gain8: '20'
bb_gain9: '20'
bw0: '0'
bw1: '0'
bw10: '0'
bw11: '0'
bw12: '0'
bw13: '0'
bw14: '0'
bw15: '0'
bw16: '0'
bw17: '0'
bw18: '0'
bw19: '0'
bw2: '0'
bw20: '0'
bw21: '0'
bw22: '0'
bw23: '0'
bw24: '0'
bw25: '0'
bw26: '0'
bw27: '0'
bw28: '0'
bw29: '0'
bw3: '0'
bw30: '0'
bw31: '0'
bw4: '0'
bw5: '0'
bw6: '0'
bw7: '0'
bw8: '0'
bw9: '0'
clock_source0: ''
clock_source1: ''
clock_source2: ''
clock_source3: ''
clock_source4: ''
clock_source5: ''
clock_source6: ''
clock_source7: ''
comment: ''
corr0: '0'
corr1: '0'
corr10: '0'
corr11: '0'
corr12: '0'
corr13: '0'
corr14: '0'
corr15: '0'
corr16: '0'
corr17: '0'
corr18: '0'
corr19: '0'
corr2: '0'
corr20: '0'
corr21: '0'
corr22: '0'
corr23: '0'
corr24: '0'
corr25: '0'
corr26: '0'
corr27: '0'
corr28: '0'
corr29: '0'
corr3: '0'
corr30: '0'
corr31: '0'
corr4: '0'
corr5: '0'
corr6: '0'
corr7: '0'
corr8: '0'
corr9: '0'
dc_offset_mode0: '0'
dc_offset_mode1: '0'
dc_offset_mode10: '0'
dc_offset_mode11: '0'
dc_offset_mode12: '0'
dc_offset_mode13: '0'
dc_offset_mode14: '0'
dc_offset_mode15: '0'
dc_offset_mode16: '0'
dc_offset_mode17: '0'
dc_offset_mode18: '0'
dc_offset_mode19: '0'
dc_offset_mode2: '0'
dc_offset_mode20: '0'
dc_offset_mode21: '0'
dc_offset_mode22: '0'
dc_offset_mode23: '0'
dc_offset_mode24: '0'
dc_offset_mode25: '0'
dc_offset_mode26: '0'
dc_offset_mode27: '0'
dc_offset_mode28: '0'
dc_offset_mode29: '0'
dc_offset_mode3: '0'
dc_offset_mode30: '0'
dc_offset_mode31: '0'
dc_offset_mode4: '0'
dc_offset_mode5: '0'
dc_offset_mode6: '0'
dc_offset_mode7: '0'
dc_offset_mode8: '0'
dc_offset_mode9: '0'
freq0: lo_freq * 1e6
freq1: 100e6
freq10: 100e6
freq11: 100e6
freq12: 100e6
freq13: 100e6
freq14: 100e6
freq15: 100e6
freq16: 100e6
freq17: 100e6
freq18: 100e6
freq19: 100e6
freq2: 100e6
freq20: 100e6
freq21: 100e6
freq22: 100e6
freq23: 100e6
freq24: 100e6
freq25: 100e6
freq26: 100e6
freq27: 100e6
freq28: 100e6
freq29: 100e6
freq3: 100e6
freq30: 100e6
freq31: 100e6
freq4: 100e6
freq5: 100e6
freq6: 100e6
freq7: 100e6
freq8: 100e6
freq9: 100e6
gain0: rx_gain
gain1: '10'
gain10: '10'
gain11: '10'
gain12: '10'
gain13: '10'
gain14: '10'
gain15: '10'
gain16: '10'
gain17: '10'
gain18: '10'
gain19: '10'
gain2: '10'
gain20: '10'
gain21: '10'
gain22: '10'
gain23: '10'
gain24: '10'
gain25: '10'
gain26: '10'
gain27: '10'
gain28: '10'
gain29: '10'
gain3: '10'
gain30: '10'
gain31: '10'
gain4: '10'
gain5: '10'
gain6: '10'
gain7: '10'
gain8: '10'
gain9: '10'
gain_mode0: 'False'
gain_mode1: 'False'
gain_mode10: 'False'
gain_mode11: 'False'
gain_mode12: 'False'
gain_mode13: 'False'
gain_mode14: 'False'
gain_mode15: 'False'
gain_mode16: 'False'
gain_mode17: 'False'
gain_mode18: 'False'
gain_mode19: 'False'
gain_mode2: 'False'
gain_mode20: 'False'
gain_mode21: 'False'
gain_mode22: 'False'
gain_mode23: 'False'
gain_mode24: 'False'
gain_mode25: 'False'
gain_mode26: 'False'
gain_mode27: 'False'
gain_mode28: 'False'
gain_mode29: 'False'
gain_mode3: 'False'
gain_mode30: 'False'
gain_mode31: 'False'
gain_mode4: 'False'
gain_mode5: 'False'
gain_mode6: 'False'
gain_mode7: 'False'
gain_mode8: 'False'
gain_mode9: 'False'
if_gain0: '20'
if_gain1: '20'
if_gain10: '20'
if_gain11: '20'
if_gain12: '20'
if_gain13: '20'
if_gain14: '20'
if_gain15: '20'
if_gain16: '20'
if_gain17: '20'
if_gain18: '20'
if_gain19: '20'
if_gain2: '20'
if_gain20: '20'
if_gain21: '20'
if_gain22: '20'
if_gain23: '20'
if_gain24: '20'
if_gain25: '20'
if_gain26: '20'
if_gain27: '20'
if_gain28: '20'
if_gain29: '20'
if_gain3: '20'
if_gain30: '20'
if_gain31: '20'
if_gain4: '20'
if_gain5: '20'
if_gain6: '20'
if_gain7: '20'
if_gain8: '20'
if_gain9: '20'
iq_balance_mode0: '0'
iq_balance_mode1: '0'
iq_balance_mode10: '0'
iq_balance_mode11: '0'
iq_balance_mode12: '0'
iq_balance_mode13: '0'
iq_balance_mode14: '0'
iq_balance_mode15: '0'
iq_balance_mode16: '0'
iq_balance_mode17: '0'
iq_balance_mode18: '0'
iq_balance_mode19: '0'
iq_balance_mode2: '0'
iq_balance_mode20: '0'
iq_balance_mode21: '0'
iq_balance_mode22: '0'
iq_balance_mode23: '0'
iq_balance_mode24: '0'
iq_balance_mode25: '0'
iq_balance_mode26: '0'
iq_balance_mode27: '0'
iq_balance_mode28: '0'
iq_balance_mode29: '0'
iq_balance_mode3: '0'
iq_balance_mode30: '0'
iq_balance_mode31: '0'
iq_balance_mode4: '0'
iq_balance_mode5: '0'
iq_balance_mode6: '0'
iq_balance_mode7: '0'
iq_balance_mode8: '0'
iq_balance_mode9: '0'
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
num_mboards: '1'
sample_rate: samp_rate * OVERSAMPLING
sync: sync
time_source0: ''
time_source1: ''
time_source2: ''
time_source3: ''
time_source4: ''
time_source5: ''
time_source6: ''
time_source7: ''
type: fc32
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [256, 332.0]
rotation: 0
state: disabled
- name: rx_port - name: rx_port
id: parameter id: parameter
parameters: parameters:
@@ -587,14 +913,14 @@ blocks:
alias: '' alias: ''
bias: 'False' bias: 'False'
bufflen: '16384' bufflen: '16384'
center_freq: lo_freq center_freq: lo_freq*1e6
comment: '' comment: ''
dev_args: '' dev_args: ''
freq_correction: '0' freq_correction: '0'
gain: '20' gain: rx_gain
maxoutbuf: '0' maxoutbuf: '0'
minoutbuf: '0' minoutbuf: '0'
samp_rate: samp_rate*OVERSAMPLING samp_rate: samp_rate
type: fc32 type: fc32
states: states:
bus_sink: false bus_sink: false
@@ -626,6 +952,8 @@ connections:
- [ONBEAT_Demod_1, '1', qtgui_eye_sink_x_0, '0'] - [ONBEAT_Demod_1, '1', qtgui_eye_sink_x_0, '0']
- [ONBEAT_Demod_1, '2', qtgui_time_sink_x_0, '0'] - [ONBEAT_Demod_1, '2', qtgui_time_sink_x_0, '0']
- [ONBEAT_Demod_1, out, network_socket_pdu_1, pdus] - [ONBEAT_Demod_1, out, network_socket_pdu_1, pdus]
- [rtlsdr_source_0, '0', ONBEAT_Demod_1, '0']
- [rtlsdr_source_0, '0', qtgui_freq_sink_x_0, '0']
- [soapy_rtlsdr_source_0, '0', ONBEAT_Demod_1, '0'] - [soapy_rtlsdr_source_0, '0', ONBEAT_Demod_1, '0']
- [soapy_rtlsdr_source_0, '0', qtgui_freq_sink_x_0, '0'] - [soapy_rtlsdr_source_0, '0', qtgui_freq_sink_x_0, '0']

View File

@@ -14,12 +14,14 @@ async def tcp_client():
port = 50002 port = 50002
reader, _ = await asyncio.open_connection( reader, _ = await asyncio.open_connection(
'127.0.0.1', port) '127.0.0.1', port)
output: list[tuple[Onbeat_Header, list[int]]] = [] # output: list[tuple[Onbeat_Header, list[int]]] = []
output: list[list[int]] = []
packet_loss = 0 packet_loss = 0
while message := await reader.read(PACKET_LEN): while message := await reader.read(PACKET_LEN):
try: try:
received = framing.decode_packet([i for i in message]) received = framing.decode_packet([i for i in message])
output.append(received) output.append([i for i in message])
print("pkt received")
if received[0].pkt_len == 0: if received[0].pkt_len == 0:
break break
except KeyboardInterrupt: except KeyboardInterrupt: