Skip to main content



      Home
Home » Eclipse Projects » Kura » Bundle start too early (before network connectivity)(A bundle does it's activate when network is not available)
Bundle start too early (before network connectivity) [message #1795179] Mon, 17 September 2018 22:01 Go to next message
Eclipse UserFriend
I've developed an integration between Eclipse Kura 3.2 (on RPI) and Oracle IoT Cloud.

The integration has been developed as a configurable components, that reads messages from a configured topic and using Oracle IOT Gateway library sends messages to Oracle IoT CS.

Everything works fine if, after booting the RPI, I restart Kura (systemctl stop-start).
But if I try right after the RPI start, if doesn't send messages to Oracle IoT.

In kura.log I see

[Component Resolve Thread (Bundle 7)] ERROR o.e.k.e.I.OracleIoTClient - java.net.UnknownHostException: oc-144-21-82-178.compute.oraclecloud.com

It seems that the bundle is executing the first code accessing Oracle IoT (dowloading DeviceModels), too early, when network connection is not established.

Is there a way to start the bundle **only after** the newtwork connectivity has been setup?
Re: Bundle start too early (before network connectivity) [message #1795384 is a reply to message #1795179] Fri, 21 September 2018 03:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I believe you can use declarative services (DS) to set dependencies. In this way, your bundle will start only after the dependencies are satisfied.
If you are linked to the data service, you could also use it to be notified when connection is established.

Best regards,
Matteo
Re: Bundle start too early (before network connectivity) [message #1795450 is a reply to message #1795384] Sun, 23 September 2018 00:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi Matteo, thanks for your reply.

I understand the second part of your answer. In fact, wgat I have done is a lazy inizialization of the connectivity to Oracle Cloud.

Regarding DS... is there any example that shows how to do that? I apologize but I'm not the biggest expert in OSGi

Thanks for the reply and for the wonderful work done.

[Updated on: Sun, 23 September 2018 00:42] by Moderator

Re: Bundle start too early (before network connectivity) [message #1795451 is a reply to message #1795450] Sun, 23 September 2018 02:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
maybe have a look at what done here: https://github.com/eclipse/kura/blob/KURA_3.2.0_RELEASE/kura/examples/org.eclipse.kura.demo.heater/OSGI-INF/heater.xml
The component definition specifies a dependency to the CloudService and, due to this dependency, it will start only after the CloudService start.

Best regards,
Matteo
Re: Bundle start too early (before network connectivity) [message #1798822 is a reply to message #1795451] Mon, 26 November 2018 05:30 Go to previous message
Eclipse UserFriend
OK, thanks
Previous Topic:Thingspeak connexion
Next Topic:Kura 4.0 on Intel NUC
Goto Forum:
  


Current Time: Fri Jun 20 16:56:27 EDT 2025

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

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

Back to the top