Hi,
大家好,目前在应用rfWsnConcentrator过程中发现rxDoneCallback中程序会隔一段时间显示status = EasyLink_Status_Rx_Error,
if (EasyLink_cmdPropRxAdv.status == PROP_DONE_OK)//RF_cmdPropRx EasyLink_cmdPropRxAdv{//Check that data entry status indicates it is finished withif (pDataEntry->status != DATA_ENTRY_FINISHED)//错误地点{status = EasyLink_Status_Rx_Error;}else if ( (rxStatistics.nRxOk == 1) ||//or filer disabled and ignore due to addr mistmatch((EasyLink_cmdPropRxAdv.pktConf.filterOp == 1) &&//RF_cmdPropRx EasyLink_cmdPropRxAdv(rxStatistics.nRxIgnored == 1)) ){//copy length from pDataEntryrxPacket.len = *(uint8_t*)(&pDataEntry->data) - addrSize;//copy address from packet payload (as it is not in hdr)memcpy(&rxPacket.dstAddr, (&pDataEntry->data + 1), addrSize);//copy payloadmemcpy(&rxPacket.payload, (&pDataEntry->data + 1 + addrSize), rxPacket.len);rxPacket.rssi = rxStatistics.lastRssi;rxPacket.absTime = rxStatistics.timeStamp;status = EasyLink_Status_Success;}else if ( rxStatistics.nRxBufFull == 1){status = EasyLink_Status_Rx_Buffer_Error;}else if ( rxStatistics.nRxStopped == 1){status = EasyLink_Status_Aborted;}else{status = EasyLink_Status_Rx_Error;}}else if ( EasyLink_cmdPropRxAdv.status == PROP_DONE_RXTIMEOUT){status = EasyLink_Status_Rx_Timeout;}else{status = EasyLink_Status_Rx_Error;//返回接收错误}
其中EasyLink_cmdPropRxAdv.status = 0x3406,//Operation ended after receiving packet with CRC error,rxStatistics.nRxOk=0,rxStatistics.nRxOk =0,rxStatistics.nRxIgnored = 0,查询资料说可能是接收数据较多阻塞造成的。目前node程序应用实时采集数据,300ms发送一次(数据长度96字节)。另外不能进行延时处理,否则接收端会有数据延时,减少数据量但发送时间会缩短,该问题也会出现。
请问
1.该错误是如何造成的?
2.有什么思路进行解决该问题呢?
谢谢!
Alvin Chen:
你是否有太多设备在你的网络中,如果你只是测试可以适当的减小数据量,应会有所改善。
你可以在发送这个错误时调用 Easylink_transmitCcaAsync()
这个通常是拥堵造成的,你可以参考rfEasylinkListenBeforeTalk使用 CcaAsync API:Easylink_transmitCcaAsync
Mings Liu:
回复 Alvin Chen:
非常感谢Alvin Chen,
设备加入的不多,测试在两个node加入就会出现阻塞问题。
我查看了LBT功能,该功能是传输任何数据包之前评估通信通道,radio将首先进入RX模式来评估信道,如果它空闲5毫秒,它将继续传输一个数据包。按照说明应该是在concentrator加入该功能,node端也需要加入吗?
另外,请问LBT支持433MHz吗?
谢谢!
Alvin Chen:
回复 Mings Liu:
都需要加入的,支持的。
Mings Liu:
回复 Alvin Chen:
Hi Alvin Chen,
根据rfEasyLinkListenBeforeTalk对rfwsnnode进行应用EasyLink_transmitCcaAsync,在ccaDoneCallback中出现了pCmd->status = 0x340A,///< Carrier sense operation ended because of timeout with csConf.timeoutRes = 0。
修改如下:
/* Set destination address in EasyLink API */currentRadioOperation.easyLinkTxPacket.dstAddr[0] = RADIO_CONCENTRATOR_ADDRESS;/* Copy ADC packet to payload* Note that the EasyLink API will implcitily both add the length byte and the destination address byte. */currentRadioOperation.easyLinkTxPacket.payload[0] = sensorPacket->header.sourceAddress;currentRadioOperation.easyLinkTxPacket.payload[1] = sensorPacket->header.packetType;memcpy((currentRadioOperation.easyLinkTxPacket.payload+2), ((uint8_t*)&sensorPacket->adcValue), sizeof(sensorPacket->adcValue));currentRadioOperation.easyLinkTxPacket.len = sizeof(struct DualModeSensorPacket);//sensorPacket.adcValue/* Setup retries */currentRadioOperation.maxNumberOfRetries = maxNumberOfRetries;currentRadioOperation.ackTimeoutMs = ackTimeoutMs;currentRadioOperation.retriesDone = 0;EasyLink_setCtrl(EasyLink_Ctrl_AsyncRx_TimeOut, EasyLink_ms_To_RadioTime(ackTimeoutMs));if(EasyLink_transmitCcaAsync(¤tRadioOperation.easyLinkTxPacket, lbtDoneCb) != EasyLink_Status_Success){System_abort("EasyLink_transmit failed");}/* Wait forever for TX to complete */Semaphore_pend(lbtDoneSem, BIOS_WAIT_FOREVER);void lbtDoneCb(EasyLink_Status status) {if (status == EasyLink_Status_Success){/* Enter RX */if (EasyLink_receiveAsync(rxDoneCallback, 0) != EasyLink_Status_Success){}}else if (status == EasyLink_Status_Busy_Error){Event_post(radioOperationEventHandle, RADIO_EVENT_ACK_TIMEOUT);}else{Event_post(radioOperationEventHandle, RADIO_EVENT_ACK_TIMEOUT);}Semaphore_post(lbtDoneSem);}因为超时造成载波监测终止,这个是哪个参数影响的呢?
谢谢!
Alvin Chen:
回复 Mings Liu:
没有什么太多经验关于这个,你以尝试使用CMD_PROP_CS
e2e.ti.com/…/777012