[Backlogmanager] [FIWARE-JIRA] (HELP-20547) [fiware-stackoverflow] I cannot properly read Southbound commands through Orion to MQTT devices

Fernando Lopez (JIRA) jira-help-desk at jira.fiware.org
Thu Jan 12 09:23:00 CET 2023


     [ https://jira.fiware.org/browse/HELP-20547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fernando Lopez updated HELP-20547:
----------------------------------
    Status: In Progress  (was: Open)

> [fiware-stackoverflow] I cannot properly read Southbound commands through Orion to MQTT devices
> -----------------------------------------------------------------------------------------------
>
>                 Key: HELP-20547
>                 URL: https://jira.fiware.org/browse/HELP-20547
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Jason Fox
>              Labels: fiware, fiware-orion
>
> Created question in FIWARE Q/A platform on 26-11-2022 at 11:11
> {color: red}Please, ANSWER this question AT{color} 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": {
>                         "data": "metadata_for_AGV_Alarm"
>                     }
>                 },
>                 {
>                     "object_id": "AGV_Event",
>                     "name": "AGV_Event",
>                     "type": "command",
>                     "value": {
>                         "data": "metadata_for_AGV_Event"
>                     }
>                 }
>             ],
> 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": {
>       "type" : "command",
>       "value": "152"
>   }
> }'
> 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 at 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"
> {"AGV_Event":""}
> {"AGV_Event":""}
> {"AGV_Event":""}
> 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: {
>                     type: 'DateTime',
>                     value: 1669584130.495
>                 }
>             }
>         },
>         AGV_Event_info: {
>             type: 'commandResult',
>             creDate: 1669583822.6813245,
>             modDate: 1669583822.6813245,
>             value: ' ',
>             mdNames: []
>         },
> 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": {
>     "type": "commandResult",
>     "value": "200"
>     },
>    "AGV_Event_status": {
>     "type": "commandStatus",
>     "value": "OK"
>    }
>   }'
> Now, nothing is received in the actuator simulator:
> ubuntu at 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: {
>             type: 'commandStatus',
>             creDate: 1669731581.9883916,
>             modDate: 1669733857.6557434,
>             value: 'OK',
>             mdNames: []
>         },
>         AGV_Event_info: {
>             type: 'commandResult',
>             creDate: 1669731581.9883916,
>             modDate: 1669733857.6557305,
>             value: '200',
>             mdNames: []
>         },
> 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?



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy