-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sigfox-iotagent - Send Measure - DEVICE_NOT_FOUND #27
Comments
Did you configure config.iota.service and config.iota.subservice according that fiware-service and fiware-servicepath in config.js ? |
Hi, yes, in config.js I've configured a default service and subservice, In any case I expect the service and subservice values shall be dynamically read by the request headers fiware-service and fiware-servicepath and not only in the configuration file. |
Hi, now I'm using the bin/sigfox-test.js client in order to send measure: The IoTAgent log is the following: Can you help me sending measure to the IoTAgent Sigfox? |
@ancappa not sure if it helps, but I'd suggest to try without the single quotes. I mean instead of:
try:
Looking to the log it seems the query includes the quotes so it doesn't find the device in the DB:
|
Hi, here is the
DEVICE PROVISIONING REQUEST
POST /iot/devices
Headers:
fiware-service: malaga_1
fiware-servicepath: /malaga_1_parking
Content-Type: application/json
Payload:
{
"devices": [{
"device_id": "sigApp2",
"service" : "malaga_1",
"service_path": "/malaga_1_parking",
"entity_name": "sigApp2",
"entity_type": "Device",
"timezone": "America/Santiago",
"protocol": "SIGFOX",
"attributes": [
{
"name": "time",
"type": "String"
},
{
"name": "statin",
"type": "String"
},
{
"name": "lng",
"type": "String"
},
{
"name": "lat",
"type": "String"
},
{
"name": "theCounter",
"type": "Integer"
},
{
"name": "theParam1",
"type": "Integer"
},
{
"name": "param2",
"type": "Integer"
},
{
"name": "tempDegreesCelsius",
"type": "Integer"
}, {
"name": "voltage",
"type": "Integer"
}
],
"lazy": [],
"static_attributes": [],
"commands": [],
"internal_attributes": [
{
"mapping": "theCounter::uint:32 theParam1::uint:32 param2::uint:8 tempDegreesCelsius::uint:8 voltage::uint:16"
}
]
}
]
}
SERVICE PROVISIONING REQUEST
POST /iot/services/
Headers:
fiware-service: malaga_1
fiware-servicepath: /malaga_1_parking
Content-Type: application/json
Payload:
{
"services": [
{
"cbHost": "xxx.xxx.xxx.xxx:1026",
"trust": "xxxxxx",
"subservice": "/malaga_1_parking",
"service": "malaga_1",
"apikey": "XXXX",
"resource": "/iot/d",
"attributes": [],
"lazy": [],
"commands": [],
"entity_type": "Device",
"internal_attributes": [],
"static_attributes": []
}
]
}
SEND MEASURE Request
GET sigfoxHost:sigfoxPort/update?id='sigApp2'&time='1430908992'&statin='0817'&lng=-4&lat=41&data=000000020000000000230c6f
Headers:
fiware-service: malaga_1
fiware-servicepath: /malaga_1_parking
RESPONSE:
{
"name": "DEVICE_NOT_FOUND",
"message": "No device was found with id:'sigApp2'",
"code": 404
}
IoTAgent LOG:
time=2018-05-14T16:29:05.786Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentSIGFOX.SigfoxServer | srv=n/a | subsrv=n/a | msg=Request for path [/update] from [sigfoxHost:sigfoxPort] | comp=IoTAgent
time=2018-05-14T16:29:05.786Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentSIGFOX.SigfoxServer | srv=n/a | subsrv=n/a | msg=service: malaga_1 | comp=IoTAgent
time=2018-05-14T16:29:05.786Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentSIGFOX.SigfoxServer | srv=n/a | subsrv=n/a | msg=Unrecognized body type | comp=IoTAgent undefined
time=2018-05-14T16:29:05.787Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentSIGFOX.SigfoxHandlers | srv=n/a | subsrv=n/a | msg=Handling request with query [{"id":"'sigApp2'","time":"'1430908992'","statin":"'0817'","lng":"-4","lat":"41","data":"000000020000000000230c6f"}] | comp=IoTAgent
time=2018-05-14T16:29:05.789Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentNGSI.MongoDBDeviceRegister | srv=n/a | subsrv=n/a | msg=Looking for entity with id ['sigApp2']. | comp=IoTAgent
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
time=2018-05-14T16:29:05.803Z | lvl=DEBUG | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentNGSI.MongoDBDeviceRegister | srv=n/a | subsrv=n/a | msg=Entity ['sigApp2'] not found. | comp=IoTAgent
time=2018-05-14T16:29:05.803Z | lvl=ERROR | corr=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | trans=6c0d50c2-f413-41d1-ab60-375a1ad85b01 | op=IoTAgentNGSI.Alarms | srv=n/a | subsrv=n/a | msg=Raising [MONGO-ALARM]: undefined | comp=IoTAgent
As you can see in the log, the srv=n/a | subsrv=n/a are not available, they have no value , so that the device is not found in the mongo db because the device search has no headers but the device exists in the mongo db.
Thanks in advance for you help.
The text was updated successfully, but these errors were encountered: