Details
-
Type:
Monitor
-
Status: Answered
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 26-11-2022 at 11:11
Please, ANSWER this question AT https://stackoverflow.com/questions/74581683/i-cannot-properly-read-southbound-commands-through-orion-to-mqtt-devices
Question:
I cannot properly read Southbound commands through Orion to MQTT devices
Description:
I am trying to send commands in the Southbound direction following this flow:
The commands supported by the devices are provisioned as follows:
"services": [
{
"apikey": "5jggokgpepnvsb2uv4s40d59ov",
"cbroker": "'"http://orion:$ORION_PORT"'",
"entity_type": "Agv",
"transport": "MQTT",
"resource": "",
"commands": [
{
"object_id": "AGV_Alarm",
"name": "AGV_Alarm",
"type": "command",
"value":
},
{
"object_id": "AGV_Event",
"name": "AGV_Event",
"type": "command",
"value":
}
],
The request to send the command in the Southbound direction is made through the Orion Context Broker:
curl -iX PATCH \
'http://orion:1026/v2/entities/urn:ngsi-ld:Agv:001/attrs' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"AGV_Event":
}'
To simulate actuators the following tool is used which is listening for commands via MQTT:
docker run -it --rm --name mqtt-subscriber --network fiware_default efrecon/mqtt-client sub -h mosquitto -t "/5jggokgpepnvsb2uv4s40d59ov/agv001/cmd"
I can receive only a part of the payload of the command:
ubuntu@ip-172-31-85-246:~/FiwareDockerDevMode$ docker run -it --rm --name mqtt-subscriber --network fiware_default efrecon/mqtt-client sub -h mosquitto -t "/5jggokgpepnvsb2uv4s40d59ov/agv001/cmd"
In the temporary MongoDB, the command status appears as PENDING
AGV_Event_status: {
type: 'commandStatus',
creDate: 1669583822.6813245,
modDate: 1669584130.4993052,
value: 'PENDING',
mdNames: [
'TimeInstant'
],
md: {
TimeInstant:
}
},
AGV_Event_info:
,
Update
If, on the other hand, I send the command according to the structure it has in MongoDB:
curl -iX PATCH \
'http://orion:1026/v2/entities/urn:ngsi-ld:Agv:001/attrs' \
-H 'Content-Type: application/json' \
-H 'fiware-service: openiot' \
-H 'fiware-servicepath: /' \
-d '{
"AGV_Event_info":
,
"AGV_Event_status":
}'
Now, nothing is received in the actuator simulator:
ubuntu@ip-172-31-85-246:~/FiwareDockerDevMode$ docker run -it --rm --name mqtt-subscriber --network fiware_default efrecon/mqtt-client sub -h mosquitto -t "/5jggokgpepnvsb2uv4s40d59ov/agv001/cmd"
However, the temporary MongoDB is updated properly:
AGV_Event_status:
,
AGV_Event_info:
,
The official documentation of the IoTAgent-JSON suggests that when commands are sent in the Southbound direction the actuator will send a response, which would make sense considering that my actuators are dummies.
Any suggestions on how to receive all the information sent through the Orion Context Broker?
Activity
- All
- Comments
- History
- Activity
- Transitions