use correct band
This commit is contained in:
parent
84f9619f8c
commit
43dffd6884
8
main.py
8
main.py
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user