how to send confirmed data pycom?
-
@administrators
@Pycom-Channel-Partnershow to send confirmed data pycom?
my code is
s.setsockopt(socket.SOL_LORA, socket.SO_DR, 3)
s.setblocking(True)
s.setblocking(False) # false로 되어있어야 recv가 가능
time.sleep(5.0)for i in range (200):
send = s.send(bytes([0x01, 0x02, 0x03]))
print('send_data: ', bytes([0x01, 0x02, 0x03]))
time.sleep(4)
rx = s.recv(64)
if rx:
print('recv_data: ',rx)
time.sleep(6)but this code is non-confirmed_data...
-
@john as described in the docs:
# selecting confirmed type of messages s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, True)Note that due to the bands limitations, there are often strict limits on how much confirmed packets you are allowed to send.
-
thank you!
I succeeded in sending confirmed data.
but, i don't know ack packet printing.
Do you know printing ack packet as lopy ??
this is my code
join process
.
.
.
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, True)
print('Sending...')
s.send("send pk #%d" %4)
time.sleep(40)
print(s.recv(12))but this code no output ..
-
You need to register a LoRa callback to work with the acknowledgements, i.e.:
lora.callback(LoRa.TX_FAILED_EVENT, handler=YourHandlerFunction, arg=None)
"If the ack is not received LoRa.TX_FAILED_EVENT will be raised after the number of tx_retries configured have been performed."
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login