Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » OM2M » Communication between two plugins
Communication between two plugins [message #1717627] Tue, 15 December 2015 11:06 Go to next message
Fran Pelc is currently offline Fran PelcFriend
Messages: 3
Registered: December 2015
Junior Member
Hello,

I added two new plugins to org.eclipse.om2m: sensor and actuator. Sensor is on GSCL and actuator is on NSCL. Now I'm stuck at the point that actuator is created under "applications" on GSCL and NSCL, also sensor data is sent to actuator on GSCL.

I've put dependency on sensor plugin towards actuator and I'm calling method from AktuatorMonitor to send sensor data. I figured that everytime I call the method from actuator plugin , ACTUATOR is created on GSCL.

Can I somehow make "communication" between them without creating actuator on GSCL (sensor[GSCL] gets new measurement and sends it to actuator[NSCL])?

Thank You
Re: Communication between two plugins [message #1717814 is a reply to message #1717627] Wed, 16 December 2015 23:18 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Fran,

1) I don't understand why the actuator is created under "applications" on both GSCL and NSCL. Normally if you want the actuator to be on the server side, then you should create it on the NSCL only. Could you clarify this point ?
2) I am not sure that the dependency you added between sensor and actuator plugins is relevant since, in general, these two devices are distributed in different nodes (NSCL and GSCL). Are you sure that you need direct library call for your scenario ?
3) Yes, but I need more information on your use case to help you.

Waiting for your inputs,
Best regards,
Mahdi
Re: Communication between two plugins [message #1717974 is a reply to message #1717814] Fri, 18 December 2015 11:20 Go to previous messageGo to next message
Fran Pelc is currently offline Fran PelcFriend
Messages: 3
Registered: December 2015
Junior Member
hi,
ok for 1) and 2) I get Your point.

For 3) scenario is: two sensors(GSCL) get values every 10sec, then they send it to actuator (NSCL). For this example I have two states: "cheap" and "expensive" network which will be randomly generated every 20sec . If network is "cheap", actuator accepts the values, if "expensive" he returns time to wait for resend (lets say 5min).

For now I managed to put or "send" the values to actuator with "SCL.doRequest(new RequestIndication("CREATE", targetAktuator, REQENTITY, content));" - for now without the network price.

Thank You,
Fran

[Updated on: Fri, 18 December 2015 11:20]

Report message to a moderator

Re: Communication between two plugins [message #1719609 is a reply to message #1717974] Sat, 09 January 2016 21:33 Go to previous messageGo to next message
Fran Pelc is currently offline Fran PelcFriend
Messages: 3
Registered: December 2015
Junior Member
Hello,
this is what I managed to do:
1) on GSCL I have one application Sensor (new values every 10sec) and sends values to Controller on NSCL,
2) on NSCL I have application Controller and also one generator method for generating network price,
3) In Sensor application I put dependency to Controller application because I need to ask Controller for network price in generator method - for my assignment it is important that the price is generated on server side.

And now I have problem that application Controller is created on GSCL and NSCL after the first value is sent . I can't find why.
Controller IPU service is registered when I start plugin in NSCL cmd and seems also again when sending first value (but then it is created on GSCL).



EDIT: everything working, all done

[Updated on: Sun, 10 January 2016 16:45]

Report message to a moderator

Re: Communication between two plugins [message #1736832 is a reply to message #1719609] Sat, 02 July 2016 14:11 Go to previous messageGo to next message
Trung Luu is currently offline Trung LuuFriend
Messages: 32
Registered: June 2016
Member
Hi Franc Pelc,

I'm trying to seperate Sensor and Actuator into two services but it's not work, could you please share me your source code if it possibile. Many thanks.

Best Regards,

Trung
Re: Communication between two plugins [message #1737215 is a reply to message #1736832] Wed, 06 July 2016 12:57 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
Hello Trung,
We need more details about your issue.
Re: Communication between two plugins [message #1737220 is a reply to message #1737215] Wed, 06 July 2016 13:06 Go to previous messageGo to next message
Trung Luu is currently offline Trung LuuFriend
Messages: 32
Registered: June 2016
Member
Hello Mahdi,

My issue is i'm adding sensor and actuator in MN-CSE and IN-CSE respectively, Now after the sensor random the value, I want the actuator send the subscribe message to sensor and then the sensor notify the value to actuator. I'm using OM2M ver 1.0.

Best Regards,

Trung
Re: Communication between two plugins [message #1737257 is a reply to message #1737220] Wed, 06 July 2016 16:27 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
There are two ways to integrate sensors and actuators to the IoT system.
1) Using standalone application (Simple)
OM2M supports several communication bindings such as HTTP that can be used to interact with the API.
If you want to integrate a sensor, you can simply write a HTTP client using JAVA or any other language that create required resources (AE, Container, ContentInstance, etc.) on the MN-CSE or IN-CSE.
If you want to integrate an actuator, you can simply write a HTTP server that listen on certain port. Using a HTTP client you can create a some specific resource (e.g. "state" container) where you can subscribe and receive events on the HTTP server to change the actuator state. You can also define a PoA and receive notification requests directly on your HTTP server using the retargeting mechanism without the need to create subscriptions.

2) Using OSGi plugin (Require some skills in RCP development)
Will do the same job defined in 1) but using direct library call via inter plugins communication (faster without going through HTTP).
Check "add your plugin" tutorial:
http://wiki.eclipse.org/OM2M/one/Developer
Re: Communication between two plugins [message #1737266 is a reply to message #1737257] Wed, 06 July 2016 17:56 Go to previous messageGo to next message
Trung Luu is currently offline Trung LuuFriend
Messages: 32
Registered: June 2016
Member
Dear Mahdi,
Thanks for your support, and I have one more question that: Is OM2M application need a central server to run? Thanks again.

Best Regards,

Trung
Re: Communication between two plugins [message #1737315 is a reply to message #1737266] Thu, 07 July 2016 09:07 Go to previous messageGo to next message
Trung Luu is currently offline Trung LuuFriend
Messages: 32
Registered: June 2016
Member
Dear Mahdi,
I have already create the plug-in by follow the tutorial of "Add your plug-in". However, when I click on "get direct" button on the webservice, it return the error 404 or 500 and in the actuator application, the memorizedactuator value always the same with the actualactuatorvalue so when will it change the state? Thanks for your consideration.
Best Regards,

Trung
Re: Communication between two plugins [message #1737394 is a reply to message #1737315] Thu, 07 July 2016 17:56 Go to previous messageGo to next message
Mahdi Ben Alaya is currently offline Mahdi Ben AlayaFriend
Messages: 229
Registered: November 2013
Senior Member
But "get direct" is not supposed to change the state of the actuator.
It will only read the state and return back the value right ?

I suggest you to add operations "ON" "OFF" as defined in the tutorial:
Then make sure that the method "doExecute" of the "IPE Controller" class is called when you click on "ON" or "OFF" button. (Show some text in the CSE console)


Re: Communication between two plugins [message #1737434 is a reply to message #1737394] Fri, 08 July 2016 08:28 Go to previous message
Trung Luu is currently offline Trung LuuFriend
Messages: 32
Registered: June 2016
Member
Dear Mahdi,
thank you for your support. I will try on this way.

Best Regards,

Trung
Previous Topic:Trouble with dependencies
Next Topic:Ask a question about subscribe a lamp event
Goto Forum:
  


Current Time: Thu Apr 18 14:59:16 GMT 2024

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

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

Back to the top