Closed marc0f closed 3 years ago
Not sure of fully understand the problem. Do you mean that Orion is sending notifications before the attributes are changed?
Maybe including the subscription post you are using could help to clarify... Thanks!
Yes, sometimes Orion is sending notifications before all the attributes are changed. This is the typical payload sent to IDAS: 'a|valueA#b|valueB#c|valueC#d|valueD#e|valueE#f|valueF#g|valueG#h|valueH#i|valueI' (where a=aatribute, b=battribute, and so on)
Here is the subscription payload: PAYLOAD = '{ \ "entities": [ \ { \ "type": "'+ENTITY_TYPE+'", \ "isPattern": "true", \ "id": ".*" \ } \ ], \ "attributes": [ \ "aattribute", \ "battribute",\ "cattribute",\ "dattribute",\ "eattribute",\ "fattribute",\ "gattribute",\ "hattribute",\ "iattribute"\ ], \ "reference": "'+SERVER_URL+'", \ "duration": "'+DURATION+'", \ "notifyConditions": [ \ { \ "type": "ONCHANGE", \ "condValues": [ \ "eattribute" \ ] \ } \ ] \ }'
Anyway, I'm running some tests, and if the attribute that trigger the notification (eattribute) is moved to the last position of the UL2.0 payload, the issue seems to occur less often. New payload: 'a|valueA#b|valueB#c|valueC#d|valueD#f|valueF#g|valueG#h|valueH#i|valueI#e|valueE'
Thanks.
We should "isolate" the part of the issue related with Orion. In that sense:
csubs
collection) during the process?Orion receives the messagges from IoTAgent (I suppose) using the HTTP request. The messages are sent to:
http://fiware_orion:1026/NGSI10/updateContext. content={"updateAction":"APPEND","contextElements":[{...
This is the IoTAgent NGSI configuration:
ngsi_url": { "cbroker": "http://fiware_orion:1026", "updateContext": "/NGSI10/updateContext", "registerContext": "/NGSI9/registerContext", "queryContext": "/NGSI10/queryContext"
Subscription in Orion DB:
{ "_id" : ObjectId("569a9d9dfb9f30ce8a85582e"), "expiration" : NumberLong(1768333469), "reference" : "http://fiware_proton:8080/ProtonOnWebServer/rest/events", "servicePath" : "/", "entities" : [ { "id" : ".*", "type" : "ENTITY_TYPE", "isPattern" : "true" } ], "attrs" : [ "aattributes", "battributes", "cattributes", "dattributes", "fattributes", "gattributes", "hattributes", "iattributes"], "conditions" : [ { "type" : "ONCHANGE", "value" : [ "eattribute" ] } ], "lastNotification" : NumberLong(1454402202), "count" : NumberLong(1107517), "format" : "XML" }
About communications between Orion and IoTAgent, I have an high number of messagges received by IoTAgent, and then sent to Orion. Often, in the IoTA log file is reported:
time=2016-02-02T08:57:41,641.468UTC | lvl=ERROR | comp=iota:IoTPlatform | op=receive_event | file=[140261619365632:iot_cb_comm.cc:92] | msg=Communication error -> http://fiware_orion:1026/NGSI10/updateContext : Connection reset by peer time=2016-02-02T08:57:41,641.512UTC | lvl=ERROR | comp=iota:IoTPlatform | op=put | file=[140261619365632:alarm.cc:113] | msg= event=ALARM code=200 to=http://fiware_orion:1026/NGSI10/updateContext service=pisapiazzacarrara service_path=/ content={"updateAction":"APPEND","contextElements":[{"id":"001EC08A9D14","type":"PSS","isPattern":"false","attributes":[{"name":"att_name","type":"string","value":"value","metadatas":[{"name":"TimeInstant","type":"ISO8601","value":"2016-02-02T08:57:40.638556"}]},{"name":"dcu","type":"string","value":"DCU050002","metadatas":[{"name":"TimeInstant","type":"ISO8601","value":"2016-02-02T08:57:40.638545"}]},{"name":"TimeInstant","type":"ISO8601","value":"2016-02-02T08:57:40.638545"}]}]} info=Connection reset by peer time=2016-02-02T08:57:41,657.437UTC | lvl=ERROR | comp=iota:IoTPlatform | op=remove | file=[140261619365632:alarm.cc:126] | msg= event=END-ALARM code=200 to=http://fiware_orion:1026/NGSI10/updateContext info=send ok
but in the end, everything seems to work.
Thanks.
If the problem is solved, could you close the issue, please? Thanks!
Sorry, I meant that between Orion and IoTA everything seems to work. Also Orion and Proton logs do not report communication problems.
The problem remains in the Orion notification messages (in XML format, as indicated in the csubs) sent to Proton (CEP).
Here is the part of a XML notification where the attributes battery, dcu, and lqi have been sent. Neither the dcu value, nor its metadata have been correctly updated in the notification. But, in the Orion DB (entities), the dcu value is correct.
<contextAttributeList>
<contextAttribute>
<name>battery</name>
<type>double</type>
<contextValue>2.8</contextValue>
<metadata>
<contextMetadata>
<name>TimeInstant</name>
<type>ISO8601</type>
<value>2016-01-16T20:08:47.032077</value>
</contextMetadata>
</metadata>
</contextAttribute>
<contextAttribute>
<name>dcu</name>
<type>string</type>
<contextValue>DCU050003</contextValue>
<metadata>
<contextMetadata>
<name>TimeInstant</name>
<type>ISO8601</type>
<value>2016-01-16T20:08:07.983443</value>
</contextMetadata>
</metadata>
</contextAttribute>
<contextAttribute>
<name>lqi</name>
<type>int</type>
<contextValue>99</contextValue>
<metadata>
<contextMetadata>
<name>TimeInstant</name>
<type>ISO8601</type>
<value>2016-01-16T20:08:47.032304</value>
</contextMetadata>
</metadata>
</contextAttribute>
Thanks,
Just to discard possible causes, you could try the following test: stop IoTAgent and do manual updateContext on the entities (e.g. using curl) in order to check if the notification includes all the information in the update in that case.
Should we understand that you finally solved the issue?
It is a good idea in general to provide a comment explaining how the issue was solved before closing. That may help other users.
Sorry, I'm no longer active on the project, thus cannot provide any further details.
Hi, I'm using 3 FIWARE GEs: IDAS+Orion+CEP. I have a device registered via IDAS with several attributes (status, temperature, battery, etc.) and a subscription from Orion to Proton. The subscrition is triggered by ONCHANGE of 'status', and all the device attributes are included in the notification message. I periodically send to IDAS the new measurements/values for all the attributes by using the UL2.0 with a paylaod as: 's|true#t|23#b|2.5#...'
I noticed that CEP does not always receive the latest value of the attributes, instead the value of the trigger attribute is alway correct. Therefore, a checked the notification messages, and it is like the notifications were sent before all the attributes were updated. I don't know if this is the normal behaviour or something was wrong.
Thanks, Marco