This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2531: CC2531(CC2530)-ZNP working with Reserved Endpoints.

Part Number: CC2531
Other Parts Discussed in Thread: CC2530, Z-STACK

Hi, collegues.

=====================

Our platform description

=====================

We are using ZNP based on HA1.2

Version 1.2.2a

October 16,2015

CC2531(and CC2530 for some our hw platfroms) is used as Coordinator.

TI Servers (those started with  zigbeeHAgw) are using gateway_config.tlg (in attachment).

==============

Issue

==============

We do have now the ZigBee device, which software we can't modify. And it sends Attributes Reporting to the Endpoint with number 1 regardless how we are configuring it.

So it looks like it won't be handled in ZNP because the EP with number 1 is not registered within 

static int srvConvertParsedFile(void)
{
...
}

And the gateway server won't be registering it within

static bool gwInit( void )
{
...
}

by

static bool gwRegAllEp( void )
{
...
}

So the

void MT_AfIncomingMsg(afIncomingMSGPacket_t *pMsg) { ... }

Wil never be called in the CC2531(CC2531) SW, since the 

static void MT_AfRegister(uint8 *pBuf) will never be called for the Enpoint 1.

So, as the result, we can never receive the messages coming for the Endpoint with number 1 as Destinaton Address.

And our device will fail to report it's attributes.

==========

Questions

==========

1) Am I right, regaring Endpoints register process within the TI ZStack?

2) What does

"

// endpoint IDs 0-2 are reserved by the system (ZDO, NwkMgr, GatewayMgr)

"

stands for explicitly?

0 - ZDO

1 - NwkMgr

2 - GatewayMgr ?

3) Can I just register Endpoint with number 1 as my custom EP, and moving "resevation" for NwkMgr(probably, if I am right in previous question) to some another number?

4) If 3)  is ok, how can I do it?

Best Regards, 

