Skip to content

Autoprovison only works with the defined defaultResource #1524

Open
@fbuedding

Description

@fbuedding

IoT Agent Node Lib version the issue has been seen with

3.3.0

Bound or port used (API interaction)

Other

NGSI version

NGSIv2

Are you running a container?

Yes, I am using a contaner (Docker, Kubernetes...)

Image type

normal

Expected behaviour you didn't see

When a Service Group is provisioned with an api-key, resource other than the defaultResource and autoprovision is set to true documented here, then no device will be autoprovsioned upon receiving measurements. In my understanding the documentation let it sound like it should autoprovision a Device with the corresponding resource.

Bonus: when posting via http it also uses the default entity_type and not the one defined in the service group

Unexpected behaviour you saw

It did not autoprovision a device, it said it could not find one

Steps to reproduce the problem

# Create Service Group
curl --location 'http://localhost:4061/iot/services' \
--header 'fiware-service: openiot' \
--header 'fiware-servicepath: /' \
--header 'Content-Type: application/json' \
--data '{
 "services": [
   {
     "apikey":      "8b661f3b-6335-40d4-86ee-4d9119fe26e5",
     "cbroker":     "http://orion:1026",
     "entity_type": "House",
     "resource":    "/iot/house",
     "autoprovision":"true"
   }
 ]
}'

# Send mqtt to /ul/8b661f3b-6335-40d4-86ee-4d9119fe26e5/1/attrs
ad|123

Configs

environment:
        - "IOTA_CB_HOST=orion"
        - "IOTA_CB_PORT=1026"
        - "IOTA_NORTH_PORT=4061"
        - "IOTA_REGISTRY_TYPE=mongodb"
        - "IOTA_MONGO_HOST=mongodb"
        - "IOTA_MONGO_PORT=27017"
        - "IOTA_MONGO_DB=iotagent-ul"
        - "IOTA_PROVIDER_URL=http://iot-agent:4061"
        - "IOTA_AUTOCAST=true"
        - "IOTA_MQTT_HOST=mosquitto"
        - "IOTA_MQTT_PORT=1883"

Log output

{"name":"DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group for fields: [\"resource\",\"apikey\"] and values: {\"resource\":\"/iot/house\",\"apikey\":\"8b661f3b-6335-40d4-86ee-4d9119fe26e5\"}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions