1
votes

I'm using IoT Agent with Ultralight run directly (not as a dockerized component). I'm able to register new device, which is mapped in Orion Context Broker. However I have an issue with registering Actuators which require commands within configuration data. I use:

curl -iX POST \
  'http://MYIP:4061/iot/devices' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: openiot' \
  -H 'fiware-servicepath: /' \
  -d '{
  "devices": [
    {
      "device_id": "lamp003",
      "entity_name": "urn:ngsi-ld:Lamp:003",
      "entity_type": "Lamp",
      "protocol": "PDI-IoTA-UltraLight",
      "transport": "MQTT",
      "commands": [
        {"name": "on","type": "command"},
        {"name": "off","type": "command"}
       ]}
  ]
}

And in response I'm hit with:

op=IoTAgentNGSI.DeviceProvisioning | from=n/a | srv=n/a | subsrv=n/a | msg=Device provisioning failed due to the following error: | comp=IoTAgent Request error connecting to the Context Broker: {"code":"400","reasonPhrase":"Bad Request","details":"missing isDomain value for registration attribute"}

I tried adding "isDomain": "false" to elements of command table, but no luck. It used to work before and furthermore similar solution is presented on official guide.

1

1 Answers

1
votes

isDomain part of the deprecated NGSI-v1 syntax. It is not used in NGSI-v2 or NGSI-LD

I think you may be running the IoT Agent as NGSI-v1. You'll need to set contextBroker.ngsiVersion in your config.js or set the following Env variable in Docker or Docker-compose.

IOTA_CB_NGSI_VERSION=v2
config.js
{
    host: '192.168.56.101',
    port: '1026',
    ngsiVersion: 'v2'
}