Closed artuguy closed 7 years ago
A few minutes ago , I discover on unconfirm mode node can get mcpsconfirm primitives, but on confirmed mode, node can not get mcpsconfirm primitives.
Hi artuguy,
thanks for your report. Which version are you using?
djaeckle: In case USE_BAND_433, on confirmed msg mode, McpsConfirm primitives can be got, ACK can be recieved, but USE_BAND_470, on confirmed msg mode, McpsConfirm primitives can not be got, ACK can not be recieved. I'm using V4.3.2 thanks
Hi artuguy,
so the LoRaMAC does not provide the McpsConfirm primitive at all in your case for confirmed uplinks?
djaeckle: it is, in USE_BAND_470 case , unconfirmed uplinks, McpsConfirm primitive can be got. if I use confirmed uplinks, McpsConfirm primitive can't be got . I'm using stm32l053 discovery board, with SX1278 . BR/Artuguy
Hi artuguy,
whats the value of the parameter Req.Confirmed.NbTrials
in your McpsReq_t
data structure?
djaeckle: Req.Confirmed.NbTrials = 8; as below: static bool SendFrame( void ) { McpsReq_t mcpsReq; LoRaMacTxInfo_t txInfo;
if( LoRaMacQueryTxPossible( AppDataSize, &txInfo ) != LORAMAC_STATUS_OK )
{
// Send empty frame in order to flush MAC commands
mcpsReq.Type = MCPS_UNCONFIRMED;
mcpsReq.Req.Unconfirmed.fBuffer = NULL;
mcpsReq.Req.Unconfirmed.fBufferSize = 0;
mcpsReq.Req.Unconfirmed.Datarate = LORAWAN_DEFAULT_DATARATE;
}
else
{
if( IsTxConfirmed == false )
{
mcpsReq.Type = MCPS_UNCONFIRMED;
mcpsReq.Req.Unconfirmed.fPort = AppPort;
mcpsReq.Req.Unconfirmed.fBuffer = AppData;
mcpsReq.Req.Unconfirmed.fBufferSize = AppDataSize;
mcpsReq.Req.Unconfirmed.Datarate = LORAWAN_DEFAULT_DATARATE;
}
else
{
mcpsReq.Type = MCPS_CONFIRMED;
mcpsReq.Req.Confirmed.fPort = AppPort;
mcpsReq.Req.Confirmed.fBuffer = AppData;
mcpsReq.Req.Confirmed.fBufferSize = AppDataSize;
mcpsReq.Req.Confirmed.NbTrials = 8;
mcpsReq.Req.Confirmed.Datarate = LORAWAN_DEFAULT_DATARATE;
}
}
if( LoRaMacMcpsRequest( &mcpsReq ) == LORAMAC_STATUS_OK )
{
return false;
}
return true;
}
Hi artuguy,
does the MAC perform the frame repetitions for confirmed uplinks correctly?
djaeckle: Yes, MAC send packet repeatly for 8 times, it is correct , looking from base station web page .
djaeckle: On USE_BAND_470, I have mask some channels for the base station has not them. as bellow: LoRaMacParamsDefaults.ChannelsMask[0] = 0x3FC0; LoRaMacParamsDefaults.ChannelsMask[1] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[2] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[3] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[4] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[5] = 0x0000;
Does it matter?
Hi artuguy,
what happens after the 8 uplinks? Is the node running? Could you please provide some details about the software state?
djaeckle: On USE_BAND_470, I recover the LoRaMacParamsDefaults.ChannelsMask[] to 0xFFFF this morning , Same as before. After the 8 uplinks, node is running, fCnt ++. log data from base station as below:
"txInfo":{"frequency":471500000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0, "fPort":2,"data":"yw=="}
"txInfo":{"frequency":472100000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0, "fPort":2,"data":"yw=="}
"txInfo":{"frequency":472700000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0, "fPort":2,"data":"yw=="}
"txInfo":{"frequency":472700000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":471700000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":472900000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":472100000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":471900000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":0,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":472300000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":1,"fPort":2,"data":"yw=="}
"txInfo":{"frequency":471700000,"dataRate":{"modulation":"LORA","bandwidth":125,"spreadFactor":12},"adr":true,"codeRate":"4/5"},"fCnt":1,"fPort":2,"data":"yw=="}
BR/Artuguy
Thanks for the input. Based on your log information, the node works correctly - it starts the repetitions since it don't receives an ACK and increases the fCnt after 8 frames.
To get a bigger picture of your issue, I would like to request some more information from you:
mcpsConfirm->Status
unequal to LORAMAC_EVENT_INFO_STATUS_OK
.djaeckle:
I use LSI as RTC clock source instead of LSE. RTC config as below:
#define N_PREDIV_S 11
#define PREDIV_S ( ( 1 << N_PREDIV_S ) - 1 )
#define PREDIV_A 17 //( 1 << ( 15 - N_PREDIV_S ) ) - 1
#define RTC_ALARM_TIME_BASE (18000/37) //( USEC_NUMBER >> N_PREDIV_S )
#define CONV_NUMER 18
#define CONV_DENOM 37
djaeckle: On Region_CN470, I find MAC provide a McpsConfirm after 8 times uplink. it seems like node has not recieved a ACK, base station should apply ACK with the same RF.
JSON up: {"rxpk":[{"tmst":1776882308,"chan":7,"rfch":0,"freq":472.100000,"stat":1,"modu":"LORA","datr":"SF12BW125","codr":"4/5","lsnr":5.2,"rssi":-28,"size":14,"data":"gAEQCBeADwACO/mvAIc="}]} INFO: [up] PUSH_ACK received in 1 ms INFO: [down] PULL_RESP received - token[0:0] :)
JSON down: {"txpk":{"imme":false,"tmst":1777882308,"freq":472.1,"rfch":0,"powe":14,"modu":"LORA","datr":"SF12BW125","codr":"4/5","ipol":true,"size":12,"data":"YAEQCBcgUgWLx8hB"}} INFO: tx_start_delay=1495 (1495.500000) - (1497, bw_delay=1.500000, notch_delay=0.000000) INFO: [down] PULL_ACK received in 0 ms
How do I adjust the recieve frequency to the correct one?
thanks
djaeckle: Got it, change RegionCN470.h as below:
//#define CN470_FIRST_RX1_CHANNEL ( (uint32_t) 500300000 )
//#define CN470_LAST_RX1_CHANNEL ( (uint32_t) 509700000 )
You can close this issue. Thanks BR/Artuguy
Hi artuguy,
nice to hear that it works now. Thanks for the feedback.
Hi: I'm debugging the confirmed msg, when i USE_BAND_470 , seems like class A node can't recieve ACK, it re-sent packet for 8 times, but from base station web page ack was sent. when i USE_BAND_433, class A node sent packet once only. How can I test if node recieved the ACK? some detail is
define LORAMAC_FIRST_RX1_CHANNEL ( (uint32_t) 500.3e6 )
define RX_WND_2_CHANNEL { 505300000, DR_0 }
base station global_conf.json:
{ "SX1301_conf": { "lorawan_public": true, "clksrc": 1, "antenna_gain": 0, "radio_0": { "enable": true, "type": "SX1255", "freq": 471800000, "rssi_offset": -176.0, "tx_enable": true, "tx_freq_min": 470000000, "tx_freq_max": 510000000 }, "radio_1": { "enable": true, "type": "SX1255", "freq": 472600000, "rssi_offset": -176.0, "tx_enable": false },
}
thanks