Replies: 4 comments
-
While this does seem to be disadvantageous behavior, it's not a "bug" but rather things happening in accordance with how the LoRaWAN spec says they should, eg, if there's a "bug", it's in the design of LoRaWAN, not the code. One mitigation is to find the aspect of the code that limits how many times the node will try to uplink before giving up on that message - but this is wasteful, as if it misses the solitary ack that will be generated, it can never get another until it increments the uplink frame count, so any number of retries are wasted when it's the ack and not the uplink that got lost. Typically the better approach is to ignore the fact that LoRaWAN even offers "confirmed uplink" and do your own confirmation at application level. Keep in mind that transmitting even just an ACK is very "expensive" of gateway capacity, so should only be used where you really need it. But if you are going to try to get an ACK, and then to resend, do you really want to be resending what is probably increasingly stale data? Or do you want to send new, fresher measurements? Doing your own ACKs at application level gives you the most flexibility to decide. It also implicitly means that you're acking the success of the complete path through to your data backend, not just between the node and the network server. And because each application level packet has a unique frame count, the network server won't start ignoring your retries but will rather pass each through to your data consumer. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your detailed answer, I read something similar in another post, I just didn't understand it correctly back then. I believe what you call stale data might be quite valuable, depending on the application, since the history of data that has been passed can be as important as fresh data. In any case, there is always the possibility to save the data and resend in a new packet. For now I think I will send a complete new packet with new data if the first was not ACK. It would be great to have an EVENT in the library that fires up if the RX windows are closed, after sending a confirmed uplink. |
Beta Was this translation helpful? Give feedback.
-
Keep in mind you'll quickly burn up your TTN downlink allowance if you try to ack every uplink. If I recall, you are not supposed to send more than 10 downlinks a day, and yes, ack's count as downlinks, no matter if they are MAC level acks generated from the protocol, or application-level. The real cost to the network is taking a gateway out of receive mode to send a downlink at all, and sending the 13 bytes of protocol overhead; if you then send a byte or two of application data, or not, is scarcely relevant. |
Beta Was this translation helpful? Give feedback.
-
There are such events, but they're not sent on the low-level event API.. You should wait until you get the callback from a send-with-callback function. Until that happens, the LMIC is busy doing a transmit. You can't take TXCOMPLETE as meaning LMIC is idle; you have to look at all the flags (or better, use the callback version of the API which will check the calls for you). Your description sounds like you might be trying to transmit while the LMIC is busy; it will just fail your request. You need to check the return code from the send API you're happening to use. |
Beta Was this translation helpful? Give feedback.
-
Describe your question or issue
Hi! Thank you for a great work with this library:)
Issue:
When I send a confirmed uplink from the node and the downlink ack is not received, the subsequent uplinks sent are being dropped by the gateway. Using LMIC_setTxData2.
The first uplink:
The downlink sent by the gateway, which was not received by the node:
So then the node sends a second uplink:
So then the gateway drops the uplink message with a Device not found error:
This issue only happens sometimes, usually the node is able to receive the Ack.
The node sends 8 uplinks in total, until it triggers the EV_TXCOMPLETE, without receiving any ack.
Are there some details that should be updated like the frame counter?
I have tried to update the uplink sequence number, after EV_TXSTART with:
but with no success of the gateway to accept the subsequent messages.
I am joining the network with OTAA.
Is there something I am missing in my code, or should the library take this into account?
I have made a post on the TTN forum before, that you can read here:
TTN forum post
Environment
Beta Was this translation helpful? Give feedback.
All reactions