Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » update installed package remotely(is there a mechanism to update a kura package remotely)
update installed package remotely [message #1709646] Wed, 30 September 2015 00:56 Go to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
as is suggested by numerous sources it is possible to remotely manage the deployment of installs/updates of kura plugins/packages/bundles, however I cannot find any clear documentation regarding how to do this.

For example, I have a single deployment package (dp) to update on multiple distributed devices. how can I do this (excluding the web console)?


https://wiki.eclipse.org/images/c/c0/Eclipse_Kura_-_IoT_day_Grenoble_2014.pdf
"Provision your application to field devices from the Cloud. Manage your application configuration and lifecycle from a Cloud infrastructure. No more field visits!
• Web-based Console
• REST API Integration
• Smart Alerts"

https://www.eclipse.org/proposals/technology.kura/
"Remote Management
Allow for remote management of the M2M applications installed in Kura including their deployment, upgrade and configuration management. The Remote Management service relies on the Configuration Service and the Cloud Service."
Re: update installed package remotely [message #1709689 is a reply to message #1709646] Wed, 30 September 2015 12:09 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
documentation seems lacking -- however the best I could find did help me solve this.

http://eclipse.github.io/kura/ref/mqtt-namespace.html
Re: update installed package remotely [message #1709728 is a reply to message #1709689] Wed, 30 September 2015 14:46 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Paul,

I am glad you found the document, that is going to be your best resource. Documentation is always a challenge, what do you feel is lacking? Is there something you are trying to do not outlined in the document?

Thanks,
--Dave
Re: update installed package remotely [message #1709782 is a reply to message #1709728] Thu, 01 October 2015 05:22 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
thanks for the follow up date. in this case, I was doing considerable searching on terms such as "kura osgi remote install" "kura mqtt package update" "kura remote system management". I had seen the MQTT namespace best practices document before, however had forgotten that it included what I needed. The title is misleading in that it contains much more than best practices.
Re: update installed package remotely [message #1711316 is a reply to message #1709782] Wed, 14 October 2015 23:22 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Dave, where is the documentation re "$EDC/#/MQTT/BIRTH", "$EDC/#/MQTT/APPS", "$EDC/#/MQTT/DC" ?

Is it possible to request the "APPS" message?

Since lifecycle messages are not retained, if a device is always up and never changes, there may be no way to ever learn it's state.

[Updated on: Wed, 14 October 2015 23:31]

Report message to a moderator

Re: update installed package remotely [message #1711417 is a reply to message #1711316] Thu, 15 October 2015 19:33 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Paul,

We don't really have these documented anywhere, what kind of information are you looking for? If you are interested in how the messages are constructed, you can review the source code [1].

When you say 'request the "APPS" message', do you mean subscribe to the topic? If so, you should implement the CloudClientListener interface. There is a method, onControlMessageArrived, that should do this for you. Then your CloudClient object should call addCloudClientListener to add your implementation.

You are correct, lifecycle messages are not retained, but if this is your use case you may want to store these messages in a database anyway. These messages would not persist a broker restart for example. That said, if you want the life cycle message to be published and retained, you would need to customize Kura. It would be a small change, you would just need to change LIFECYCLE_RETAIN to true in the CloudServiceOptions file [2]. I will propose making this a configurable value in future releases.

[1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/java/org/eclipse/kura/core/cloud/CloudServiceImpl.java
[2] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.core.cloud/src/main/java/org/eclipse/kura/core/cloud/CloudServiceOptions.java

Thanks,
--Dave
Re: update installed package remotely [message #1711545 is a reply to message #1711417] Sat, 17 October 2015 04:10 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Hi Dave,

I've reverse engineered usage of these topics - particularly 'BIRTH'. Yes, the source code seems to be the best available documentation unfortunately.

The problem is, the APPS message is called whenever an app is activated/deactivated, ie multiple times on shutdown. it is therefore often not an accurate list of installed apps, when it is published automatically.
the BIRTH message is always reliable, however could possibly only publish once if a device is never rebooted. Same goes for the APPS message, it may never change/publish after initial reboot.

The information these messages contain is vital however for our 'remote-controller' - os version, kura version, java version, apps, etc etc.

Therefore, is there a nice way to publish something to the kura device which may trigger the APPS message to be published? The only thing I can think of is to create a dummy DP and install/remove it using EXEC/INSTALL.

Another option, as you've pointed out which I will now investigate is configuring kura to publish the BIRTH/APPS messages with retain so that the 'remote-controller' can receive the latest for each kura device when it subscribes.
Re: update installed package remotely [message #1712286 is a reply to message #1711545] Thu, 22 October 2015 16:14 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Paul,

Sorry for the delayed response. I am not sure I understand why the APPS messages would not be an accurate list of installed apps. Each time an apps activate/deactivate is called, a new APPS message is published. Part of this messages payload is a list of application IDs. On activate, the app ID is added. On deactivate, the app ID is removed. Are you calling CloudClient.release() in your deactivate method?

We had not considered your use case for the CloudService. I agree, we need to add documentation related to lifecycle messages.

Thanks,
--Dave
Re: update installed package remotely [message #1712444 is a reply to message #1712286] Sun, 25 October 2015 01:57 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
Yes, calling client.release() on deactivate.

When you shutdown kura, you receive multiple 'APPS' messages, once each time one of the apps is disabled.

Therefore, the last message you get on shut-down is: no apps are installed.

I have a cloud-controller listening to the 'APPS' messages - and its job is to install software on devices when it isn't present or is out of date.
It would recieve this last message and would think it needs to re-install a plugin, which would be counter-productive.

Therefore, while 'APPS' on the surface seems like exactly what I needed, it seems it is not suited.

Does that make more sense dave?

I think I can solve this doing a "/GET/packages" combined with "BIRTH", do you have other suggestions?
Re: update installed package remotely [message #1712598 is a reply to message #1712444] Mon, 26 October 2015 17:04 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hi Paul,

The automated nature of your cloud-controller does make this tricky. I like the "/GET/packages" idea, that should definitely work. The other thought would be to send some sort of shutdown message with a device ID. If the cloud-controller received this message it would know to ignore the following 'APPS' messages. I think the GET approach may be cleaner.

Thanks,
--Dave
Re: update installed package remotely [message #1712625 is a reply to message #1712598] Mon, 26 October 2015 22:07 Go to previous messageGo to next message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
righto thanks, just checking i wasn't missing something better.
Re: update installed package remotely [message #1713641 is a reply to message #1712625] Thu, 05 November 2015 16:22 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

A bug has been created to track the feature request of making the CloudService more configurable. The bug can be found here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481526 .

Thanks,
--Dave
Re: update installed package remotely [message #1713945 is a reply to message #1713641] Sun, 08 November 2015 22:53 Go to previous message
paul stanton is currently offline paul stantonFriend
Messages: 87
Registered: July 2009
Member
specifically for this thread's scenario are you thinking "LIFECYCLE_RETAIN" would help solve?
Previous Topic:Hardware requirements for Kura and JVM
Next Topic:End to End IoT solution with Eclipse IoT
Goto Forum:
  


Current Time: Fri Apr 26 02:25:48 GMT 2024

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

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

Back to the top