LoRaMac-node
LoRaMac-node copied to clipboard
Add possibility to send uplinks with FPort and without FRMPayload
Discussed in https://github.com/Lora-net/LoRaMac-node/discussions/1328
Originally posted by janakj July 1, 2022 I was trying to send an empty confirmed uplink the other day and realized that this is not really reliably supported by LoRaMac-node. My intended application was configuration polling. The device would send an empty uplink to a specific port number and receive configuration via the downlink.
As it turns out, LoRaMac-node would internally change the port number to 0 if it has any MAC commands waiting to be piggybacked in order to be able to put those in the message payload. The original port number is lost in this case. Another odd behavior that I ran into was that even if there were no MAC commands waiting, empty confirmed uplinks would not be retransmitted.
This makes me wonder whether empty uplinks are supported by LoRaMac-node. I quickly skimmed the LoRaWAN specification and found nothing that would prohibit those, so maybe this is an implementation limitation? If LoRaMac-node cannot reliably send empty uplinks, maybe it should report an error to the application? Or perhaps the handling of piggybacked MAC commands should be left to the application instead so that empty uplinks to non-zero port numbers could be supported?
Not a critical problem, I am just wondering what the intended behavior is in this corner case.
@janakj Could you please propose a pull-request to add the possibility to send empty FRMPayload with FPort being present in the uplink frame?