Closed NORTHWIND1997 closed 1 year ago
Where is the docker-compose ?
@AlvaroVega I just updated the issue. Sorry about that I posted it by mistake before finishing it.
iotagent-json is currently in version 1.24, and some issues since 1.21 related with commands has been merged. Could you please try with latest version of iotagent-json ?
@AlvaroVega there is no image of version 1.24 in docker hub. Are you sure it was pushed ?
@AlvaroVega there is no image of version 1.24 in docker hub. Are you sure it was pushed ? This one: https://hub.docker.com/layers/iotagent-json/telefonicaiot/iotagent-json/1.24.0/images/sha256-fec24cd8faa701d238c5ad34936a633fb210f46c281db68eaefb0fd60ec6ebf5?context=repo
I just pulled this image and tested with the newer version. the problem is not fixed yet.
Could you reformulate the problem in terms of the NGSIv2 API, please?
For NGSI-LD API issues, maybe @jason-fox could provide feedback or support.
The problem doesn't exist with the NGSIv2 API. I did in fact test this before as follows:
1- the environment consists of the iot-agent, the orion context broker and a mongo db:
version: "2"
volumes:
mongodb: ~
services:
iot-agent:
image: fiware/iotagent-json
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongodb
expose:
- "4041"
- "7896"
ports:
- "4041:4041"
- "7896:7896"
environment:
- "IOTA_CB_HOST=orion"
- "IOTA_CB_PORT=1026"
- "IOTA_NORTH_PORT=4041"
- "IOTA_REGISTRY_TYPE=mongodb"
- "IOTA_MONGO_HOST=mongodb"
- "IOTA_MONGO_PORT=27017"
- "IOTA_MONGO_DB=iotagent-json"
- "IOTA_HTTP_PORT=7896"
- "IOTA_PROVIDER_URL=http://iot-agent:4041"
mongodb:
image: mongo:3.2
hostname: mongodb
container_name: db-mongo
ports:
- "27017:27017"
command: --nojournal
volumes:
- mongodb:/data/db
orion:
image: fiware/orion
hostname: orion
container_name: fiware-orion
depends_on:
- mongodb
expose:
- "1026"
ports:
- "1026:1026"
command: -dbhost mongodb
2- the service and the device are provisioned with the same requests as in the original description (steps 2 and 3). 3- And when we query the device in the context broker we see that the command attributes are indeed present as attributes and not just the _status and _info attributes:
query using the following request:
curl --location --request GET 'http://localhost:1026/v2/entities' \
--header 'Accept: application/json' \
--header 'fiware-service: robots' \
--header 'fiware-servicepath: /'
the response we get:
[
{
"id": "robot001",
"type": "Robot",
"TimeInstant": {
"type": "DateTime",
"value": "2022-08-17T10:07:37.183Z",
"metadata": {}
},
"count_info": {
"type": "commandResult",
"value": " ",
"metadata": {}
},
"count_status": {
"type": "commandStatus",
"value": "UNKNOWN",
"metadata": {}
},
"msg_info": {
"type": "commandResult",
"value": " ",
"metadata": {}
},
"msg_status": {
"type": "commandStatus",
"value": "UNKNOWN",
"metadata": {}
},
"msg": {
"type": "command",
"value": "",
"metadata": {}
},
"count": {
"type": "command",
"value": "",
"metadata": {}
}
}
]
So the problem doesn't exist when using nsgi-v2 but rather nsgi-ld.
So the problem doesn't exist when using nsgi-v2 but rather nsgi-ld.
Thus, it means it is a NGSI-LD specific problem. Definitively, it would be great if @jason-fox provide feedback on this :)
For Scorpio this is the same issue as in https://github.com/telefonicaid/iotagent-ul/issues/573 (a workaround is mentioned there)
@fgalan @jason-fox is there any update on this issue ?
After closing https://github.com/telefonicaid/iotagent-ul/issues/573
I assume this issue can be closed too, right?
Yes I think so.
we are facing a problem when we try to issue commands to the provisioned IoT devices from the context broker. When provisioning an IoT device, the commands themselves don't show up as properties when the device entity is queried from the context broker.
Here is the problem: 1- We are using the scorpio context broker. The following docker-compose is what we use in our development environment.
2- We first start by provisioning a service:
3- then we provision the IoT device. The device is set to have 2 commands (msg and count):
4- when we check for the device in the IoT agent, we see that it is there: we query using the following request
here is the response that we get
5- we can even invoke commands from the IoT agent and it works fine (the IoT device is an application that we are developing in our research group that runs locally on the host machine. It's not a part of the docker-compose environment. But it works fine and responds to the commands from the IoT agent properly):
6- but we don't want to issue commands or interact with the IoT agent. If we query the IoT device as an entity in the broker we get the following response: the request
the response
I think we all see the problem here. The entity in the broker lacks the properties for the commands. Only the status and info objects show up as attributes for the entities, but not the commands themselves. The result of this, is that we can't invoke the commands from the context broker. So if we try this:
we get the following response:
Can someone tell me what the problem is ? Are we doing something wrong here ?
side note: we switched to the Orion context broker but we had the exact same problem.