Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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] Tue, 18 September 2018 02:01 Go to next message
Luigi Saetta is currently offline Luigi SaettaFriend
Messages: 7
Registered: September 2018
Junior Member
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 07:26 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
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 04:41 Go to previous messageGo to next message
Luigi Saetta is currently offline Luigi SaettaFriend
Messages: 7
Registered: September 2018
Junior Member
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 04:42]

Report message to a moderator

Re: Bundle start too early (before network connectivity) [message #1795451 is a reply to message #1795450] Sun, 23 September 2018 06:36 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
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 10:30 Go to previous message
Luigi Saetta is currently offline Luigi SaettaFriend
Messages: 7
Registered: September 2018
Junior Member
OK, thanks
Previous Topic:Thingspeak connexion
Next Topic:Kura 4.0 on Intel NUC
Goto Forum:
  


Current Time: Wed Apr 24 23:26:49 GMT 2024

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

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

Back to the top