Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » DA subscribe DATA on another GSCL
DA subscribe DATA on another GSCL [message #1690295] Thu, 26 March 2015 12:04 Go to next message
Yi-Lan Lin is currently offline Yi-Lan LinFriend
Messages: 1
Registered: March 2015
Junior Member
Hi all,

I try to use Raspberry Pi building many gateways. And then, run GSCL on them and run NSCL on server. Assume gateways and server have public IP can register to each other.

Now I have 2 gateways:
GW1 : private IP = 192.168.10.1
Devices under GW1 in 192.168.10.0/24

GW2 : private IP = 192.168.20.1
Devices under GW2 in 192.168.20.0/24

If I have a device under GW2 want to subscribe DATA registered on GW1. It may register that "please contact 192.168.20.3", but GW1 is not in that subnet.

Is there any method to do the subscription?
Or only can use GET message to ask the DATA from Device Application.

Thanks,

Yi-Lan
Re: DA subscribe DATA on another GSCL [message #1690551 is a reply to message #1690295] Sat, 28 March 2015 16:39 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Yi-Lan,

First of all, I recommend you to download or clone the last version of OM2M. (All third libraries are now validated by Eclipse)

There is 3 solutions to enable a device under GW2 to subscribe DATA registered on GW1:
Solution 1:
Create the subscription using the public IP address of GW2.

Solution 2:
Create the subscription using an Application Point of Contact (APoC) URI.
Let's suppose that your device is listening at http://192.168.20.3:1400/dev-path
a) Create an application resource for your device under GW2 with "http://192.168.20.3:1400" as APoC (without the "/dev-path" portion).
Application representation example:
<om2m:application xmlns:om2m="http://uri.etsi.org/m2m" appId="DEV_ID">
   <om2m:aPoCPaths>
       <om2m:aPoCPath>
             <om2m:path>http://192.168.20.3:1400</om2m:path>
       </om2m:aPoCPath>
   </om2m:aPoCPaths>
</om2m:application>

b) Subscribe your device Application to the DATA under GW1. Use the relative URI of the Application + /dev-path portion as Contact URI (e.g. please contact /GW2_ID/applications/DEV_ID/dev-path) .
Now, once a new data is created under GW1, it will be dynamically re-targeted from GW1 to NSCL, then from NSCL to GW2, then from GW2 to your device at http://192.168.20.3:1400/dev-path.

Solution 3:
Create the subscription using a container relative URI as follows:
a) Create a local container called "NOTIF" under GW2.
b) Subscribe your device, which is under GW2, to this local "NOTIF" container (e.g. please contact http://192.168.20.3:1400/dev-path)
c) Subscribe the "NOTIF" container to the DATA under GW1. Use the relative URI of the "NOTIF" container as Contact URI (e.g. please contact /GW2_ID/applications/DEV_ID/containers/NOTIF/contentInstances) .
Now, once a new data is created under GW1, it will be re-targeted from GW1 to NSCL, then from NSCL to GW2. This latter will create the data under NOTIF container, and so your device will be notified.

You can use the http server example (monitor) available on the following tutorial to test your scenario: https://wiki.eclipse.org/OM2M/REST_API#Subscribe_to_MY_SENSOR_data
Hope this can help.

[Updated on: Sun, 29 March 2015 00:24]

Report message to a moderator

Re: DA subscribe DATA on another GSCL [message #1691395 is a reply to message #1690551] Tue, 07 April 2015 03:26 Go to previous messageGo to next message
David Antliff is currently offline David AntliffFriend
Messages: 10
Registered: April 2015
Junior Member
Hi Mahdi,

Thank you for outlining three possible solutions. I'm interested to know, given the appropriate substitution for terms like IN-CSE for NSCL, whether all three of these solutions are generally applicable to oneM2M too? Does oneM2M provide any additional solutions to this problem?

In particular, solution 1 suggests that GW1 can communicate directly with GW2, even though neither is registered with the other. This seems to fit uncomfortably with the oneM2M architecture where CSEs must be registered in order to communicate. Is this a significant difference between the two architectures?

Re: DA subscribe DATA on another GSCL [message #1691655 is a reply to message #1691395] Wed, 08 April 2015 18:32 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello David,

No, this is not a significant difference between SmartM2M and OneM2M architectures. In fact, solution 1 is not explicitly defined in SmartM2M, but we decided to tolerate it in OM2M to offer more flexibility and choices to developers.
Main differences between the two architectures are:
OneM2M defined a new node called MN-CSE (Middle Node CSE) also called Transit-CSE for multi-hop communications. So, a more advanced routing mechanism is required here to re-target the request from a node to another.
In addition, OneM2M introduced two new types of requests called "Non blocking Synchronous Request" and "Non Blocking Asynchronous Request".
A new interface called mcn is also defined to handle the communication between a CSE and an Underlying Network.
MQTT communication binding is provided.
LightweightM2M device management is supported as well.

Have a good day

[Updated on: Wed, 08 April 2015 18:33]

Report message to a moderator

Re: DA subscribe DATA on another GSCL [message #1691671 is a reply to message #1691655] Wed, 08 April 2015 22:59 Go to previous messageGo to next message
David Antliff is currently offline David AntliffFriend
Messages: 10
Registered: April 2015
Junior Member
Mahdi Ben Alaya wrote on Wed, 08 April 2015 18:32
No, this is not a significant difference between SmartM2M and OneM2M architectures. In fact, solution 1 is not explicitly defined in SmartM2M, but we decided to tolerate it in OM2M to offer more flexibility and choices to developers.
Main differences between the two architectures are:
OneM2M defined a new node called MN-CSE (Middle Node CSE) also called Transit-CSE for multi-hop communications. So, a more advanced routing mechanism is required here to re-target the request from a node to another.
In addition, OneM2M introduced two new types of requests called "Non blocking Synchronous Request" and "Non Blocking Asynchronous Request".
A new interface called mcn is also defined to handle the communication between a CSE and an Underlying Network.
MQTT communication binding is provided.
LightweightM2M device management is supported as well.


Thanks for your response, Mahdi. In one routing experiment, we attempted to register a GSCL with another GSCL to create a longer chain, but ran into problems with this - I suppose this is explained by the lack of multi-hop support as you say.
Re: DA subscribe DATA on another GSCL [message #1692505 is a reply to message #1691671] Thu, 16 April 2015 09:41 Go to previous message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello David,

In SmartM2M, multihop can be done only through the NSCL. Example: A1 -> GSCL1 -> NSCL -> GSCL2 -> A2
Technically, it is easy to register a GSCL with another GSCL but a more advanced routing mechanism should be defined.

Mahdi
Previous Topic:Add required libraries
Next Topic:OM2M available plugins
Goto Forum:
  


Current Time: Thu Apr 25 05:08:59 GMT 2024

Powered by FUDForum. Page generated in 0.03769 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top