How do I know whether a LoRa packet was successfoully sent?



  • Hi all!

    I'm working on a project based on a LoPy module.
    I'm able to join a network and send data trought a gateway (ABP authentication) without any problem.

    But if I try to send data without any gateway near my device, socket.send always return ok, even if
    the packet didn't reach any gateway.

    # init Lora, join, create socket, ecc above here
    
    while (True):
    
        pycom.rgbled(0x007f00)
        time.sleep(1)
        pycom.rgbled(0x000000)
    
        try:
    
            # send some data
            s.send(bytes([0x01, 0x02, 0x03]))
    
            print("Send ok")
    
            pycom.rgbled(0x00007f)
    
        except socket.timeout:
            # even without any active gateway, I never get any timeout. Why?
            print("Timeout send socket")
            pycom.rgbled(0x7f0000)
    
        except socket.error:
            # even without any active gateway, I never get any error. Why?
            print("Error send socket")
            pycom.rgbled(0x7f0000)
    
        time.sleep(1)
    

    How do I know if the packet was correctly sent to the LoRa network?
    Is there any way to know this? Or maybe LoRa doesn't provide any ack information
    about sent packets?

    Thanks.



  • @bmarkus If you exceed duty cycle limitations in your region, it's mainly illegal...



  • @jcaron said in How do I know whether a LoRa packet was successfoully sent?:

    @sriboli For unconfirmed frames, you have no idea if it got to the destination.

    For confirmed frames, the device will wait for an ACK, and will eventually retry several times.

    Note however that the ACK from the gateway to the devices will be counted in the duty cycle limitations for the gateway, so depending on your number of devices and traffic, you could very quickly reach the allowed limits. That's the reason most frames are sent unconfirmed. Depending on your region, the frequencies used, number of devices, traffic patterns, this may or may not be an issue for you.

    Well, generating heavy downlink traffic with ACK's is mainly not an issue for you bur for others.



  • Thankyou jcaron!
    I found this:

    https://forum.pycom.io/topic/2375/how-to-send-confirmed-data-pycom

    It should be the right way!

    Regards.



  • @sriboli For unconfirmed frames, you have no idea if it got to the destination.

    For confirmed frames, the device will wait for an ACK, and will eventually retry several times.

    Note however that the ACK from the gateway to the devices will be counted in the duty cycle limitations for the gateway, so depending on your number of devices and traffic, you could very quickly reach the allowed limits. That's the reason most frames are sent unconfirmed. Depending on your region, the frequencies used, number of devices, traffic patterns, this may or may not be an issue for you.



Pycom on Twitter