# convert fsk4rx horus json output to sondehub uploader stdin format and listen demodulated ssb audio # python3 horuswrap.py | python3 uploader.py --payload-list payload_id_list.txt --freq_hz=434714000 # mknod a.wav p # rtl_sdr -f 434.6m -s 1024000 - | ./fsk4rx -i /dev/stdin -f u8 -v -r 1024000 -t 114000 -S a.wav -J 127.0.0.1:5000 # aplay a.wav # sorry about broken sound as aplay (or alsa?) looses a lot of samples on a underrun causing more underrun, try "ctrl-z" and "fg" import json, base64, socket PORT=5000 IP=("0.0.0.0",PORT) sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) sock.bind(IP) while True: data, addr=sock.recvfrom(1500) # print(data) try: obj = json.loads(data.decode()) # print(obj) payload=base64.b64decode(obj["payload"]) #base64 coded raw frame # print("payload=", payload) except: print("json decode error") else: if obj["crc"]==1: print('{"EbNodB":', obj["snr"]-8.0, ',"ppm":', obj["ppm"], ',"f1_est":', obj["afc"]-405, ',"f2_est":', obj["afc"]-135, ',"f3_est":', obj["afc"]+135, ',"f4_est":', obj["afc"]+405, ',"samp_fft":0','}') fmt = '{:02X}' * len(payload) print(fmt.format(*payload),flush=True) # tryed to get snr compatible, fsk4rx uses modulation bandwidth as noise reference, sondehub seems to use ssb bandwidth # no fft data as there is no fft in fsk4rx