Maxim Uvarenkov

 

  • Hi Maxim,

    Your understanding is correct, you would need to modify NM_EP of serverdefep.h in order to free endpoint 1 for your application to register.  I'm not certain what affect this change as well as APP_EP will have on the gateway solution (based on assumptions that could be made in other locations of the code).  You will need to at least modify srvParseEndpoint to accept 1 as a valid application endpoint.

    Regards,
    Ryan

  • Hi Ryan, thank you for the reply.

    Regarding your answer, in the 1.2.2 version of stack there is no serverdefep.h. I suppose, this file is the part of 3.0.1 Ti ZigBee Stack.

    Regarding the 1.2.2 stack I am expecting the serverep.h stands for the mentioned file. The reason I asked - there is no such endpoints like NM_EP (it is not even mentioned anywhere in code), It is only GW_EP mentioned and only in two commented strings.

    (Ex. -

    //set up global pointer, allowing for default GW_EP

    and

    //zcl_registerClusterOptionList(GW_EP, 1, gaGwApsOptions);

    )

    Regarding the existing file (serverep.h), 

    Only ZDO_EP and ZCL_OTA_ENDPOINT are mentioned.

    Moreover, it looks like the ZDO endpoint is registered explicitly by the CC2531 code (Coordinator itself)

    like

       afRegister( (endPointDesc_t *)&ZDApp_epDesc ); in ZDApp_Init( taskID++ ); in void osalInitTasks( void )

    since ZDApp_epDesc holds 

    endPointDesc_t ZDApp_epDesc =
    {
    ZDO_EP,
    &ZDAppTaskID,
    (SimpleDescriptionFormat_t *)NULL, // No Simple description for ZDO
    (afNetworkLatencyReq_t)0 // No Network Latency req
    };

    So the SW of the servers (GATEWAY_SRVR binary as the executable) doesn't even register it on it's own.

    These values stands only for the check of the legitimacy of the endpoints bundle defined by user in the .gateway_configtlg configuration file.

    Like this:

    if( !srvParse8BitValue( fp, &id ) || id == ZDO_EP || id == INVALID_EP || id == ZCL_OTA_ENDPOINT)
    {
    uiPrintfEx(trERROR, "Invalid Endpoint ID %d, use 1 - 254, except %d which is reserved for OTA\n", id, ZCL_OTA_ENDPOINT );
    return SRVEPERR_BADFILE;
    }

    So, the comment in the gateway_config.tlg for the 1.2.2 stack is not valid. I can use the first endpoint (and second....) as my custom endpoint without any limitation?

    I will give it a try it and come back with the results...

  • Thanks for the updated and additional information. I had thought I was referencing the Z-Stack HA 1.2.2a gateway solution, as Z-STACK-LINUX-SENSOR-TO-CLOUD (for 3.0) does not have the need for network or gateway manager endpoints.  Hopefully you have found that this is true for your solution as well and therefore you will be able to use endpoints 1and 2 without any restrictions.

    Regards,
    Ryan

  • Hi again, Ryan.

    I have checked usage of first endpoint for my custom necessities and foud out that it is not affecting anything. Now AttributeReporting (and, obviously any other messages) is translated from CC2531(CC2530) to the NPI Server and further on up the road. So the system works.

    Summary:

    In the 1.2.2 HA Stack comments regarding 1 and 2 endpoints reservation are not right. The only Zero Endpoint reserved (for ZDO) and this reservation is done within ZNP-Coordinator SW (for CC2531(CC2530)).

    The test config file is in attachment.

    endpoint { 1, MyCustomDeviceEpDef, NullAttrList } and all the related works successfuly, adding the 1 Endpoint to be used by my custom device.

    Actually, your first reply resolved the issue, so I will mark it as resolving. Slight smile

  • Thanks for the great feedback!  You mentioned an attachment which I do not see, just FYI.  TI has no plans to update the Z-Stack HA 1.2.2a gateway as focus is directed towards the newer Z-Stack 3.0 solutions which do not have the incorrect comments.

    Regards,
    Ryan

  • Regarding file - I can't attach it. It looks like both methods to attach file are not working. (Ubuntu Ubuntu 18.04.1 LTS, Google Chrome 71.0.3578.98).

    So Directly the text.

    ===========================================================================================================

    // Texas Instruments Linux Gateway Endpoint Configuration File (.tlg)
    // Copyright 2014 Texas Instruments Incorporated. All rights reserved.

    // comments
    // the rest of a line (after //) is ignored
    // any whitespace separates tokens (lines, spaces, tabs, comma)
    // order is not important (that is, if a name is referred to in may be before or after the reference)

    // keywords
    // all keywords are lowercase. Custom names should be MixedCase, so as not to confuse with keywords
    // Names follow C rules and are case sensitive. Numbers may be decimal or hex (e.g. 0x0Ae4)
    //
    // pollcontrol - configurable fields for sleepy devices using Poll Control
    // endpoint - a description of an endpoint
    // endpointdef - a simple descriptor
    // clusterlist - list of clusters (for either input or output)
    // attr - a single attribute
    // attrlist - a list of attributes
    // attrdef - includes and endpoint, cluster, and list of attributes

    ////////////////////////////////////////////////////////////////////////////////////////////////////////

    // Poll Control Configuration fields:
    // Use: pollcontrol { longPollInterval, shortPollInterval }
    //
    // longPollInterval:
    // * The maximum amount of time in quarterseconds between MAC Data Requests
    // from the end device to its parent.
    // * DataType: uint32
    // * Range: 0x04 - 0x6E0000
    //
    // shortPollInterval:
    // * The number of quarterseconds that an end device waits between MAC Data Requests
    // to its parent when expecting data (i.e. in fast poll mode).
    // * DataType: uint16
    // * Range: 0x01 - 0xFFFF
    pollcontrol { 0x14, 0x02 }

    // Cluster IDs (not built-in)

    // Application endpoints IDs may be in the range 3-254
    // endpoint IDs 0-2 are reserved by the system (ZDO, NwkMgr, GatewayMgr)
    // endpoint ID 14 is reserved as well (OtaMgr)
    // the same endpointdef may be used by more than one endpoint

    // endpoint { ID, EndpointDef, AttrDef }
    endpoint { 1, MyCustomDeviceEpDef, NullAttrList }
    endpoint { 3, OnOffLightEpDef, NullAttrList }
    endpoint { 4, LevelControlEpDef, NullAttrList }
    endpoint { 5, ColorControlEpDef, NullAttrList }
    endpoint { 6, ColorControlC1EpDef, NullAttrList }
    endpoint { 7, ColorControlC2EpDef, NullAttrList }
    endpoint { 8, IASZoneEpDef, NullAttrList }
    endpoint { 9, SmartPlugEpDef, NullAttrList }
    endpoint { 10, LightSensorEpDef, NullAttrList }
    endpoint { 11, OccupancySensorEpDef, NullAttrList }
    endpoint { 12, TemperatureSensorEpDef, NullAttrList }
    endpoint { 13, TemperatureSensorC1EpDef, NullAttrList }
    endpoint { 15, OnOffOutputEpDef, NullAttrList }
    endpoint { 16, MainsPowerOutletEpDef, NullAttrList }
    endpoint { 17, IASWarningDeviceEpDef, NullAttrList }
    endpoint { 18, ColorControlH1EpDef, NullAttrList }
    endpoint { 19, ColorControlH2EpDef, NullAttrList }
    endpoint { 20, IASACEDeviceEpDef, NullAttrList }

    // endpointdefs define all fields for a simple descriptor (with the exception of the endpoint id)
    // uint16 profileid;
    // uint16 deviceid;
    // uint8 devicever;
    // uint8 n_inputclusters;
    // uint16 *inputclusters;
    // uint8 n_outputclusters;
    // uint16 *outputclusters;
    endpointdef OnOffLightEpDef { ha_profile, ha_onofflight, 0, NullClusterList, OnOffOutputClusters }
    endpointdef LevelControlEpDef { ha_profile, ha_dimmablelight, 0, NullClusterList, LevelControlOutputClusters }
    endpointdef ColorControlEpDef { ha_profile, ha_colordimmablelight, 0, NullClusterList, ColorControlOutputClusters }
    endpointdef ColorControlC1EpDef { ha_profile, 528, 0, NullClusterList, ColorControlOutputClusters }
    endpointdef ColorControlC2EpDef { ha_profile, 544, 0, NullClusterList, ColorControlOutputClusters }
    endpointdef IASZoneEpDef { ha_profile, 1026, 0, IASZoneInputClusters, IASZoneOutputClusters }
    endpointdef SmartPlugEpDef { ha_profile, 81, 0, NullClusterList, SmartPlugOutputClusters }
    endpointdef LightSensorEpDef { ha_profile, 262, 0, NullClusterList, LightSensorOutputClusters }
    endpointdef OccupancySensorEpDef { ha_profile, 263, 0, NullClusterList, OccupancySensorOutputClusters }
    endpointdef TemperatureSensorEpDef { ha_profile, 770, 0, NullClusterList, TemperatureSensorOutputClusters }
    endpointdef TemperatureSensorC1EpDef { ha_profile, 24321, 0, NullClusterList, TemperatureSensorOutputClusters }
    endpointdef OnOffOutputEpDef { ha_profile, 2, 0, NullClusterList, OnOffOutputOutputClusters }
    endpointdef MainsPowerOutletEpDef { ha_profile, 9, 0, NullClusterList, MainsPowerOutletOutputClusters }
    endpointdef IASWarningDeviceEpDef { ha_profile, 1027, 0, NullClusterList, IASWarningDeviceOutputClusters }
    endpointdef ColorControlH1EpDef { ha_profile, 268, 0, NullClusterList, ColorControlOutputClusters }
    endpointdef ColorControlH2EpDef { ha_profile, 269, 0, NullClusterList, ColorControlOutputClusters }
    endpointdef IASACEDeviceEpDef { ha_profile, 1025, 0, NullClusterList, IASACEDeviceOutputClusters }
    endpointdef MyCustomDeviceEpDefEpDef { ha_profile, 81, 0, NullClusterList, MyCustomDeviceEpDefOutputClusters }

    // clusterlists include a list of clusters
    //
    // the common ZigBee clusters, such as basic, groups can use the symbol, rather than the number (e.g. 0x0006 or onoff)
    clusterlist NullClusterList { }
    clusterlist OnOffOutputClusters { onoff }
    clusterlist LevelControlOutputClusters { onoff, 0x0008 }
    clusterlist ColorControlOutputClusters { onoff, 0x0008, 0x0300 }
    clusterlist IASZoneOutputClusters { 1280, 0x0001 }
    clusterlist IASZoneInputClusters { 1281 }
    clusterlist SmartPlugOutputClusters { onoff, 0x0001, 0x07002 }
    clusterlist LightSensorOutputClusters { 1024 }
    clusterlist OccupancySensorOutputClusters { 1030 }
    clusterlist TemperatureSensorOutputClusters { 1026, 1029, 0x0001 }
    clusterlist OnOffOutputOutputClusters { onoff }
    clusterlist MainsPowerOutletOutputClusters { onoff }
    clusterlist IASWarningDeviceOutputClusters { 0x0001 }
    clusterlist IASACEDeviceOutputClusters { 0x0001 }
    clusterlist MyCustomDeviceEpDefOutputClusters { onoff, 0x0001, 0x07002 }

    // attrs include an identifier, data type, and access control
    // uint16 attrid; // in hex (0x050E) or decimal (0, 99, etc..)
    // uint8 datatype; // boolean, uint8, uint16, uint32, or the ZigBee hex equivalent
    // uint8 accesscontrol; // rdonly or rdwr
    // special case: if attribute datatype is charstring or octetstring, a length byte follows the type
    // { 99, charstring, 16, rdwr } // a character string up to 16 bytes

    // attrlists are a collection of attributes
    attrlist NullAttrList { }

  • Regarding 1.2.2 HA Stack it is clear. Thank you. Our company is using both stacks now. But anyway we have to support elder products based on 1.2.2 Stack.   

  • Have you tried moving the file directly into the reply text box?

    Regards,
    Ryan