TX_FAILED_EVENT not triggered
I have setup my lora.callback to to handle TX_FAILED_EVENT trigger as per examples on Pycom site. I have been trying to test using following method.
- Send command to lopy4 to uplink data to server (this works fine). I have set socket to uplink confirmed messages.
- I have set a delay of 15 seconds from receiving command to send uplink and beginning transmission.
- After seeing on the serial console that node has received command I pull the plug on my gateway before node starts transmitting.
- I expect to see that TX_FAILED_EVENT event is triggered as node will not receive any ACK from server. However it appears the event is never triggered evidenced by no messages printed to console from theTX_FAILED_EVENT.
Here is the event code below.
if events & LoRa.TX_FAILED_EVENT: print("TX Failed. ACK not received after 1 retries") print("Reset") pycom.rgbled(0xFFFFFF) lora.nvram_erase() # this should force a rejoin of network time.sleep(2.5) machine.reset() # TX failed so try and rejoin network by resetting
Any help gratefully received.
@berryskies My bad! Stupid error (as usual?). I misread the socket.SO_CONFIRMED option. I thought this was a constant boolean and didn't set the trailing 0 to 1 (slap to forehead). All working as expected.