Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Connect devices to your gateway(Two mechanisms showing how to connect devices to the gateway.)
Connect devices to your gateway [message #1641034] Sat, 28 February 2015 11:08 Go to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
There are two mechanisms to connect devices to your gateway.

1) Connect HTTP or CoAP enabled devices using simple re-targeting.
Let's suppose that you have a HTTP-enabled plug device with IP address and listening on port 9090.
Let's suppose that you can also monitor and control this plug using this two specific HTTP requests:

GET To get the power consumption value from the plug.
POST To switch on/off the plug.

Since, by default OM2M offers the HTTP binding, then you can create an application resource called MY_DEVICE containing "" as specific Application Point of Contact Path (aPoCPath).
HTTP request example:
<om2m:application xmlns:om2m="[url][/url]" appId="MY_DEVICE">

That's all. Now when you can send a HTTP GET request to the GSCL with this URI "", the GSCL will automatically translate it to based on the information stored on the APoC.
Then, the HTTP request is automatically re-targeted to your plug device, and the HTTP response containing the power consumption is returned to you.
If you send a HTTP POST request with empty body to the GSCL with this URI "", it will be automatically translated to and re-targeted to your device to toggle it.

In addition, you can create an oBIX XML description for the MY_DEVICE application within a specific container to advertise your device operations and simplify their discovery.
Let's suppose that the "DESCRIPTOR" container is already created in this URL: /gscl/applications/MY_DEVICE/containers/DESCRIPTOR

HTTP request example:
    <str name="type" val="xxxx"/>
    <str name="location" val="yyyy"/>
    <op name="get" href="gscl/applications/MY_DEVICE/spower" is="retrieve"/>
    <op name="toggle" href="gscl/applications/MY_DEVICE/toggle" is="execute"/>

If you check the created contentInstance on the OM2M web interface, you will find the device attributes and nice buttons that you can use to monitor and control your device.

You can use also use "create" (is="create") and delete (is="delete") operations if needed.

Since OM2M implements the CoAP communication binding, CoAP-enabled devices can be integrated using the same approach explained for HTTP.

2) Connect legacy devices using an Interworking Proxy Unit (IPU) Plugin
To integrate IP-enabled devices speaking other protocols like MQTT or non IP-enabled devices like Zigbee, you need to create a specific Interworking Proxy Unit (IPU) plugin to make the required mapping.

You can create an application resource called MY_DEVICE containing the string "ipu-id" as specific aPoCPath.
HTTP request example:
<om2m:application xmlns:om2m="" appId="MY_DEVICE">

Now, if you send a HTTP request to the GSCL to this URI "", it will be delegated to the IPU plugin with ID "ipu-id" and handled specifically by the IPU Controller class.

The IPU lamps plugin already provided in the OM2M source code shows a good example on how to integrated specific devices using the inter-working proxy mechanism.

Check the following developer guide to learn how to add a new plugin to OM2M and implement you own IPU with a basic sensor and actuator:

Hope this can help

[Updated on: Tue, 12 May 2015 14:07]

Report message to a moderator

Re: Connect devices to your gateway [message #1741372 is a reply to message #1641034] Wed, 24 August 2016 13:40 Go to previous message
yoshida takuma is currently offline yoshida takumaFriend
Messages: 16
Registered: August 2016
Junior Member
Hello Mahdi,

I have a question for the second case "Connect legacy devices using an Interworking Proxy Unit (IPU) Plugin". As far as I understand that the IPU plays a role as a bridge for mapping between CSE entities in M2M network and legacy devices network. In the IPU Lamp example which included inside of OM2M, I understand that a "fake" lamp is created to communicate with CSE via this IPU plugin, but in reality in case if I have a real legacy device such as zigbee, how can my device communicate with this IPU? Which protocol is used for this communication?

Best regards,
Previous Topic:Is the redirect request between CSE always HTTP Protocol?
Next Topic:OM2M semanticDescriptor resource
Goto Forum:

Current Time: Fri Feb 03 18:05:07 GMT 2023

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

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

Back to the top