packet_forwarder
packet_forwarder copied to clipboard
TX CONFIRMED
Hi, i set LORAWAN_CONFIRMED_MSG_ON to true (on node) but not see any confirmed message from packet forwarder. Can you epxlain how to use confirmed mode for node/forwarder ?
Thanks in advance
The network server will confirm the packet in a response downlink. The packet forwarder does not have the Session Keys to authenticate uplink or author downlink packets.
Better add comment before LORAWAN_CONFIRMED_MSG_ON // Not implemented and never set to true :) Confirm can means packet receive by gateway (first variant) and packet receive by network server (second variant). For first variant not need any Session Key. Only code in packet-forwarder.
LORAWAN_CONFIRMED_MSG_ON true does work correctly when connected to a network server. There is no need to add comments such //Not implemented and never set to true
If you just have a packet forwarder (not connected to a network server) and do not reply to the Confirmed message setting the ACK bit to 1 then the node will try to re-transmit it again the number of specified trials (Max 8 times).
I see packet-forwarder source and can't find any code for confirm message. Also I can't find any code in LoRaMac-node for confirmation replay.
Search for AckTimeout in src/mac/LoRaMac.c
The packet confirmation is handled by the network server and end-devices. The method is provided by the LoRaWAN protocol. You should not expect to find logic for confirmed messages in the packet forwarder. The packet forwarder is used to communicate with end-devices on the PHY layer.
The packet forwarder only forwards what it receives from the RF side to the network server side and from the network server side to the RF side. It doesn't manage acknowledgements nor LoRaWAN protocol.
The packet forwarder doesn't know anything about LoRaWAN. It is just a gateway/bridge.
On the LoRaMac-node project could you please take a closer look at the source code and you will find the Confirmed messages handling at several places. In plus in order to get the LoRaWAN certification the Confirmed messages must work.
Examples extracted from develop branch.
LoRaMac.c - void LoRaMacProcess( void )
- Line 1453
else if( MacCtx.McpsConfirm.McpsRequest == MCPS_CONFIRMED )
{
if( MacCtx.NvmCtx->AckTimeoutRetry == true )
{
stopRetransmission = CheckRetransConfirmedUplink( );
if( MacCtx.NvmCtx->Version.Fields.Minor == 0 )
{
if( stopRetransmission == false )
{
AckTimeoutRetriesProcess( );
}
else
{
AckTimeoutRetriesFinalize( );
}
}
}
else
{
waitForRetransmission = true;
}
}
LoRaMac.c - LoRaMacStatus_t LoRaMacMcpsRequest( McpsReq_t* mcpsRequest )
- Line 4262
case MCPS_CONFIRMED:
{
readyToSend = true;
MacCtx.NvmCtx->AckTimeoutRetries = mcpsRequest->Req.Confirmed.NbTrials;
macHdr.Bits.MType = FRAME_TYPE_DATA_CONFIRMED_UP;
fPort = mcpsRequest->Req.Confirmed.fPort;
fBuffer = mcpsRequest->Req.Confirmed.fBuffer;
fBufferSize = mcpsRequest->Req.Confirmed.fBufferSize;
datarate = mcpsRequest->Req.Confirmed.Datarate;
break;
}
Thanks !
Thank you for your inquiry.
Customers are encouraged to submit technical questions via our dedicated support portal at https://semtech.force.com/ldp/ldp_support.
We invite all users to visit the LoRa Developer Portal Forum at https://forum.lora-developers.semtech.com and to join the thriving LoRa development community!