I’m noob with python and lora, I want to open a socket wait for a message, if there is no message then do something else, my code so far is:
from network import LoRa
import socket
import machine
import time
import binascii
import network
n = 0
try:
the_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
except:
exit('Error creating socket.')
the_sock.settimeout(5)
while True:
try:
n+=1
print("Hola"+str(n))
time.sleep(1)
the_sock.setblocking(True)
ack = the_sock.recv(HEADER_SIZE)
except socket.timeout, e:
err = e.args[0]
print(err)
break`
The problem is that the timeout it’s not working, I’ve checked some answers but the code looks good to me, can you help me please?
Kind Regards