Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [om2m-dev] OM2M - MQTT Request and Response

Dear Andreas,

Thanks a lot. This suggestion did help. I am able to query and create the AE as well.

Create AE payload:
{
  "m2m:rqp": {
    "m2m:fr": "CAE_123",
    "m2m:to": "/in-cse/in-name",
    "m2m:op": 1,
    "m2m:rqi": 123456,
    "m2m:pc": {
      "m2m:ae": {
        "rn": "ae-nmcu",
        "api": "api-id",
        "rr": true
      }
    },
    "m2m:ty": 2
  }
}

As you mentioned, this is definitely not as per the oneM2M defined structure and will break the interoperability of OM2M with other implementations. I am not sure if there are plans to fix this!

Is there any place, I can find some payload structures for different types of requests ?

Regards,
Samar


On Sat, Mar 8, 2025 at 10:48 PM Andreas Kraft <akrzero@xxxxxxxxxxxxxx> wrote:
Samar,

As I wrote, om2m had interoperability problems with the encodings in the past, and it seems to me that unfortunately they have not been solved.
The representations you have are not interoperable with other implementations.

That said, without having it tried myself, I would suggest to add the “m2m:” domain prefix to the attributes in your request, e,g,

{
  "m2m:rqp": {
    “m2m:op": 2,
    “m2m:fr": "CAE",
    “m2m:to": "/in-cse/in-name",
    “m2m:rqi": "123456",
    “m2m:rvi": "1"
  }
}

Does this help?

Best
Andreas


On 8. Mar 2025, at 06:37, samar shailendra <samarshailendra@xxxxxxxxx> wrote:

Thanks Andreas,

I have been following the OM2M document for MQTT bindings MQTT Binding · Wiki · Eclipse Projects / Eclipse OM2M / om2m · GitLab..

Even though I tried without the m2m: rqp structure as you suggested, how it did not work, in fact m2m: rqp seems to be mandatory in OM2M. 

Then I tried just the Get request as follows: 

Topic: /oneM2M/req/CAE/in-cse/json

Get Request Payload:
{
  "m2m:rqp": {
    "op": 2,
    "fr": "CAE",
    "to": "/in-cse/in-name",
    "rqi": "123456",
    "rvi": "1"
  }
}

However still, "No Operation Provided" response is received on Topic: /oneM2M/resp/in-cse/CAE/json

Response Payload :
{
   "m2m:rsp" : {
      "m2m:rsc" : 4000,
      "m2m:pc" : "No Operation provided",
      "m2m:fr" : "/in-cse"
   }
}

I am also attaching the debug logs from OM2M. In this, "Line 1280 to Line 1345" shows that after unmarshalling the requestPrimitive is Empty (Line 1308). Not sure where the mistake is ! Any suggestions would be quite helpful.

Regards,
Samar


On Sat, Mar 8, 2025 at 5:01 AM Andreas Kraft <akrzero@xxxxxxxxxxxxxx> wrote:
Samar,

You should send the request without extra wrapping it in a “m2m:rqp” structure. Also, it misses the “rvi” attribute.  And “fr” should start with a “C” or “S”, but I guess om2m doesn’t do the check. Also, if you want to create an AE, you must provide the necessary <AE> attributes, not a <CNT>.

What worries me is that the response you received seems to have a structure “m2m:rsp”. But that is wrong on so many parts:
- response is not extra wrapped as “m2m:rsp” (ie. The received structure is the response)
- rqi missing
- providing namespace for attributes (one usually does not)
-  “pc” contains a string (should be “m2m:dbg” for an error message)
etc

With MQTT and WS bindings one basically sends the “pure” oneM2M requests.


Best
Andreas



On 7. Mar 2025, at 13:47, samar shailendra via om2m-dev <om2m-dev@xxxxxxxxxxx> wrote:

Dear Team,

I am able to set up oneM2M with Rest MongoDB. 

I am now trying to make MQTT work as well. I have enabled the MQTT bundle, and am able to connect with Mongo DB as well. 

However, when I am sending the request to create AE (or even any retrieve request), it responds on the resp topic saying "No Operation Provided". 

Any advice on what is wrong with the payload json or why the operation is recognized would be very helpful...


The topic that I have used: 

/oneM2M/req/origin/in-cse/json

The payload is : 
{
  "m2m:rqp" : {
    "fr" : "origin",
    "to" : "/in-cse",
    "op" : 1,
    "rqi" : 123456,
    "pc" : {
      "m2m:cnt" : {
        "rn" : "ae-nmcu"
      }
    },
    "ty" : 2
  }
}

The response topic:
/oneM2M/resp/in-cse/origin/json

The response I receive:
{
   "m2m:rsp" : {
      "m2m:rsc" : 4000,
      "m2m:pc" : "No Operation provided",
      "m2m:fr" : "/in-cse"
   }
}

Regards,
Samar


_______________________________________________
om2m-dev mailing list
om2m-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/om2m-dev

<log.out>


Back to the top