i2s
xssfox 2025-07-07 14:07:42 +10:00
rodzic 425977bef6
commit 3a84f687f9
3 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -18,7 +18,7 @@ MYCALL=CHANGEME
# Wenet Transmission Centre Frequency:
# Default Wenet Frequency, as used on most Project Horus flights.
RXFREQ=443500000
RXFREQ=441200000
# Secondary downlink frequency, used on dual-launch flights
#RXFREQ=443500000
@ -34,7 +34,7 @@ BIAS=0
# building the rtl-sdr utils from this repo: https://github.com/rtlsdrblog/rtl-sdr
# drs232_ldpc (traditional) or wenet_ldpc (wenet v2)
FRAMING_MODE=wenet_ldpc
FRAMING_MODE=drs232_ldpc
# Change the following path as appropriate.
# If running this from a .desktop file, you may need to set an absolute path here
@ -69,11 +69,11 @@ RX_FLOW=IQ
#
# Modem Settings - Don't adjust these unless you really need to!
#
# TODO change back to traditional settings
BAUD_RATE=96000 # Baud rate, in symbols/second.
OVERSAMPLING=10 # FSK Demod Oversampling rate. Not used in GQRX mode.
BAUD_RATE=115177 # Baud rate, in symbols/second.
OVERSAMPLING=8 # FSK Demod Oversampling rate. Not used in GQRX mode.
# Known-Working Modem Settings:
# 115177 baud (Pi Zero W @ '115200' baud), 8x oversampling.
# 96000 baud (i2S wenet v2), 10x oversampling
# 9600 baud, 100x oversampling.
# 4800 baud, 200x oversampling.
#BAUD_RATE=4800

Wyświetl plik

@ -161,7 +161,10 @@ class PacketTX(object):
self.radio.transmit_packet(packet)
else:
self.radio.transmit_packet(self.idle_message)
time.sleep(0.1)
# time.sleep(0.1)
# commented this out as we should probably always be sending something
# this can cause gaps in i2s, which while won't hurt the performance can be annoying
# as the stream starts and stops
print("Closing Thread")
self.radio.shutdown()

Wyświetl plik

@ -96,9 +96,12 @@ class RFM98W(object):
deviation = 4800
elif self.baudrate == 4800:
deviation = 2400
else:
elif self.baudrate in [115177,115200]:
# Default deviation, for 115200 baud
# The origin of this number is unknown
deviation = 71797
else:
deviation = self.baudrate//2
# Refer https://cdn.sparkfun.com/assets/learn_tutorials/8/0/4/RFM95_96_97_98W.pdf
self.lora.set_register(0x01,0x00) # FSK Sleep Mode
@ -320,12 +323,8 @@ class RFM98W_I2S(RFM98W):
raise ValueError("Baudrate not suitable for soundcard.")
# fixed baudrate for the moment
super().__init__(spidevice,frequency,baudrate,tx_power_dbm,reinit_count,led=5) # can't use 21 for LED as I2S is there
if (
((self.audio_rate * self.channels * self.audio_width * 8) / self.baudrate)%8 !=0