SOLVED: LoPy, OTAA, Downlink message always repeated
I am experiencing an issue with the online console "Downlink" payload in the TTN console. I have a LoPy connected to my application on TTN and it is sending uplink payloads correctly.
I have setup a test payload (0xCAFEBABE) in the Downlink-section of the 'Overview'-section of my device. The Downlink message is received by the LoPy correctly, but now TTN always repeats the same downlink payload upon each received uplink message sent by the LoPy to the application. I am offending the fair use policy here obviously, and would like to get rid of the cafebabe now ;-) It looks like she's stalking me duh.
I have been looking everywhere, but cannot seem to find a resolution. Do I need to ack the downlink payload manually in my micro pythons code on the LoPy? Do I need to register a lora callback function for this to work? I'm in the dark here.
My code for the sending of the payload from LoPy to TTN and reverse:
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) s.setsockopt(socket.SOL_LORA, socket.SO_DR, 5) # Tried both False and True for SO_CONFIRMED, same issue s.setsockopt(socket.SOL_LORA, socket.SO_CONFIRMED, False) s.setblocking(True) s.send(uplink_payload) s.setblocking(False) downlink_payload = s.recv(64) lora.nvram_save() #Tried a time.sleep(10) here, I was thinking # maybe the radio needs time to send the ack back to TTN for downlink, # but it did not help machine.deepsleep(300*1000)
Thanks Meirssv for posting a solution. Had the same problem. Funny thing is that TTN only repeats the downlink payload on my LoPy module and not on my Microchip RN2483 module. It's like a downlink handshake from LoPy is missing, so TTN repeats queueing the payload. Can't find any documentation on downlink acknowledgements though. Anyway it works now thanks to your reply.
I got rid of it by entering the downlink payload again on the TTN console, choosing 'last' and not selecting 'confirmed'. After this the downlink payload was sent for the last time...
TTN Console documentation is not really clear on this topic... Anyhow, I got rid of the cafebabe. :-)