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.

Z-Stack Linux Gateway add endpoint (gateway_setting.tlg)

Hi all,
In order for the gateway to deliver the manufacturer-specific cluster related commands to the application, I am defining an end point that supports this cluster (cluster ID: 0xFC45) in gateway_setting.tlg.
=================================================================
More information about my device.
Device ID: 302
Cluster ID: 0xFC45
Input Clusters:   0x0, 0x1, 0x3, 0x20, 0x402, 0xB05, 0xFC45
Output Clusters:  0x3, 0x19
Identifier   Name                        Type                                 Access
0x0000     MeasuredValue        Unsigned 16-bit integer    Read only
0x0001     MinMeasuredValue   Unsigned 16-bit integer   Read only
0x0002     MaxMeasuredValue  Unsigned 16-bit integer   Read only
0x0003     Tolerance                  Unsigned 16-bit integer   Read only 
=================================================================
The following are my settings.
// Cluster IDs (not built-in)
#define RelHumidMesur 0xFC45
// Color Control Attribute IDs
#define RelativeHumid_MeasuredVal_AttrId_d 0x0000
#define RelativeHumid_MinMeasuredVal_AttrId_d 0x0001
#define RelativeHumid_MaxMeasuredVal_AttrId_d 0x0002
#define RelativeHumid_Tolerance_AttrId_d 0x0003
// 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 { 7, RelHumidMesureEpDef, RelHumidMesureAttrList}
// 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 RelHumidMesureEpDef { ha_profile, 302, 0, RelHumidMesureInputClusters, RelHumidMesureOutputClusters }
// 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 RelHumidMesureInputClusters { 0x0000, 0x0001, 0x0003, 0x020, 0x0402, 0x0B05, 0xFC45 }
clusterlist RelHumidMesureOutputClusters { 0x0003, 0x0019 }
// 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
attr RelHumidMesur_MeasuredVal { RelHumidMesur, RelativeHumid_MeasuredVal_AttrId_d, uint16, rdonly }
attr RelHumidMesur_MinMeasuredVal { RelHumidMesur, RelativeHumid_MinMeasuredVal_AttrId_d, uint16, rdonly }
attr RelHumidMesur_MaxMeasuredVal { RelHumidMesur, RelativeHumid_MaxMeasuredVal_AttrId_d, uint16, rdonly }
attr RelHumidMesur_Tolerance { RelHumidMesur, RelativeHumid_Tolerance_AttrId_d, uint16, rdonly }
// attrlists are a collection of attributes
attrlist RelHumidMesureAttrList
  { RelHumidMesur_MeasuredVal, RelHumidMesur_MinMeasuredVal, RelHumidMesur_MaxMeasuredVal, RelHumidMesur_Tolerance }
=================================================================
My result:
If I inputted this line 
endpoint { 7, RelHumidMesureEpDef, RelHumidMesureAttrList}
I always got this error [Cannot open macro file for reading] .
If I didn’t input that line, it worked like before I modified gateway_setting.tlg file.
Can anyone help?
Thanks!

  • Hi TJ
    Is there a new line after the attribute list name RelHumidMesureAttrList (before the curly braces)? Please make sure that the devinitions are using single lines and not split into multiple lines.
    The error you specified is not supposed to be related to the tlg file. During start-up of the gateway sample app, it tries to open the file "macros.dat" for reading in binary mode. If opening this file files, then you will see "Cannot open macro file for reading". There are not supposed to be other reasons for triggering this message. If you just installed the gateway and have not used the sample app's macro feature before, then this file will not exist, and this message will be printed to the log on any startup (until you used the macro feature - see '[' and ']' keys). This is normal behavior and not an error.
    Best regardsOD
  • Hi OD,

    Do you know why I didn't see "Cannot open macro file for reading" if I removed this line "endpoint { 7, RelHumidMesureEpDef, RelHumidMesureAttrList}"?

    Thanks,

    -TJ
  • I think I need to explain more clear.

    Like my previous description.

    When I inputted endpoint { 7, RelHumidMesureEpDef, RelHumidMesureAttrList}, it always shows something like below

    It always shows "Waiting to connect to network manager server..."
    Can anyone help?
    Thanks!