Open cpuigaei opened 8 years ago
Hi Carlos,
I'm trying to reproduce this issue on docker containers, could you please let me know which version of ContextBroker you're using? Thanks
Hi,
ContextBroker version is 0.25.0 Thanks.
Hi,
This week I have faced problems in order to ContextBroker receive data from my device and notify to Cygnus and then pass it to Cosmos. Also, since yesterday I can't even access by ssh to the IoTAgent and ContextBroker machines in Fiware Lab Cloud. I haven't changed anything of this instances and they sometimes work or not. Are you probably testing something?
Thanks.
I send to Fiware Lab team.
De: cpuigaei notifications@github.com<mailto:notifications@github.com> Responder a: telefonicaid/fiware-IoTAgent-Cplusplus reply@reply.github.com<mailto:reply@reply.github.com> Fecha: viernes, 22 de enero de 2016, 12:42 Para: telefonicaid/fiware-IoTAgent-Cplusplus fiware-IoTAgent-Cplusplus@noreply.github.com<mailto:fiware-IoTAgent-Cplusplus@noreply.github.com> Asunto: Re: [fiware-IoTAgent-Cplusplus] IoTAgent sending measures to Orion Context Broker (#364)
Hi,
This week I have faced problems in order to ContextBroker receive data from my device and notify to Cygnus and then pass it to Cosmos. Also, since yesterday I can't even access by ssh to the IoTAgent and ContextBroker machines in Fiware Lab Cloud. I haven't changed anything of this instances and they sometimes work or not. Are you probably testing something?
Thanks.
— Reply to this email directly or view it on GitHubhttps://github.com/telefonicaid/fiware-IoTAgent-Cplusplus/issues/364#issuecomment-173894139.
Este mensaje y sus adjuntos se dirigen exclusivamente a su destinatario, puede contener información privilegiada o confidencial y es para uso exclusivo de la persona o entidad de destino. Si no es usted. el destinatario indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización puede estar prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
The information contained in this transmission is privileged and confidential information intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this transmission in error, do not read it. Please immediately reply to the sender that you have received this communication in error and then delete it.
Esta mensagem e seus anexos se dirigem exclusivamente ao seu destinatário, pode conter informação privilegiada ou confidencial e é para uso exclusivo da pessoa ou entidade de destino. Se não é vossa senhoria o destinatário indicado, fica notificado de que a leitura, utilização, divulgação e/ou cópia sem autorização pode estar proibida em virtude da legislação vigente. Se recebeu esta mensagem por erro, rogamos-lhe que nos o comunique imediatamente por esta mesma via e proceda a sua destruição
Sorry for this late reply, but is this issue still happening? If it's still happening, could you try doing a queryContext for that entity to check if the value was updated? Other thing you can try is: provide a different service-path, not the "/" alone. It has to be supported though, but just in case it was a bug.
Hi,
I have done a queryContext and the value doesn't update:
{
"contextResponses" : [
{
"contextElement" : {
"type" : "Test",
"isPattern" : "false",
"id" : "TestSoulFy",
"attributes" : [
{
"name" : "T0",
"type" : "Temperature",
"value" : "30"
},
...
]
},
"statusCode" : {
"code" : "200",
"reasonPhrase" : "OK"
}
}
]
}
The contextBroker log:
time=2016-02-01T13:00:54.445CET | lvl=INFO | trans=1453896940-697-00000000040 | function=connectionTreat | comp=Orion | msg=rest.cpp[952]: Starting transaction from ***.***.***.46:49939/v1/queryContext
time=2016-02-01T13:00:54.546CET | lvl=INFO | trans=1453896940-697-00000000040 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[145]: Database Operation Successful (query: { query: { $or: [ { _id.id: "TestSoulFy", _id.type: "Test" } ], _id.servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { creDate: 1 } })
time=2016-02-01T13:00:54.547CET | lvl=INFO | trans=1453896940-697-00000000040 | function=collectionRangedQuery | comp=Orion | msg=connectionOperations.cpp[145]: Database Operation Successful (query: { query: { $or: [ { contextRegistration.entities: { $in: [ { id: "TestSoulFy", type: "Test" }, { type: "Test", id: "TestSoulFy" } ] } }, { contextRegistration.entities.id: { $in: [] } } ], expiration: { $gt: 1454328054 }, servicePath: { $in: [ null, /^$/, /^/.*/ ] } }, orderby: { _id: 1 } })
time=2016-02-01T13:00:54.547CET | lvl=INFO | trans=1453896940-697-00000000040 | function=requestCompleted | comp=Orion | msg=rest.cpp[475]: Transaction ended
I created another iotagent service with different servicePath:
iotagent -n t81 -p 8081 -d ./lib/Release/ -c ./config.json
curl -X POST http://localhost:8081/iot/services -i -H "Content-Type: application/json" -H "Fiware-Service: testservice81" -H "Fiware-ServicePath: /TestService81" -d '{"services": [{ "apikey": "apikey81", "token": "token81", "cbroker": "http://**.***.***.85:1026", "entity_type": "thing", "resource": "/iot/d" }]}'
HTTP/1.1 201 Created
Connection: close
Host: localhost:8081
Content-Length: 0
Location: /iot/services/testservice81
[root@idas fiware-IoTAgent-Cplusplus]# curl -X POST http://localhost:8081/iot/devices -i -H "Content-Type: application/json" -H "Fiware-Service: testservice81" -H "Fiware-ServicePath: /TestService81" -d '{ "devices": [ { "device_id": "d81", "entity_name": "TestSoulFy", "entity_type": "Test", "protocol":"PDI-IoTA-UltraLight", "attributes": [ { "object_id": "t0", "name": "T0", "type": "Temperature" } ] } ] }'
HTTP/1.1 201 Created
Connection: close
Host: localhost:8081
Content-Length: 0
Location: /iot/devices/d81
[root@idas fiware-IoTAgent-Cplusplus]# curl -X POST 'http://localhost:8081/iot/d?k=apikey81&i=d81' -i -H "Content-Type: application/json" -H "Fiware-Service: testservice81" -H "Fiware-ServicePath: /TestService81" -d 't0|20'
HTTP/1.1 200 OK
Connection: close
Host: localhost:8081
Content-Length: 0
And the value still doesn't update. Here is the contextBroker log:
time=2016-02-01T12:21:15.608CET | lvl=INFO | trans=1453896940-697-00000000037 | function=connectionTreat | comp=Orion | msg=rest.cpp[952]: Starting transaction from ***.***.***.46:59588/v1/updateContext
time=2016-02-01T12:21:15.609CET | lvl=INFO | trans=1453896940-697-00000000037 | function=collectionQuery | comp=Orion | msg=connectionOperations.cpp[74]: Database Operation Successful (query: { _id.id: "TestSoulFy", _id.type: "Test", _id.servicePath: /^\/TestService81$/ })
time=2016-02-01T12:21:15.820CET | lvl=INFO | trans=1453896940-697-00000000037 | function=collectionCreateIndex | comp=Orion | msg=connectionOperations.cpp[467]: Database Operation Successful (createIndex: { location.coords: "2dsphere" })
time=2016-02-01T12:21:15.821CET | lvl=INFO | trans=1453896940-697-00000000037 | function=collectionInsert | comp=Orion | msg=connectionOperations.cpp[307]: Database Operation Successful (insert: { _id: { id: "TestSoulFy", type: "Test", servicePath: "/TestService81" }, attrNames: [ "TimeInstant" ], attrs: { TimeInstant: { type: "ISO8601", creDate: 1454325675, modDate: 1454325675, value: "2016-02-01T11:21:15.039294" } }, creDate: 1454325675, modDate: 1454325675 })
time=2016-02-01T12:21:15.822CET | lvl=INFO | trans=1453896940-697-00000000037 | function=collectionQuery | comp=Orion | msg=connectionOperations.cpp[74]: Database Operation Successful (query: { entities.id: "TestSoulFy", $or: [ { entities.type: "Test" }, { entities.type: { $exists: false } } ], entities.isPattern: "false", conditions.type: "ONCHANGE", conditions.value: "TimeInstant", expiration: { $gt: 1454325675 }, servicePath: { $in: [ /^$|^/#$|^/TestService81/#$|^/TestService81$/, null ] } })
time=2016-02-01T12:21:15.823CET | lvl=INFO | trans=1453896940-697-00000000037 | function=requestCompleted | comp=Orion | msg=rest.cpp[475]: Transaction ended
time=2016-02-01T12:26:53.166CET | lvl=INFO | trans=1453896940-697-00000000038 | function=connectionTreat | comp=Orion | msg=rest.cpp[952]: Starting transaction from ***.***.***.46:59593/v1/updateContext
time=2016-02-01T12:26:53.168CET | lvl=INFO | trans=1453896940-697-00000000038 | function=collectionQuery | comp=Orion | msg=connectionOperations.cpp[74]: Database Operation Successful (query: { _id.id: "TestSoulFy", _id.type: "Test", _id.servicePath: /^\/TestService81$/ })
time=2016-02-01T12:26:53.169CET | lvl=INFO | trans=1453896940-697-00000000038 | function=collectionQuery | comp=Orion | msg=connectionOperations.cpp[74]: Database Operation Successful (query: { entities.id: "TestSoulFy", $or: [ { entities.type: "Test" }, { entities.type: { $exists: false } } ], entities.isPattern: "false", conditions.type: "ONCHANGE", conditions.value: "T0", expiration: { $gt: 1454326013 }, servicePath: { $in: [ /^$|^/#$|^/TestService81/#$|^/TestService81$/, null ] } })
time=2016-02-01T12:26:53.170CET | lvl=INFO | trans=1453896940-697-00000000038 | function=collectionQuery | comp=Orion | msg=connectionOperations.cpp[74]: Database Operation Successful (query: { entities.id: "TestSoulFy", $or: [ { entities.type: "Test" }, { entities.type: { $exists: false } } ], entities.isPattern: "false", conditions.type: "ONCHANGE", conditions.value: "TimeInstant", expiration: { $gt: 1454326013 }, servicePath: { $in: [ /^$|^/#$|^/TestService81/#$|^/TestService81$/, null ] } })
time=2016-02-01T12:26:53.171CET | lvl=INFO | trans=1453896940-697-00000000038 | function=collectionUpdate | comp=Orion | msg=connectionOperations.cpp[362]: Database Operation Successful (update: <{ _id.id: "TestSoulFy", _id.type: "Test", _id.servicePath: /\/TestService81/ }, { $set: { attrs.T0: { value: "20", type: "Temperature", md: [ { name: "TimeInstant", type: "ISO8601", value: "2016-02-01T11:26:52.619967" } ], creDate: 1454326013, modDate: 1454326013 }, attrs.TimeInstant: { value: "2016-02-01T11:26:52.619967", type: "ISO8601", creDate: 1454325675, modDate: 1454326013 }, modDate: 1454326013 }, $unset: { location: 1 }, $addToSet: { attrNames: { $each: [ "T0" ] } } }>)
time=2016-02-01T12:26:53.171CET | lvl=INFO | trans=1453896940-697-00000000038 | function=requestCompleted | comp=Orion | msg=rest.cpp[475]: Transaction ended
Having same issue here. Either the agent is having trouble forwarding measures to Orion or the Orion don't recognize which device sends measure. Agent logs: fiware-iotagent | time=2018-12-10T16:58:47.180Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.COAPRouter | msg=Handling request with method [POST] on url [/rd/1] with messageId [24751] fiware-iotagent | time=2018-12-10T16:58:47.181Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.UpdateRegistration | msg=Handling update registration request fiware-iotagent | time=2018-12-10T16:58:47.181Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.COAPUtils | msg=Extracting query parameters from request fiware-iotagent | time=2018-12-10T16:58:47.182Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.UpdateRegistration | msg=Updating device register with lifetime [undefined] and address [193.136.33.222]. fiware-iotagent | {"op":"IOTAgent.LWM2MHandlers","time":"2018-12-10T16:58:47.183Z","lvl":"DEBUG","msg":"Handling update registration of the device"} fiware-iotagent | time=2018-12-10T16:58:47.187Z | lvl=DEBUG | corr=54b6621d-65fd-43db-ac9b-fade34e4d947 | trans=54b6621d-65fd-43db-ac9b-fade34e4d947 | op=IoTAgentNGSI.MongoDBGroupRegister | srv=n/a | subsrv=n/a | msg=Looking for group params ["resource","apikey"] with queryObj {} | comp=IoTAgent fiware-iotagent | time=2018-12-10T16:58:47.194Z | lvl=DEBUG | corr=54b6621d-65fd-43db-ac9b-fade34e4d947 | trans=54b6621d-65fd-43db-ac9b-fade34e4d947 | op=IoTAgentNGSI.MongoDBGroupRegister | srv=n/a | subsrv=n/a | msg=Device group for fields [["resource","apikey"]] not found: [{}] | comp=IoTAgent fiware-iotagent | time=2018-12-10T16:58:47.194Z | lvl=ERROR | corr=54b6621d-65fd-43db-ac9b-fade34e4d947 | trans=54b6621d-65fd-43db-ac9b-fade34e4d947 | op=IoTAgentNGSI.Alarms | srv=n/a | subsrv=n/a | msg=Raising [MONGO-ALARM]: {"name":"DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group","code":404} | comp=IoTAgent fiware-iotagent | time=2018-12-10T16:58:47.195Z | lvl=DEBUG | corr=54b6621d-65fd-43db-ac9b-fade34e4d947 | trans=54b6621d-65fd-43db-ac9b-fade34e4d947 | op=IoTAgentNGSI.MongoDBDeviceRegister | srv=n/a | subsrv=n/a | msg=Looking for device with id [raspiSensorTV]. | comp=IoTAgent fiware-iotagent | time=2018-12-10T16:58:47.203Z | lvl=ERROR | corr=54b6621d-65fd-43db-ac9b-fade34e4d947 | trans=54b6621d-65fd-43db-ac9b-fade34e4d947 | op=IoTAgentNGSI.Alarms | srv=n/a | subsrv=n/a | msg=Releasing [MONGO-ALARM] | comp=IoTAgent fiware-iotagent | {"op":"IOTAgent.LWM2MHandlers","time":"2018-12-10T16:58:47.203Z","lvl":"DEBUG","msg":"Preregistered device found."} fiware-iotagent | time=2018-12-10T16:58:47.204Z | lvl=DEBUG | corr=n/a | trans=n/a | op=LWM2MLib.UpdateRegistration | msg=Update registration request ended successfully fiware-iotagent | {"time":"2018-12-10T16:58:47.254Z","lvl":"DEBUG","msg":"Observers created successfully."}
Orion CB logs:
fiware-orion | time=Monday 10 Dec 16:59:13 2018.388Z | 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 }) fiware-orion | time=Monday 10 Dec 16:59:13 2018.392Z | 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: {}) fiware-orion | time=Monday 10 Dec 16:59:13 2018.392Z | 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: {}) fiware-orion | time=Monday 10 Dec 16:59:13 2018.394Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e973f318837bebc0533fe'), $or: [ { lastSuccess: { $lt: 1544460095 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460095 } }>) fiware-orion | time=Monday 10 Dec 16:59:13 2018.395Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e9850318837bebc0533ff'), $or: [ { lastSuccess: { $lt: 1544460368 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460368 } }>) fiware-orion | time=Monday 10 Dec 16:59:13 2018.396Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e9916318837bebc053400'), $or: [ { lastSuccess: { $lt: 1544460566 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460566 } }>) fiware-orion | time=Monday 10 Dec 17:00:13 2018.400Z | 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 }) fiware-orion | time=Monday 10 Dec 17:00:13 2018.401Z | 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: {}) fiware-orion | time=Monday 10 Dec 17:00:13 2018.402Z | 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: {}) fiware-orion | time=Monday 10 Dec 17:00:13 2018.404Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e973f318837bebc0533fe'), $or: [ { lastSuccess: { $lt: 1544460095 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460095 } }>) fiware-orion | time=Monday 10 Dec 17:00:13 2018.404Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e9850318837bebc0533ff'), $or: [ { lastSuccess: { $lt: 1544460368 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460368 } }>) fiware-orion | time=Monday 10 Dec 17:00:13 2018.405Z | lvl=INFO | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=connectionOperations.cpp[449]:collectionUpdate | msg=Database Operation Successful (update: <{ _id: ObjectId('5c0e9916318837bebc053400'), $or: [ { lastSuccess: { $lt: 1544460566 } }, { lastSuccess: { $exists: false } } ] }, { $set: { lastSuccess: 1544460566 } }>)
@arilwan are you sure the IOTA you are using is fiware-IoTAgent-Cplusplus? I see LWM2M in the log traces...
I regret to have coursed confusion here, issue withdrawn.
Hello,
I am trying to use the fiware-IoTAgent-Cplusplus. It is configured on a base centos 6.5 in the Fiware Lab cloud (region PiraeusU), in order to get measures from devices and send to the Orion Context Broker.
After installation I create an agent with:
The config.json contains the following:
I check the correct operation:
Although the agent log shows an error message, that I dismiss because I don’t want OAuth security:
Then I create a service and a device:
The problem comes when I send a measure to the device and the IoTAgent passes the information to the Orion Context Broker. Send the measure:
I check in the Context Broker log that it receives the update:
But in the mongo database it doesn’t update:
Just to test, I send a value directly to the Orion Context Broker in order to check how it receives and generates the update. I observe that it is almost the same in comparison when it comes from the IoTAgent:
I do not understand what could be the problem and where it comes from…
Thanks. -Carlos