IoTAgent 无法向 Orion CB 发送通知
IoTAgent unable to send notification to Orion CB
我可以确认我的 LwM2M client
正在向 IoTAgent
发送观察结果,我还可以看到 IoTAgent
试图将观察到的测量结果转发给 Orion CB,但失败并显示以下日志:
time=2019-02-26T13:34:47.877Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.Registration | msg=Registration request ended successfully
time=2019-02-26T13:34:47.927Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.InformationReporting | msg=Observing value from resource /3303/0/5700 in device [1]
time=2019-02-26T13:34:47.947Z | lvl=ERROR | corr=519dbe74-0142-48b7-8290-444f86df5053 | trans=519dbe74-0142-48b7-8290-444f86df5053 | op=IoTAgentNGSI.DomainControl | srv=n/a | subsrv=n/a | msg=Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:34:47.948Z | lvl=DEBUG | corr=519dbe74-0142-48b7-8290-444f86df5053 | trans=519dbe74-0142-48b7-8290-444f86df5053 | op=IoTAgentNGSI.DomainControl | srv=n/a | subsrv=n/a | msg=response-time: 79406 | comp=IoTAgent
time=2019-02-26T13:35:02.965Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:35:17.981Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:35:48.012Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:03.030Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:23.059Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:53.086Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
以下是 Orion CB 在其日志中报告的内容:
time=Tuesday 26 Feb 13:34:47 2019.838Z | lvl=INFO | corr=48de7b18-39cb-11e9-8c5b-0242ac1b0006 | trans=1551188006-596-00000000004 | from=172.27.0.5 | srv=smartgondor | subsrv=/gardens | comp=Orion | op=logMsg.h[1916]:lmTransactionEnd | msg=Transaction ended
time=Tuesday 26 Feb 13:35:28 2019.446Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[701]:runCollectionCommand | msg=Database Operation Successful (command: { listDatabases: 1 })
time=Tuesday 26 Feb 13:35:28 2019.447Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[94]:collectionQuery | msg=Database Operation Successful (query: {})
time=Tuesday 26 Feb 13:35:28 2019.447Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[94]:collectionQuery | msg=Database Operation Successful (query: {})
time=Tuesday 26 Feb 13:36:28 2019.450Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[701]:runCollectionCommand | msg=Database Operation Successful (command: { listDatabases: 1 })
知道为什么会出现这个错误,是什么原因造成的?
找出问题所在。客户端代理数据编码(TLV 和 JSON)之间不匹配。
更改了客户端 wakaama/core/liblwm2m.h 中的编码样式以匹配 IoTAgent 的编码样式。
..wakaama/core/liblwm2m.h:
LWM2M_CONTENT_TEXT = 0, // Also used as undefined
LWM2M_CONTENT_LINK = 40,
LWM2M_CONTENT_OPAQUE = 42,
LWM2M_CONTENT_TLV_OLD = 1542, // Keep old value for backward-compatibility
LWM2M_CONTENT_TLV = 11542,
LWM2M_CONTENT_JSON_OLD = 1543, // Keep old value for backward-compatibility
LWM2M_CONTENT_JSON = 11543
LWM2M_CONTENT_TLV_OLD = 11542, // Keep old value for backward-compatibility
LWM2M_CONTENT_TLV = 1542,
LWM2M_CONTENT_JSON_OLD = 11543, // Keep old value for backward-compatibility
LWM2M_CONTENT_JSON = 1543
} lwm2m_media_type_t;
匹配IoTAgentconfig.js配置文件:
delayedObservationTimeout: 50,
formats: [
{
name: 'application-vnd-oma-lwm2m/text',
value: 1541
},
{
name: 'application-vnd-oma-lwm2m/tlv',
value: 1542
},
{
name: 'application-vnd-oma-lwm2m/json',
value: 1543
},
{
name: 'application-vnd-oma-lwm2m/opaque',
value: 1544
}
],
writeFormat: 'application-vnd-oma-lwm2m/text',
types: [ ]
};
正在工作中...
我可以确认我的 LwM2M client
正在向 IoTAgent
发送观察结果,我还可以看到 IoTAgent
试图将观察到的测量结果转发给 Orion CB,但失败并显示以下日志:
time=2019-02-26T13:34:47.877Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.Registration | msg=Registration request ended successfully
time=2019-02-26T13:34:47.927Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.InformationReporting | msg=Observing value from resource /3303/0/5700 in device [1]
time=2019-02-26T13:34:47.947Z | lvl=ERROR | corr=519dbe74-0142-48b7-8290-444f86df5053 | trans=519dbe74-0142-48b7-8290-444f86df5053 | op=IoTAgentNGSI.DomainControl | srv=n/a | subsrv=n/a | msg=Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:34:47.948Z | lvl=DEBUG | corr=519dbe74-0142-48b7-8290-444f86df5053 | trans=519dbe74-0142-48b7-8290-444f86df5053 | op=IoTAgentNGSI.DomainControl | srv=n/a | subsrv=n/a | msg=response-time: 79406 | comp=IoTAgent
time=2019-02-26T13:35:02.965Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:35:17.981Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:35:48.012Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:03.030Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:23.059Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
time=2019-02-26T13:36:53.086Z | lvl=FATAL | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | srv=n/a | subsrv=n/a | msg=An unexpected exception has been raised. Ignoring: Error: No matching format found | comp=IoTAgent
以下是 Orion CB 在其日志中报告的内容:
time=Tuesday 26 Feb 13:34:47 2019.838Z | lvl=INFO | corr=48de7b18-39cb-11e9-8c5b-0242ac1b0006 | trans=1551188006-596-00000000004 | from=172.27.0.5 | srv=smartgondor | subsrv=/gardens | comp=Orion | op=logMsg.h[1916]:lmTransactionEnd | msg=Transaction ended
time=Tuesday 26 Feb 13:35:28 2019.446Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[701]:runCollectionCommand | msg=Database Operation Successful (command: { listDatabases: 1 })
time=Tuesday 26 Feb 13:35:28 2019.447Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[94]:collectionQuery | msg=Database Operation Successful (query: {})
time=Tuesday 26 Feb 13:35:28 2019.447Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[94]:collectionQuery | msg=Database Operation Successful (query: {})
time=Tuesday 26 Feb 13:36:28 2019.450Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[701]:runCollectionCommand | msg=Database Operation Successful (command: { listDatabases: 1 })
知道为什么会出现这个错误,是什么原因造成的?
找出问题所在。客户端代理数据编码(TLV 和 JSON)之间不匹配。
更改了客户端 wakaama/core/liblwm2m.h 中的编码样式以匹配 IoTAgent 的编码样式。
..wakaama/core/liblwm2m.h:
LWM2M_CONTENT_TEXT = 0, // Also used as undefined
LWM2M_CONTENT_LINK = 40,
LWM2M_CONTENT_OPAQUE = 42,
LWM2M_CONTENT_TLV_OLD = 1542, // Keep old value for backward-compatibility
LWM2M_CONTENT_TLV = 11542,
LWM2M_CONTENT_JSON_OLD = 1543, // Keep old value for backward-compatibility
LWM2M_CONTENT_JSON = 11543
LWM2M_CONTENT_TLV_OLD = 11542, // Keep old value for backward-compatibility
LWM2M_CONTENT_TLV = 1542,
LWM2M_CONTENT_JSON_OLD = 11543, // Keep old value for backward-compatibility
LWM2M_CONTENT_JSON = 1543
} lwm2m_media_type_t;
匹配IoTAgentconfig.js配置文件:
delayedObservationTimeout: 50,
formats: [
{
name: 'application-vnd-oma-lwm2m/text',
value: 1541
},
{
name: 'application-vnd-oma-lwm2m/tlv',
value: 1542
},
{
name: 'application-vnd-oma-lwm2m/json',
value: 1543
},
{
name: 'application-vnd-oma-lwm2m/opaque',
value: 1544
}
],
writeFormat: 'application-vnd-oma-lwm2m/text',
types: [ ]
};
正在工作中...