From 0f4f05af0313c0a697dae13e22213ba70dac248c Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Fri, 5 Dec 2025 15:22:31 +0100 Subject: [PATCH] fix(tx): minor corrections and improvements --- onbeat_tx.grc | 90 ++++++++++++++++++++++++++++++++++++++++++-- onbeat_tx_wrapper.py | 17 +++++---- 2 files changed, 95 insertions(+), 12 deletions(-) diff --git a/onbeat_tx.grc b/onbeat_tx.grc index 5217a66..9df169b 100644 --- a/onbeat_tx.grc +++ b/onbeat_tx.grc @@ -37,7 +37,7 @@ blocks: id: variable parameters: comment: '' - value: '10' + value: '100' states: bus_sink: false bus_source: false @@ -110,7 +110,7 @@ blocks: affinity: '' alias: '' comment: '' - data_len: '' + data_len: '1' maxoutbuf: '0' minoutbuf: '0' preamble: '[0x33 for i in range(0, 128*2, 8)]' @@ -127,7 +127,7 @@ blocks: parameters: affinity: '' alias: '' - attenuation1: '10.0' + attenuation1: '5.0' bandwidth: '20000000' buffer_size: '32768' comment: '' @@ -145,7 +145,7 @@ blocks: bus_sink: false bus_source: false bus_structure: null - coordinate: [1176, 156.0] + coordinate: [1168, 148.0] rotation: 0 state: true - name: network_socket_pdu_1 @@ -185,6 +185,87 @@ blocks: coordinate: [608, 208.0] rotation: 0 state: enabled +- name: qtgui_freq_sink_x_0 + id: qtgui_freq_sink_x + parameters: + affinity: '' + alias: '' + alpha1: '1.0' + alpha10: '1.0' + alpha2: '1.0' + alpha3: '1.0' + alpha4: '1.0' + alpha5: '1.0' + alpha6: '1.0' + alpha7: '1.0' + alpha8: '1.0' + alpha9: '1.0' + autoscale: 'False' + average: '1.0' + axislabels: 'True' + bw: samp_rate + color1: '"blue"' + color10: '"dark blue"' + color2: '"red"' + color3: '"green"' + color4: '"black"' + color5: '"cyan"' + color6: '"magenta"' + color7: '"yellow"' + color8: '"dark red"' + color9: '"dark green"' + comment: '' + ctrlpanel: 'False' + fc: lo_freq * 1e6 + fftsize: '1024' + freqhalf: 'True' + grid: 'False' + gui_hint: '' + label: Relative Gain + label1: '' + label10: '''''' + label2: '''''' + label3: '''''' + label4: '''''' + label5: '''''' + label6: '''''' + label7: '''''' + label8: '''''' + label9: '''''' + legend: 'True' + maxoutbuf: '0' + minoutbuf: '0' + name: '""' + nconnections: '1' + norm_window: 'False' + showports: 'False' + tr_chan: '0' + tr_level: '0.0' + tr_mode: qtgui.TRIG_MODE_FREE + tr_tag: '""' + type: complex + units: dB + update_time: '0.10' + width1: '1' + width10: '1' + width2: '1' + width3: '1' + width4: '1' + width5: '1' + width6: '1' + width7: '1' + width8: '1' + width9: '1' + wintype: window.WIN_BLACKMAN_hARRIS + ymax: '10' + ymin: '-140' + states: + bus_sink: false + bus_source: false + bus_structure: null + coordinate: [1176, 340.0] + rotation: 0 + state: true - name: syncword id: parameter parameters: @@ -222,6 +303,7 @@ blocks: connections: - [ONBEAT_Mod_0, '0', iio_pluto_sink_0, '0'] +- [ONBEAT_Mod_0, '0', qtgui_freq_sink_x_0, '0'] - [network_socket_pdu_1, pdus, pdu_pdu_to_tagged_stream_0, pdus] - [pdu_pdu_to_tagged_stream_0, '0', ONBEAT_Mod_0, '0'] diff --git a/onbeat_tx_wrapper.py b/onbeat_tx_wrapper.py index a0fc753..1804a70 100644 --- a/onbeat_tx_wrapper.py +++ b/onbeat_tx_wrapper.py @@ -21,25 +21,26 @@ async def tcp_client(file_2_send: str, callsign: str, rs_coding: bool = True): try: while message := file_to_send.read(DATA_LEN if rs_coding == True else (PACKET_LEN - HEADER_LEN)): sent.append([i for i in message]) - frame = bytes(framing.encode_packet([i for i in message], callsign, seq, rs_coding)) + frame = bytes(framing.encode_packet([i for i in message], callsign, seq%256, rs_coding)) writer.write(frame) seq += 1 - sleep(0.1) + print(seq) + sleep(0.01) else: - frame = bytes(framing.encode_packet([], callsign, seq, rs_coding)) - for _ in range(0,16): + frame = bytes(framing.encode_packet([], callsign, seq%256, rs_coding)) + for _ in range(0,4): writer.write(frame) - sleep(0.1) + sleep(0.01) sent.append([]) except KeyboardInterrupt: return sent -rs_coding = False -filename = "loremipsum" +rs_coding = True +filename = "/home/lacko/live_output/2025-11-01_12-39_elektro_lrit_1.691 GHz/IMAGES/ELEKTRO-L3/2025-11-01_12-30-00/msu_gs_Color IR Merge.png" sent = asyncio.run(tcp_client(filename, "HA5PLS", rs_coding)) -with open("packets.json") as packetfile: +with open("packets.json", mode="w") as packetfile: json.dump(sent, packetfile)