set receive_all and no wait send

This commit is contained in:
Paul 2024-01-08 16:50:08 +01:00
parent c68c360abf
commit 1a089a38a1
1 changed files with 3 additions and 3 deletions

View File

@ -18,11 +18,11 @@ time.sleep(1)
ser = serial.serial_for_url(addr)
def on_recv(payload):
print(f'Received lora byte: {payload.message}')
print(f'Received lora data: {payload.message}')
ser.write(payload.message)
lora_address = 2
lora = LoRa(1, 5, lora_address, reset_pin = 25, modem_config=ModemConfig.Bw125Cr45Sf128, tx_power=14, acks=True)
lora = LoRa(1, 5, lora_address, reset_pin = 25, modem_config=ModemConfig.Bw125Cr45Sf128, tx_power=14, receive_all=True)
lora.on_recv = on_recv
while True:
@ -34,6 +34,6 @@ while True:
pass
else:
print(f'Received serial data: {ser_data}')
lora.send_to_wait(bytes(ser_data), 255, retries=2)
lora.send(bytes(ser_data), 255)
socat_proc.kill()