BUG - Issue on max payload size RAK3172

Hi,
I found out that max payload size called N in the documentation does include the MAC commands.

I tried with a RAK3172 firmware version 1.0.4 and RUI_4.2.1 and DataRate0.

When I send a 51 bytes payload to my LoraWAN server it does not receive the payload if there is MAC commands inside the frame.
The server only receive a frame with MAC commands and an empty payload.

I tried to reduce the payload size according to MAC command size and then it worked, my server sends 4 “NewChannelReq” in the same downlink so I removed 8 bytes from the next payload and it worked.

For firmware 1.0.4 it does not say any error, it send the empty payload with the MAC commands.
For RUI_4.2.1 it says “AT_PARAM_ERROR”, sends the empty payload with the MAC commands and says “+EVT:TX_DONE”.
Then when there is no MAC commands to send it says “OK” then “+EVT:TX_DONE”.

Is it possible to know how many MAC commands will be sent into the next frame to calculate max payload size or correct the documentation to know the maximum allowable payload, MAC commands exluded?

Welcome to RAK forum @Gab ,

The maximum fopts size is 15bytes. This is variable depending on the MAC command size. Then add 1byte for the port.

If you will maximize the payload at DR0-2, you cannot send 51byte. But 51-16(fopts and fport substracted) = 35bytes.

Assuming that your device now is properly setup and no MAC commands is expected to be included, then you can maximize to 51 bytes on normal uplinks.

Let me check with our team this behavior on combining uplink payload and fopts.

Hi,

Thank you for your answer, I modified my program to take this into account.

Have you received an answer from your team about this behaviour?

Hi @Gab ,

I’ve got feedback from our R&D. The empty uplink you got means you exceeded the allowed payload by the LoRaWAN stack. This is expected behavior.

We are discussing possible improvement how to handle this.

But currently, you really need to take account of the fopts size before maximizing the number of bytes you will have on the uplink.