use correct band

This commit is contained in:
Alessandro Mauri 2026-09-20 12:15:56 +02:00
parent 84f9619f8c
commit 43dffd6884

View File

@ -424,24 +424,24 @@ def main():
print("LoRa module started")
print("Setting LoRa paramters")
band = "BAND_O"
band = "BAND_L"
spreading_factor = 7
coding_rate = 5
LoRa.setDio2RfSwitch(True)
LoRa.setModem(SX126x.LORA_MODEM)
LoRa.setFrequency(int(EU868_BANDS[band].freq_start_mhz*1_000_000 + EU868_BANDS[band].ch_bw_khz*1000/2))
LoRa.setBandwidth(EU868_BANDS[band].ch_bw_khz*1000)
#LoRa.setBandwidth(EU868_BANDS[band].ch_bw_khz*1000)
LoRa.setLoRaModulation(spreading_factor,EU868_BANDS[band].ch_bw_khz*1000, coding_rate, False)
LoRa.setTxPower(10, LoRa.TX_POWER_SX1262)
LoRa.setRxGain(LoRa.RX_GAIN_BOOSTED)
LoRa.setLoRaModulation(spreading_factor,EU868_BANDS[band].ch_bw_khz*1000, coding_rate, False)
LoRa.setHeaderType(LoRa.HEADER_EXPLICIT)
print("LoRa parameters set")
state_machine = LoRaGSStateMachine(LORA_GS_ID, LORA_FC_ID)
while True:
state = state_machine.step()
print(f"State: {state}")
print(f"State: {state.name}")
time.sleep(0.001)
LoRa.end()