FIWARE / tutorials.IoT-over-MQTT

:orange_book: FIWARE 203: Provisioning Ultralight with an alternative transport: IoT over MQTT
https://fiware-iotagent-ul.rtfd.io
MIT License
62 stars 44 forks source link

Bad request when provisioning actuator #12

Closed floufen closed 5 years ago

floufen commented 5 years ago

I am following the tutorial as it is without any change.

When provisioning an actuator :

curl -iX POST \
  'http://localhost:4041/iot/devices' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: openiot' \
  -H 'fiware-servicepath: /' \
  -d '{
  "devices": [
    {
      "device_id": "bell001",
      "entity_name": "urn:ngsi-ld:Bell:001",
      "entity_type": "Bell",
      "protocol": "PDI-IoTA-UltraLight",
      "transport": "MQTT",
      "commands": [
        { "name": "ring", "type": "command" }
       ],
       "static_attributes": [
         {"name":"refStore", "type": "Relationship","value": "urn:ngsi-ld:Store:001"}
      ]
    }
  ]
}
'

I get this error message:

{
    "message": "Request error connecting to the Context Broker: {\"code\":\"400\",\"reasonPhrase\":\"Bad Request\",\"details\":\"JSON Parse Error: unknown field: /contextRegistrations/contextRegistration/attributes/attribute/isDomain\"}",
    "name": "BAD_REQUEST"
}

Here is the iot-agent about json response :

docker run --network fiware_default --rm appropriate/curl -s \
 -X GET 'http://iot-agent:4041/iot/about'
{"libVersion":"2.6.0","port":"4041","baseRoot":"/","version":"1.6.0"}
jason-fox commented 5 years ago

This is tangentially related to #8 - the docker-compose. This tutorial does not currently use the latest version of the IoT Agent as the functionality changed. At some point a breaking change has also been added to Orion so that that needs to be pinned as well. Orion had not been pinned correctly - see 52b326d

In summary, when provisioning the devices either use: