Home » Eclipse Projects » OM2M » Create AE via MQTT Binding(MQTT Binding)
| | | | | | | | |
Re: Create AE via MQTT Binding [message #1778848 is a reply to message #1778843] |
Fri, 22 December 2017 13:13 |
Gordian Zomer Messages: 5 Registered: December 2017 |
Junior Member |
|
|
hieu tran wrote on Fri, 22 December 2017 11:41I found in Router.java the exception: - line 130
code]if(request.getOperation() == null){
throw new BadRequestException("No Operation provided");
}[[/code]
The code seem not to read the "op" filed.
Do you have any idea to fix these problem ?
The exception is not the problem. It seems that the request is empty (and therefore the operation is null), which means that the incoming MQTT request is not parsed. I think the un-marshaller is broken.
[Updated on: Fri, 22 December 2017 13:15] Report message to a moderator
|
|
| | | |
Re: Create AE via MQTT Binding [message #1783210 is a reply to message #1782331] |
Fri, 09 March 2018 08:45 |
Loula Beck Messages: 12 Registered: March 2018 |
Junior Member |
|
|
Hi, I am facing the same issue. Here is the request I send and the respond I get :
{
"m2m:rqp": {
"fr": "SENSOR2",
"to": "/mn-cse/RSU/SENSOR2/DATA",
"op": 1,
"rqi": 179,
"pc": {
"m2m:cin": {
"cnf": "dht2",
"con": "24.60_25.60"
}
},
"ty": 4
}
}
{
"m2m:rsp" : {
"m2m:rsc" : 4000,
"m2m:pc" : "No Operation provided",
"m2m:fr" : "/mn-cse"
}
}
If someone know how I can fix it, I could use some help.
|
|
| | | |
Re: Create AE via MQTT Binding [message #1783236 is a reply to message #1783230] |
Fri, 09 March 2018 13:10 |
Loula Beck Messages: 12 Registered: March 2018 |
Junior Member |
|
|
Are you referring to the 3 JSON shown in the MQTT Binding tutorial ? If so yes, at least I tried. Here are the messages I send and receive :
{
"m2m:rqp": {
"m2m:fr": "SENSOR2",
"m2m:to": "/mn-cse",
"m2m:op": 2,
"m2m:rqi": 1111111
}
}
{
"m2m:rqp" : {
"m2m:fr" : "SENSOR2",
"m2m:to" : "/mn-cse/mn-name/SENSOR2",
"m2m:op" : 1,
"m2m:rqi": 123456,
"m2m:pc": {
"m2m:cnt" : {
"rn": "DATA"
}
},
"m2m:ty": 3
}
}
{
"m2m:rsp" : {
"m2m:rsc" : 2000,
"m2m:rqi" : "1111111",
"m2m:pc" : {
"m2m:cb" : {
"rn" : "mn-name",
"ty" : 5,
"ri" : "/mn-cse",
"ct" : "20180308T164949",
"lt" : "20180308T164949",
"acpi" : [ "/mn-cse/acp-207203953" ],
"cst" : 1,
"csi" : "mn-cse",
"srt" : [ 1, 2, 3, 4, 5, 9, 14, 15, 16, 17, 23, 28 ],
"poa" : [ "http://127.0.0.1:8282/" ]
}
},
"m2m:to" : "SENSOR2",
"m2m:fr" : "/mn-cse"
}
}
{
"m2m:rsp" : {
"m2m:rsc" : 4004,
"m2m:rqi" : "123456",
"m2m:pc" : "Resource not found",
"m2m:to" : "SENSOR2",
"m2m:fr" : "/mn-cse"
}
}
{
"m2m:rqp": {
"m2m:fr": "SENSOR2",
"m2m:to": "/mn-cse/mn-name/SENSOR2/DATA",
"m2m:op": 1,
"m2m:rqi": "0",
"m2m:pc": {
"m2m:cin": {
"cnf": "dht2",
"con": "25.30_28.40"
}
},
"m2m:ty": 4
}
}
{
"m2m:rsp" : {
"m2m:rsc" : 4004,
"m2m:rqi" : "0",
"m2m:pc" : "Resource not found",
"m2m:to" : "SENSOR2",
"m2m:fr" : "/mn-cse"
}
}
|
|
| | | | | |
Re: Create AE via MQTT Binding [message #1783334 is a reply to message #1783324] |
Mon, 12 March 2018 07:38 |
Loula Beck Messages: 12 Registered: March 2018 |
Junior Member |
|
|
Hi, I am not so sure of what I am doing but to me the requests are the following :
1. AE creation
{
"m2m:rqp": {
"m2m:fr" : "admin:admin",
"m2m:to" : "/mn-cse/mn-name",
"m2m:op" : 1,
"m2m:rqi": 2222222,
"m2m:pc": {
"m2m:ae": {
"api": "123",
"rr": "true",
"rn": "SENSOR2"
}
},
"m2m:ty": 2
}
}
2.Container Creation
{
"m2m:rqp" : {
"m2m:fr" : "SENSOR2",
"m2m:to" : "/mn-cse/mn-name/SENSOR2",
"m2m:op" : 1,
"m2m:rqi": 123456,
"m2m:pc": {
"m2m:cnt" : {
"rn": "DATA"
}
},
"m2m:ty": 3
}
}
3. Content instance creation
{
"m2m:rqp": {
"m2m:fr": "SENSOR2",
"m2m:to": "/mn-cse/mn-name/SENSOR2/DATA",
"m2m:op": 1,
"m2m:rqi": "%s",
"m2m:pc": {
"m2m:cin": {
"cnf": "dht2",
"con": "%s"
}
},
"m2m:ty": 4
}
}
|
|
| | |
Goto Forum:
Current Time: Sun Oct 13 20:26:46 GMT 2024
Powered by FUDForum. Page generated in 0.08034 seconds
|