set receive_all and no wait send
This commit is contained in:
parent
c68c360abf
commit
1a089a38a1
6
main.py
6
main.py
|
@ -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()
|
Loading…
Reference in New Issue