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

[fiware-stackoverflow] Orion context broker returns "NotFound" when invoking command on provisioned LoRaWAN device

    Details

      Description

      Created question in FIWARE Q/A platform on 07-06-2025 at 13:06
      Please, ANSWER this question AT https://stackoverflow.com/questions/79656997/orion-context-broker-returns-notfound-when-invoking-command-on-provisioned-lor

      Question:
      Orion context broker returns "NotFound" when invoking command on provisioned LoRaWAN device

      Description:
      I provisioned an actuator in IoT agent, then want to send command to that actuator with PATCH request, but Orion returns NOT FOUND
      I provisioned the device with:
      {
      "devices": [
      {
      "device_id": "actuator-testing",
      "entity_name": "bell002",
      "entity_type": "notifier",
      "timezone": "America/Santiago",
      "endpoint": "http://localhost:4061/v2/notify",
      "attributes": [

      { "object_id": "t1", "name": "temperature_1", "type": "Number" }

      ],
      "commands": [

      {"object_id": "ring", "name": "ring", "type": "command" }

      ],
      "internal_attributes": {
      "lorawan": {
      "application_server":

      { "host": "au1.cloud.thethings.network", "username": "temp-sensorss@ttn", "password": "NNSXS.EXA3TWFPPGZ32GDCMWMWQWYPGJ3SI6OQMYNGNJI.3IMRDQHLOQCM5SMOHXQLZU2B7MXNMQYBSKTJX3OLOT4VVH6H2JWQ", "provider": "TTN" }

      ,
      "dev_eui": "70B3D57ED007082D",
      "app_eui": "1231314133224231",
      "application_id": "temp-sensorss@ttn",
      "application_key": "CE9CA5D1665846B6B5355C809E0F8FC5",
      "data_model": "application_server"
      }
      }
      }
      ]
      }

      and with this PATCH request wanted to invoke it
      curl http://URL:1026/v2/entities/bell002/attrs?type=notifier \
      -d {
      "ring":

      { "type": "command", "value": "" }

      }

      and received this response
      {
      "error": "NotFound",
      "description": "The requested entity has not been found. Check type and id"
      }

      And this is the config I'm using
      orion-v2:
      image: quay.io/fiware/orion:4.1.0
      hostname: orion
      container_name: fiware-orion
      depends_on:

      • mongo-db
        networks:
        default:
        ipv4_address: 172.18.1.9
        expose:
      • "$ {ORION_PORT}"
        ports:
        - "${ORION_PORT}

        :$

        {ORION_PORT}" # localhost:1026
        #command: -logLevel DEBUG -noCache -dbhost mongodb -corsOrigin __ALL
        command: -dbURI mongodb://mongo-db -logLevel DEBUG

        iot-agent:
        image: fiware/iotagent-ul:3.7.0-distroless
        hostname: iot-agent
        container_name: fiware-iot-agent
        depends_on:
        - mongo-db
        - orion-v2
        networks:
        default:
        ipv4_address: 172.18.1.100
        ports:
        - "${IOTA_NORTH_PORT}:${IOTA_NORTH_PORT}" # localhost:4041
        - "${IOTA_SOUTH_PORT}:${IOTA_SOUTH_PORT}" # localhost:7896
        environment:
        - IOTA_CB_HOST=orion
        - IOTA_CB_PORT=${ORION_PORT}

        # port the context broker listens on to update context

      • IOTA_NORTH_PORT=$ {IOTA_NORTH_PORT}
        - IOTA_REGISTRY_TYPE=mongodb #Whether to hold IoT device info in memory or in a database
        - IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
        - IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
        - IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
        - IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
        - IOTA_MONGO_HOST=mongo-db # The host name of MongoDB
        - IOTA_MONGO_PORT=${MONGO_DB_PORT} # The port mongoDB is listening on
        - IOTA_MONGO_DB=iotagentjson # The name of the database used in mongoDB
        - IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
        - IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
      • IOTA_AUTH_ENABLED=true
      • IOTA_AUTH_TYPE=oauth2
      • IOTA_AUTH_HEADER=Authorization
      • IOTA_AUTH_HOST=keyrock
      • IOTA_AUTH_PORT=$ {KEYROCK_PORT}
        - IOTA_AUTH_URL=http://keyrock:${KEYROCK_PORT}
      • IOTA_AUTH_CLIENT_ID=tutorial-dckr-site-0000-xpresswebapp
      • IOTA_AUTH_CLIENT_SECRET=tutorial-dckr-site-0000-clientsecret
      • IOTA_AUTH_PERMANENT_TOKEN=true
      • IOTA_AUTH_TOKEN_PATH=/oauth2/token

      You can see the versions, the models and the environment variables that I'm using. I can invoke commands with sending update from IoT agent itself with this request:
      curl http://iot-agent-host:4041/v2/op/update \
      -d
      { "actionType": "update", "entities": [ { "id": "bell002", "type": "notifier", "ring": { "type": "command", "value":

      {""}

      } } ] }

      This works correctly, and updates the ringStatus and ringInfo from the endpoint.

        Activity

        Hide
        newbacklogmanager Backlog Manager added a comment -

        2025-06-08 01:02|CREATED monitor | # answers= 0, accepted answer= False

        Show
        newbacklogmanager Backlog Manager added a comment - 2025-06-08 01:02|CREATED monitor | # answers= 0, accepted answer= False

          People

          • Assignee:
            Unassigned
            Reporter:
            newbacklogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: