subsys: function" lorawan_get_payload_sizes() " is it working properly? #99053
-
Describe the bugHello, In my Zephyr-based LoRaWAN application, I aim to keep our messages within roughly 80% of the 1% duty cycle limit to leave room for more time-critical transmissions. (with EU868) I'm using the " lorawan_get_payload_sizes() " function to check how much payload my device can send, but it seems like the result doesn't reflect duty cycle restrictions as we expected. Even when the function reports that I have bytes available, the MAC layer still blocks transmission due to duty cycle limitations. Is this expected behavior? Is lorawan_get_payload_sizes() not designed to account for duty cycle constraints? What would be the best way to accurately retrieve how much data we can send under current duty cycle conditions? Regression
Steps to reproduce
Relevant log outputCurrent Datarate: DR_0, Max payload for next: 242 byte, Max payload this datarate: 242 byte
[00:09:09.147,000] <err> lorawan: LoRaWAN Send failed: Duty-cycle restricted
ZEPHYR lorawan send failed: -111
[00:09:10.632,000] <inf> sensors: Sensor 1 value: 129.00
Current Datarate: DR_0, Max payload for next: 242 byte, Max payload this datarate: 242 byte
[00:09:11.882,000] <err> lorawan: LoRaWAN Send failed: Duty-cycle restricted
ZEPHYR lorawan send failed: -111
[00:09:13.367,000] <inf> sensors: Sensor 1 value: 129.00
Current Datarate: DR_0, Max payload for next: 242 byte, Max payload this datarate: 242 byte
[00:09:14.647,000] <err> lorawan: LoRaWAN Send failed: Duty-cycle restricted
ZEPHYR lorawan send failed: -111
[00:09:16.132,000] <inf> sensors: Sensor 1 value: 129.00
Current Datarate: DR_0, Max payload for next: 242 byte, Max payload this datarate: 242 byte
[00:09:17.382,000] <err> lorawan: LoRaWAN Send failed: Duty-cycle restricted
ZEPHYR lorawan send failed: -111
[00:09:18.867,000] <inf> sensors: Sensor 1 value: 27.00ImpactAnnoyance – Minor irritation; no significant impact on usability or functionality. Environment
Additional Context// lorawan_get_payload_sizes(.h file) Query the current payload sizes. The maximum payload size varies with @param max_next_payload_size Maximum payload size for the next transmission // lorawan_get_payload_sizes (.c file) }// typedef struct sLoRaMacTxInfo
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
|
Hi @ayunumm! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
Beta Was this translation helpful? Give feedback.
-
|
you are trying to send 242 bytes of data over LoRa every seconds and wondering why it is failing ?? |
Beta Was this translation helpful? Give feedback.

lorawan_get_payload_sizesis just a wrapper around the loramac-nodeLoRaMacQueryTxPossiblefunction.The documentation isn't super clear, but my understanding is that the function is only concerned with calculating the payload size based on the current datarate, and doesn't take into account any duty cycle limits.
i.e., it will tell you whether your 50 byte payload can ever be sent at the current data rate, just not whether it can be sent right now.