Part Number: CC1310
Other Parts Discussed in Thread: SIMPLELINK-CC13X0-SDK
Tool/software: Code Composer Studio
Hey guys,
I just noticed something really strange. I use sensor collectorTi15.4 stack example in non-beacon mode. I made a network for testing purpose consisting of 6 sensors and one collector although I limited the network to only 5 sensors. In my code I have two features.
- The collector disconnects a sensor if it is not answering to tracking messages
- I print a list of all connected sensors once in a while including short and extended address, directly from the NV memory
Here the code for disconnection and sensor list printing:
void Csf_deviceNotActiveUpdate(ApiMac_deviceDescriptor_t *pDevInfo,
bool timeout)
{
//______________________MY CHANGE START___________________________
LCD_WRITE_STRING_VALUE("!Resp: 0x", pDevInfo->shortAddress, 16, 5);
#ifdef TRACKING_DELAY_DISC
/* Remove device from NV */
Llc_deviceListItem_t item;
ApiMac_sAddr_t devAddr;
devAddr.addrMode = ApiMac_addrType_short;
devAddr.addr.shortAddr = pDevInfo->shortAddress;
Csf_getDevice(&devAddr, &item);
Cllc_removeDevice(&item.devInfo.extAddress);
System_printf("ReS: 0x%02x | ", pDevInfo->shortAddress);
print_extAddress(item.devInfo.extAddress);
#endif
//_____________________MY CHANGE END______________________________
#if defined(MT_CSF)
MTCSF_deviceNotActiveIndCB(pDevInfo, timeout);
#endif
}
void Csf_printSensorList(void)
{
/* Sli = Sensor list */
System_printf("Sli\r\n");
int x;
Llc_deviceListItem_t item;
ApiMac_sAddr_t devAddr;
devAddr.addrMode = ApiMac_addrType_short;
for(x = 0; x < CONFIG_MAX_DEVICES; x++)
{
if(Cllc_associatedDevList[x].shortAddr != CSF_INVALID_SHORT_ADDR)
{
devAddr.addr.shortAddr = Cllc_associatedDevList[x].shortAddr;
if(Csf_getDevice(&devAddr, &item))
{
System_printf("0x%02x | ", devAddr.addr.shortAddr);
print_extAddress(item.devInfo.extAddress);
}
}
}
System_printf("NumS: %d\r\n", Csf_getNumDeviceListEntries());
}
#endif
Now look at the UART print what happened. Note, Sli indicates the start of the list, !Resp: 0x05 indicates the kick of the sensor, PJ-ON means the network is open again for another sensor (the 6th sensor now joining). STr means "send tracking request to sensor 06". The next two lines are one sensor data message being processed by the collector: MAC address, and then one line with info. newD means new device is joining, PJ-OFF means the network is closed again. PTr means the collector received a tracking response and is processing it.
So, a sensor gets kicked (I removed the battery so it could not answer tracking requests), but before a new sensor can join, a message is received by the collector, afteerwards the new sensor joins. The new sensor gets an already in use short address and is stored incorrectly with another extended address which corresponds to the wrong short address.
Sli
0x01 | 27:49:76:19:00:4b:12:00
0x02 | 67:49:76:19:00:4b:12:00
0x04 | 1d:44:76:19:00:4b:12:00
0x05 | 7c:49:76:19:00:4b:12:00
0x06 | 7d:49:76:19:00:4b:12:00
NumS: 5
!Resp: 0x5
PJ-ON
ReS: 0x05 | 7c:49:76:19:00:4b:12:00
STr 06
MAC: 7d:49:76:19:00:4b:12:00
AMA 9:1;0;0;0;0;0;0;0;0;
newD
joinD: 0x06 | 5a:49:76:19:00:4b:12:00
PJ-OFF
PTr 06
MAC: 5a:49:76:19:00:4b:12:00
AMA 26:0;0;0;0;0;0;0;5;2;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;
Sli
0x01 | 27:49:76:19:00:4b:12:00
0x02 | 67:49:76:19:00:4b:12:00
0x04 | 1d:44:76:19:00:4b:12:00
0x06 | 7d:49:76:19:00:4b:12:00
0x06 | 7d:49:76:19:00:4b:12:00
NumS: 5
ConfigRsp: 0x6
Here the code for the "joinD... line"
static ApiMac_assocStatus_t cllcDeviceJoiningCB(
ApiMac_deviceDescriptor_t *pDevInfo,
ApiMac_capabilityInfo_t *pCapInfo)
{
//_____________MY CHANGE START_________________
#ifdef STATUS_MSG
System_printf("joinD: ");
System_printf("0x%02x | ",(uint16_t) pDevInfo->shortAddress);
print_extAddress(pDevInfo->extAddress);
#endif
//_____________MY CHANGE END___________________
The interesting thing is, that disconnecting and rejoining usually works fine like here (including timestamps):
24.11.2019 22:37:20 0x01 | 27:49:76:19:00:4b:12:00
24.11.2019 22:37:20 0x02 | 67:49:76:19:00:4b:12:00
24.11.2019 22:37:20 0x04 | 1d:44:76:19:00:4b:12:00
24.11.2019 22:37:20 0x07 | 7d:49:76:19:00:4b:12:00
24.11.2019 22:37:20 0x08 | 5a:49:76:19:00:4b:12:00
24.11.2019 22:37:21 NumS: 5
24.11.2019 22:37:39 !Resp: 0x7
24.11.2019 22:37:39 PJ-ON
24.11.2019 22:37:39 ReS: 0x07 | 7d:49:76:19:00:4b:12:00
24.11.2019 22:37:39 STr 08
24.11.2019 22:37:40 Sli
24.11.2019 22:37:40 0x01 | 27:49:76:19:00:4b:12:00
24.11.2019 22:37:40 0x02 | 67:49:76:19:00:4b:12:00
24.11.2019 22:37:40 0x04 | 1d:44:76:19:00:4b:12:00
24.11.2019 22:37:40 0x08 | 5a:49:76:19:00:4b:12:00
24.11.2019 22:37:41 NumS: 4
24.11.2019 22:37:41 newD
24.11.2019 22:37:42 joinD: 0x09 | 7c:49:76:19:00:4b:12:00
24.11.2019 22:37:42 PJ-OFF
24.11.2019 22:37:55 ConfigRsp: 0x9
24.11.2019 22:37:56 PTr 08
24.11.2019 22:37:59 Sli
24.11.2019 22:37:59 0x01 | 27:49:76:19:00:4b:12:00
24.11.2019 22:37:59 0x02 | 67:49:76:19:00:4b:12:00
24.11.2019 22:38:00 0x04 | 1d:44:76:19:00:4b:12:00
24.11.2019 22:38:00 0x09 | 7c:49:76:19:00:4b:12:00
24.11.2019 22:38:00 0x08 | 5a:49:76:19:00:4b:12:00
24.11.2019 22:38:00 NumS: 5
I know this is a long message but sometimes (really rare) I see wrong assignment of already in use short addresses also in the sniffer in crowdy networks with much disconnects and rejoins. I dont know if the error originates from my changes or if there is some bug in the Ti software. The difference between the two UART prints I shared is that once a message is received between disconnection of the old and connection of the new sensor.
Any ideas are welcome, because I am stuck so far and got no idea where this is coming from.
kind regards
Slev1n