Details
-
Type:
Monitor
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Unknown
-
HD-Enabler:Unknown
-
HD-Node:Unknown
Description
Created question in FIWARE Q/A platform on 11-05-2025 at 16:05
Please, ANSWER this question AT https://stackoverflow.com/questions/79616690/fiware-iot-agent-json-returns-bad-request-when-provisioning-actuator-with-comman
Question:
FIWARE IoT Agent-JSON Returns BAD_REQUEST When Provisioning Actuator with Commands (Context Broker 201 Error)
Description:
I'm encountering a 400 error when provisioning an actuator with command attributes using the FIWARE IoT Agent-JSON. The IoT Agent reports a Context Broker connection error despite Orion seemingly returning a 201 status. Can anyone help identify the misconfiguration?
Setup:
FIWARE Orion-LD Context Broker (v3.10.0)
IoT Agent-JSON (v1.29.0)
Using NGSI-v2 API for interactions
Steps to Reproduce:
Send device provisioning request to IoT Agent:
POST /iot/devices
{
"devices": [
{
"device_id": "act012",
"entity_name": "urn:ngsi-ld:act:012",
"entity_type": "test",
"transport": "HTTP",
"endpoint": "http://iot-sensors:3001/iot/lamp001",
"commands": [
,
{"name": "off","type": "command"} ],
"attributes": [
,
{"object_id": "l", "name": "luminosity", "type":"Integer"} ],
"static_attributes": [
]
}
]
}
Response:
400 Bad Request
{
"name": "BAD_REQUEST",
"message": "Request error connecting to the Context Broker: 201"
}
IoT Agent Logs:
The IoT Agent attempts to create a Context Broker registration:
POST http://orion-proxy:1027/v2/registrations
{
"dataProvided": {
"entities": [
],
"attrs": ["on", "off"]
},
"provider": {
"http":
}
}
Headers: {
"fiware-service": "openiot",
"fiware-servicepath": "/",
"Authorization": "Bearer ..."
}
What I've Tried:
Verified Orion is reachable and returns 201 for direct registration requests
Confirmed device endpoint is accessible
Tested with both NGSI-v2 and NGSI-LD entity ID formats
Simplified static attributes (removing Relationship type)
Key Observations:
Orion returns HTTP 201 (Created) for registration, but IoT Agent interprets this as an error
Static attribute uses "type": "Relationship" - should this be "Reference" for NGSI-v2?
Entity ID uses ngsi-ld prefix in NGSI-v2 registration
Question:
Why is the IoT Agent-JSON failing with BAD_REQUEST despite Orion's 201 response? Are there issues with my command definitions, registration payload, or type declarations?
Activity
- All
- Comments
- History
- Activity
- Transitions
2025-05-12 01:03|CREATED monitor | # answers= 0, accepted answer= False