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

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

Attachment: log.out
Description: Binary data


Back to the top