IoTAgent无法将通知发送到Orion CB

时间:2019-02-26 13:47:22

标签: fiware fiware-orion

我可以确认我的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 })

知道这个错误的原因是什么?

1 个答案:

答案 0 :(得分: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;

匹配IoTAgent config.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: [ ]
};

正在工作...