(curl localhost:4041/iot/devices -s -S --header 'Content-Type: application/json' \
--header 'Accept: application/json' --header 'Fiware-Service: mainflux' --header 'Fiware-ServicePath: /mqtt' -d @- | python -mjson.tool) <<EOF
{
"devices": [
{
"device_id": "DevID1",
"entity_name": "TheDevice1",
"entity_type": "DeviceType",
"attributes": [
{ "id": "t", "name": "temperature", "type": "float" },
{ "id": "h", "name": "humidity", "type": "float" }
],
"lazy":[
{ "id": "l", "name": "luminosity", "type": "percentage" }
],
"commands": [
{ "id": "t", "name": "turn", "type": "string" }
],
"static_attributes": [
{ "name": "serialID", "type": "02598347" }
]
}
]
}
EOF
{
"message": "Wrong syntax in request: Errors found validating request.",
"name": "WRONG_SYNTAX"
}
drasko@Lenin:~/fiware/iotagent-mqtt$ node bin/iotagentMqtt.js
time=2016-02-04T23:26:13.513Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | msg=Activating IOT Agent NGSI Library.
time=2016-02-04T23:26:13.515Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentNGSI.Global | msg=Falling back to Transient Memory registry for NGSI Library
time=2016-02-04T23:26:13.519Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentNGSI.NorthboundServer | msg=Starting IoT Agent listening on port [4041]
time=2016-02-04T23:26:13.520Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentNGSI.NorthboundServer | msg=Using config:
{
"logLevel": "DEBUG",
"contextBroker": {
"host": "localhost",
"port": "1026"
},
"server": {
"port": 4041
},
"deviceRegistry": {
"type": "memory"
},
"types": {},
"service": "mainflux",
"subservice": "/mqtt",
"providerUrl": "http://localhost:4041",
"deviceRegistrationDuration": "P1M",
"defaultType": "Thing",
"iotaVersion": "0.1.5"
}
time=2016-02-04T23:26:13.533Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentNGSI.ContextServer | msg=Loading NGSI Contect server routes
time=2016-02-04T23:26:13.534Z | lvl=DEBUG | corr=n/a | trans=n/a | op=n/a | msg=Loading access validation Templates
time=2016-02-04T23:26:13.541Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentMQTT.Agent | msg=IoT Agent services activated
time=2016-02-04T23:26:13.556Z | lvl=INFO | corr=n/a | trans=n/a | op=IoTAgentMQTT.Agent | msg=MQTT Client connected
time=2016-02-04T23:26:13.556Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentMQTT.Agent | msg=Recreating subscriptions for all devices
time=2016-02-04T23:26:13.557Z | lvl=INFO | corr=n/a | trans=n/a | op=IOTAMQTT.Executable | msg=MQTT IoT Agent started
time=2016-02-04T23:26:41.729Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentNGSI.NorthboundServer | msg=Request for path [/iot/devices] from [localhost:4041]
time=2016-02-04T23:26:41.730Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentNGSI.NorthboundServer | msg=Body:
{
"devices": [
{
"device_id": "DevID1",
"entity_name": "TheDevice1",
"entity_type": "DeviceType",
"attributes": [
{
"id": "t",
"name": "temperature",
"type": "float"
},
{
"id": "h",
"name": "humidity",
"type": "float"
}
],
"lazy": [
{
"id": "l",
"name": "luminosity",
"type": "percentage"
}
],
"commands": [
{
"id": "t",
"name": "turn",
"type": "string"
}
],
"static_attributes": [
{
"name": "serialID",
"type": "02598347"
}
]
}
]
}
time=2016-02-04T23:26:41.733Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentNGSI.RestUtils | msg=Errors found validating request: {"valid":false,"errors":[{"attribute":"additionalProperties","property":"devices.0.commands.0.id","actual":"t","message":"must not exist"},
"message":"must not exist"},{"attribute":"additionalProperties","property":"devices.0.attributes.1.id","actual":"h","message":"must not exist"},{"attribute":"additionalProperties","property":"devices.0.attributes.0.id","actual":"t","message":"must not exist"},{"attribute":"additionalProperties","property":"devices.0.lazy.0.id","actual":"l","message":"must not exist"}]}
time=2016-02-04T23:26:41.733Z | lvl=DEBUG | corr=n/a | trans=n/a | op=IoTAgentNGSI.NorthboundServer | msg=Error [WRONG_SYNTAX] handing request: Wrong syntax in request: Errors found validating request.