Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19882

[fiware-stackoverflow] Unable to send Southbound data in Fiware IoTAgent LWM2M

    Details

      Description

      Created question in FIWARE Q/A platform on 29-07-2022 at 04:07
      Please, ANSWER this question AT https://stackoverflow.com/questions/73161618/unable-to-send-southbound-data-in-fiware-iotagent-lwm2m

      Question:
      Unable to send Southbound data in Fiware IoTAgent LWM2M

      Description:
      When provisioning the Robot example device, the entities are getting created with position_info and position_status attributes but the update Position attribute in Orion is giving error

      {"code": "404", "reasonPhrase": "No context element found", "details": "error forwarding update" }

      Device provision req:
      curl --location --request POST 'localhost:4041/iot/devices' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'fiware-service: factory' \
      --header 'fiware-servicepath: /robots' \
      --data-raw '{
      "devices": [
      {
      "device_id": "robot1",
      "entity_type": "Robot",
      "entity_name": "robot01",
      "endpoint": "http://iot-sensors:3001/iot/robot",
      "attributes": [

      { "name": "Battery", "type": "number" }

      ],
      "lazy": [

      { "name": "Message", "type": "string" }

      ],
      "commands": [

      { "name": "Position", "type": "location" }

      ],
      "internal_attributes": {
      "lwm2mResourceMapping": {
      "Battery" :

      { "objectType": 7392, "objectInstance": 0, "objectResource": 1 }

      ,
      "Message" :

      { "objectType": 7392, "objectInstance": 0, "objectResource": 2 }

      ,
      "Position" :

      { "objectType": 7392, "objectInstance": 0, "objectResource": 3 }

      }
      }
      }
      ]
      }'

      And Update context request:
      curl --location --request POST 'http://localhost:1026/v1/updateContext' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'fiware-service: factory' \
      --header 'fiware-servicepath: /robots' \
      --data-raw '{
      "contextElements": [
      {
      "type": "Robot",
      "isPattern": "false",
      "id": "Robot:robot1",
      "attributes": [

      { "name": "Position", "type": "location", "value": "[18,3]" }

      ]
      }
      ],
      "updateAction": "UPDATE"
      }'

      As per the documentation, This action should trigger an Execute action in the client. It should also update the "_status" field of the entity with the "PENDING" value, stating the execution is pending of the client result.
      I also tried to update the Position attribute using v2 but not working:
      curl --location --request PATCH
      'http://localhost:1026/v2/entities/robot01/attrs/' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'fiware-service: factory' \
      --header 'fiware-servicepath: /robots' \
      -d '{
      "Position":

      { "type" : "location", "value" : "[18,3]" }

      }'

        Activity

          People

          • Assignee:
            mapedraza Miguel Ángel Pedraza
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: