-
Notifications
You must be signed in to change notification settings - Fork 9
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
issue with sending query context from iot broker to iot agent #20
Comments
Hi Mohamed, first thing to say is that the IoT Broker does not support FIWARE Service and FIWARE Service Path. Those two things are not part of the NGSI specification neither the FIWARE architecture but specific features of the Orion Context Broker. Said that, I have syntactically checked your curl requests and they are fine, I have successfully tested them(with the 6.4 version of the IoT Broker standalone docker version, fiware:v6.4-standalone). I did not fully understand the script of your IoT Agent into your android application. As far I have understood you registers your android agent to the IoT Discovery and then you make a query to the IoT Broker. Because of that the IoT Broker contacts your android iot agent which replies with the following message that needs to then be finally given as response to your original query response:
Did I understand right? The problem here is that the IoT Broker is making a new NGSI-10 queryContextRequest to the android IoT agent and it is expected an NGSI-10 queryContextResponse as response (see Query Context Handling) I have tried to model your message with a correct NGSI queryContextResponse:
|
Another thing: I have seen that you are registering your agent with a duration of 1 minute:
That means that after the minute passes the registration will expire and it will be cancelled from the IoT Discovery, therefore your IoT agent will not be discoverable anymore by the IoT Broker. If you want to make the registration permanent, just omit this parameter. |
thanks a lot for your response me about my problems and explain me the parameter of duration ,i had misunderstanding to that parameter |
Hi Mohamed, so as far as I can understand you have an Orion Context Broker, an Android App (your code), an IoT Agent (your code), a FIWARE IoT Broker + IoT Discovery.
then you request the data:
This is what it happens, so it is actually correct what you have understood. I have a question: the last JSON data of your first message, from whom is generated? |
in those images i make a graph for my project in case of query and registration IoT Agents translate IoT-specific protocols into the NGSI context information protocol, i do not need this component if my devices or gateways natively support the NGSI API. i want in my project to connect a device not deals with ngsi to NEConfman discovery as soon as it arrives to the system automatically without manual registration using android app so Is there a way to do this ? |
when i register entity to iot discovery i use this script
curl '130.206.121.137:8065/ngsi9/registerContext' -s -S --header 'Content-Type: application/json' -d @- <<EOF
{
}
EOF
the ip of providingApplication field is the ip of iot agent
when i send a quertContext that request is heard by iot agent but dosen't return any entity
i have used the following script and i put the headers of service and service path at the following way but the element is not found
(curl 130.206.121.137:8060/ngsi10/queryContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Fiware-Service: smart' --header 'Fiware-ServicePath:/' --header 'X-Auth-Token: null' -d @- | python -mjson.tool)<<EOF
{
"entities": [{
"isPattern": "false",
"id": "sensor999",
"type": "thing"
}],
"attributes": ["temperature"]
}
EOF
the response is
{
"contextResponses": [],
"errorCode": {
"code": 404,
"details": "Discovery response: OK (details: )",
"reasonPhrase": "CONTEXT ELEMENT NOT FOUND"
}
}
i used these parameters actually for sending query and register to discovery ,
using android app i register this script to iot agent and it have already registered to agent
"{\n" +
" "devices": [\n" +
" { "device_id": ""+"device"+"",\n" +
" "entity_name": ""+"sensor999"+"",\n" +
" "entity_type": ""+"thing"+"",\n" +
" "timezone": "Egypt/Cairo",\n" +
""attributes": [\n" +
" { "object_id": "t",\n" +
" "name": "temperature",\n" +
" "type": "float"\n" +
" }],\n" +
" "static_attributes": [\n" +
" { "name": "att_name",\n" +
" "type": "int",\n" +
" "value": ""+"656.5"+""\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" } \n" +
"\n";
Is there incompatibility in attributes and Is this correct scripts ?
The text was updated successfully, but these errors were encountered: