Closed pgufAtIBM closed 8 years ago
@pgufAtIBM I copy here the contents of the email I've just set you:
I've installed your bundle.
There are no configurations of your org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud
(see below).
You have to create at least one configuration or nothing will show up in the Web UI. The simplest way is to add a gogo shell command in declarative service of your CloudServiceFactory. Please take a look to:
You basically have to provide a command to the gogo shell setting to properties:
<property name="osgi.command.scope" type="String" value="kura.cloud"/>
<property name="osgi.command.function" type="String">
createConfiguration
</property>
Just make sure you use a different command scope, for example watson.iot.cloud
.
Then from the gogo shell just type:
watson.iot.cloud:createConfiguration <configuration pid>
This should create a configuration and the services should appear in the Web UI.
osgi> ls
All Components:
ID State Component Name Located in bundle
1 Active org.eclipse.kura.usb.UsbService org.eclipse.kura.emulator.usb(bid=5)
2 Active org.eclipse.kura.clock.ClockService org.eclipse.kura.emulator.clock(bid=7)
3 Active org.eclipse.kura.crypto.CryptoService org.eclipse.kura.core.crypto(bid=8)
4 Active org.eclipse.kura.watchdog.WatchdogService org.eclipse.kura.emulator.watchdog(bid=21)
5 Active org.eclipse.kura.certificate.CertificatesService org.eclipse.kura.core.certificates(bid=24)
6 Active org.eclipse.kura.status.CloudConnectionStatusService org.eclipse.kura.core.status(bid=26)
7 Active org.eclipse.kura.log.LoggerService org.eclipse.kura.core.log(bid=33)
8 Active org.eclipse.kura.cloud.app.command.CommandCloudApp org.eclipse.kura.core.cloud(bid=34)
9 Active org.eclipse.kura.core.cloud.factory.DefaultCloudServiceFactory org.eclipse.kura.core.cloud(bid=34)
10 Active org.eclipse.kura.cloud.CloudCallService org.eclipse.kura.core.cloud(bid=34)
11 Active org.eclipse.kura.cloud.CloudService org.eclipse.kura.core.cloud(bid=34)
12 Active org.eclipse.kura.core.comm.CommConnectionFactory org.eclipse.kura.core.comm(bid=36)
13 Active org.eclipse.kura.deployment.agent org.eclipse.kura.deployment.agent(bid=39)
14 Active org.eclipse.kura.position.PositionService org.eclipse.kura.emulator.position(bid=42)
15 Active org.eclipse.kura.emulator.Emulator org.eclipse.kura.emulator(bid=43)
16 Active org.eclipse.kura.web.Console org.eclipse.kura.web(bid=47)
17 Active org.eclipse.kura.system.SystemAdminService org.eclipse.kura.core(bid=52)
18 Active org.eclipse.kura.ssl.SslManagerService org.eclipse.kura.core(bid=52)
19 Active org.eclipse.kura.db.DbService org.eclipse.kura.core(bid=52)
20 Active org.eclipse.kura.system.SystemService org.eclipse.kura.core(bid=52)
21 Active org.eclipse.kura.data.DataService org.eclipse.kura.core(bid=52)
22 Active org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport org.eclipse.kura.core(bid=52)
23 Active org.eclipse.equinox.event org.eclipse.equinox.event(bid=59)
24 Active org.eclipse.kura.net.NetworkService org.eclipse.kura.emulator.net(bid=61)
25 Active org.eclipse.kura.configuration.ConfigurationService org.eclipse.kura.core.configuration(bid=62)
26 Active org.eclipse.kura.core.configuration.CloudConfigurationHandler org.eclipse.kura.core.configuration(bid=62)
27 Active org.eclipse.kura.gpio.GPIOService org.eclipse.kura.emulator.gpio(bid=63)
28 Active org.eclipse.kura.core.deployment.CloudDeploymentHandlerV2 org.eclipse.kura.core.deployment(bid=67)
29 Unsatisfied org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud org.eclipse.kura.core.cloud.watsoniot(bid=75)
30 Active org.eclipse.kura.core.cloud.watsoniot.factory.WatsonIoTCloudServiceFactory org.eclipse.kura.core.cloud.watsoniot(bid=75)
osgi> comp 29
Component[
name = org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud
activate = activate
deactivate = deactivate
modified = updated
configuration-policy = require
factory = null
autoenable = true
immediate = false
implementation = org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloudServiceImpl
state = Unsatisfied
properties = {service.pid=org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud}
serviceFactory = false
serviceInterface = [org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud, org.eclipse.kura.configuration.ConfigurableComponent]
references = {
Reference[name = DataService, interface = org.eclipse.kura.data.DataService, policy = static, cardinality = 1..1, target = null, bind = setDataService, unbind = unsetDataService]
}
located in bundle = org.eclipse.kura.core.cloud.watsoniot_1.0.0.201608092134 [75]
]
Dynamic information :
The component is satisfied
All component references are satisfied
Component configurations :
*The component has NO built configurations! The reason might be that it requires initialization by configuration provided by Configuration Admin but none was found
Is there a way to activate the bundle over console? If yes, how? Can I deactivate in the meantime the default bundle so that only my bundle is connected to Watson IoT (cause both would use the same MqttDataTransport configuration...
You don't need to deactivate the default Kura connection. You CloudServiceFactory should create its own instances of the DataService and MqttDataTransport.
I have modified now my bundle project and added a cloudServiceFactory.xml in folder OSGI-INF with following content: `<?xml version="1.0" encoding="UTF-8"?>
@pgufAtIBM Closing this because the issue is not tracked in #515. Please comment #515.
I have created a bundle that allows to connect to Watson IoT Cloud (based on https://github.com/eclipse/kura/wiki/Multiple-Cloud-Connections and with help of Cristiano De Alti). I successfully installed my bundle on Kura gateway on my Raspberry Pi (https://eclipse.org/kura/downloads.php -> Raspbian (Model 2) - Stable version). When I start the bundle, no errors are shown and the bundle changes to state ACTIVE.
In the kura.log following entry is added: INFO o.e.k.c.c.ConfigurationServiceImpl - Registering metatype pid: org.eclipse.kura.core.cloud.watsoniot.WatsonIoTCloud with ocd: org.eclipse.kura.core.configuration.metatype.Tocd@b55bde ...
Then I switch to the Web UI, select "Status" -> "Connect" the newly installed bundle for cloud connection does not show up.
Is there a way to activate the bundle over console? If yes, how? Can I deactivate in the meantime the default bundle so that only my bundle is connected to Watson IoT (cause both would use the same MqttDataTransport configuration...
Thank you for your help!