客户的协议要求使用端点1作为OTA端点,但在尝试注册端点时发生错误,即端点1已注册。
我查看了Linux网关代码,但找不到端点1的定义,是否已使用? 如果是,修改端点并允许OTA使用端点1的步骤是什么?
巴西,
双阳
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.
客户的协议要求使用端点1作为OTA端点,但在尝试注册端点时发生错误,即端点1已注册。
我查看了Linux网关代码,但找不到端点1的定义,是否已使用? 如果是,修改端点并允许OTA使用端点1的步骤是什么?
巴西,
双阳
您好,Ryan和YK:
我还有一个关于OTA的问题:服务器和客户端在OTA期间是否必须使用相同的端点号码? 我提出这个问题是因为我刚发现 zd_sw_ota_client使用 SAMPLESW_ENendpoint=8, 而zc_ota_server使用 zcl_ota_endpoint=20,它们似乎工作正常。
如果服务器和客户端不必使用相同的端点,这是否意味着Zigbee Linux网关可以执行OTA至支持OTA的客户端,而无论其使用哪个端点?
是否存在服务器和客户端建立OTA通信时必须遵守的任何其他限制?
巴西,
双阳
您好,Ryan:
出于兼容性原因,客户仍需要对网关服务器和OTA服务器使用相同的端点(端点1)。 尝试将OTA集群合并到网关服务器时遇到问题。 请您帮忙吗?
我在Linux网关代码中执行了以下操作:
1.在gateway_config.tlg中为OTA添加端点1
//************ OTA Endpoint definitions *****************//
// Device IDs
#define DeviceID_ZCL_SE 0x0507
// Cluster IDs
#define OTAClusterId 0x0019
// endpointdefs define all fields for a simple descriptor (with the exception of the endpoint id)
// uint16 profileid;
// uint16 deviceid;
// uint8 devicever;
// input clusterlist;
// output clusterlist;
endpointdef OTAEpDef { ha_profile, DeviceID_ZCL_SE , 0, OTAInputClusters, OTAOutputClusters }
// clusterlists include a list of clusters
// for some common ZigBee clusters there is an internal keyword defined, that can optionally be used instead of a number or an explicit #define. These keywords are: basic, identify, groups, scenes, onoff.
// - supporting as server (accepting client to server commands):
clusterlist OTAInputClusters { basic, identify, OTAClusterId }
// - supporting as clients (accepting server to client commands):
clusterlist OTAOutputClusters { basic }
// attribute definition include cluster id, attribute id, data type, and access control
// uint16 attrid; // in hex (0x050E) or decimal (0, 99, etc..)
// uint8 datatype; // Enther a keyword or any supported ZigBee type value. Supported keywords are: uint8, uint16, uint32, boolean, octetstr, charstr, enum8
// uint8 accesscontrol; // one of the keywords: rdonly, 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 Basic_HwVersionAttr { basic, 0x0003, uint8, rdonly }
// attrlists are a collection of attributes
attrlist OTAAttrList { Basic_ZCLVersionAttr, Basic_HwVersionAttr, Basic_PowerSourceAttr, Basic_ClusterRevision, Identify_IdentifyTimeAttr, Identify_ClusterRevision }
//************ Endpoint definitions *****************//
// Application endpoints IDs may be in the range 1-254, except:
// endpoint IDs 0 is reserved by the system (ZDO)
// endpoint ID 14 is reserved as well (OtaMgr)
// endpoint ID 244 is reserved for green power
// the same endpointdef may be used by more than one endpoint
// endpoint { ID, EndpointDef, AttrDef }
endpoint { 0x04, CombinedInterfaceEpDef, CombinedInterfaceAttrList }
endpoint { GreenPowerEndpoint, GPProxyBasicEpDef, GPProxyBasicAttrList }
endpoint { 0x01, OTAEpDef, OTAAttrList }
2.在source/projects/ZStack/linux/otaserver/zcl_otaserver_lnx.c -> appInitPhase3中注释掉OTA端点注册的代码:
//Register OTA Endpoint
//if (FALSE == zotaRegEndpoint(&zotaDongleSimpleDesc))
//{
// uiPrintfEx(trUNMASKABLE, "\nError - Could not register OTA endpoint with zstackserver."
// "Exiting...\n\n");
// return 5;
//}
3.在 source/projects/ZStack/linux/otaserver/zcl_ota.h中将ZCL_OTA_EndPoint定义更改为1:
#define ZCL_OTA_ENDPOINT 1
4.运行setup.sh以重建网关演示。
完成这些步骤后,我尝试在演示应用程序中输入"O"以启动OTA,但客户端没有响应。 我不确定是否可以在网关服务器中注册端点1,但在OTA服务器中运行其他OTA API? 在所有这些线程之后都是不同的线程。
此致,
双阳
您好,Ryan:
我进行了一些调试,发现当我将端点注册移到gatewaysrvr.c时,zcl_otaserver_lnx.c中的zclota_ServerHdlIncoming回调未被调用,因此Linux OTA服务器没有响应QueryNextImageReq。
我猜是因为 如果同一服务器中没有af_register_req,zcl_registerPlugin调用就不会生效。 您可以确认吗?
如果是这种情况,这是否意味着不可能在网关服务器和OTA服务器之间共享同一端点?
巴西,
双阳