Home » Eclipse Projects » Kura » Bundle Remote Update(Gateway is another network.)
Bundle Remote Update [message #1734200] |
Mon, 06 June 2016 03:02  |
Eclipse User |
|
|
|
Hi,
I need to find a way to update my Kura bundle[1] (deployed on RaspberryPi) remotely. I know the kura's web gui is works perfect but the point is, the device is not my network. Simply, I can't reach my device. But luckily, device can connect to the internet (mosquitto broker).
So, I thought that if I write another bundle[2] that listens specific mqtt-topic for my commands. And if I need to update bundle[1], I can talk my device via bundle[2] , update my bundle or change settings of Kura.
I want to hear your thoughts. Maybe I'm missing some point.
Thanks,
Said.
|
|
| | |
Re: Bundle Remote Update [message #1734593 is a reply to message #1734537] |
Thu, 09 June 2016 11:37   |
Eclipse User |
|
|
|
Hi again,
I made some progress today. I noticed Amit's application [1]. I tried to use DEPLOY-V2 to update deployment package but I didn't achieve.
Here is what i add to payload beyond request.id and requester.client.id;
payload.addMetric("dp.uri", "https://s3-us-west-2.amazonaws.com/dzmtzxbieb/terminator.dp");
payload.addMetric("dp.name", "terminator");
payload.addMetric("dp.version", "1.0.0");
payload.addMetric("dp.download.protocol", "HTTPS");
Here is the log;
2016-06-09 17:37:43,578 [MQTT Call: B8:27:EB:19:50:BC] INFO o.e.k.c.c.CloudServiceImpl - Message arrived on topic: $EDC/test/B8:27:EB:19:50:BC/DEPLOY-V2/EXEC/download
2016-06-09 17:37:43,640 [pool-1-thread-1] INFO o.e.k.c.d.CloudDeploymentHandlerV2 - Malformed download request!
2016-06-09 17:37:43,648 [pool-1-thread-1] ERROR o.e.k.c.c.CloudPayloadProtoBufEncoderImpl - During serialization, ignoring metric named: response.exception.message. The value is null.
[1] = https://github.com/amitjoy/Kura-MQTT-Client-Utility
|
|
|
Re: Bundle Remote Update [message #1734608 is a reply to message #1734593] |
Thu, 09 June 2016 16:26   |
Eclipse User |
|
|
|
Hello Said,
As you found out, the CloudClient will not work for this. If you want to use Kura you would need to use the DataService. This gives you complete control over the topic structure.
That said, there may be a bug in our documentation. Looking at the code, it appears two other fields are mandatory for the payload. Can you try adding these:
// Job ID, data type is long
payload.addMetric("job.id", "12345891011") ;
// System update, data type is boolean, set to false for now
payload.addMetric("dp.install.system.update", false);
Let me know if this works. If so, I will update the documentation and explain the addition properties.
Thanks,
--Dave
|
|
|
Re: Bundle Remote Update [message #1734626 is a reply to message #1734608] |
Fri, 10 June 2016 02:14   |
Eclipse User |
|
|
|
Hi Dave,
Thank you again for your help. I added "job.id" and it works now. You did a little typo, as you said the data type should be long, not string. And "dp.install.system.update" is a mandatory field also.
// Job ID, data type is long
payload.addMetric("job.id", 12345891011L) ;
// System update, data type is boolean, set to false for now
payload.addMetric("dp.install.system.update", false);
Thanks,
Said.
[Updated on: Fri, 10 June 2016 02:15] by Moderator
|
|
| | |
Re: Bundle Remote Update [message #1745716 is a reply to message #1735084] |
Sat, 15 October 2016 16:48   |
Eclipse User |
|
|
|
Hello,
I'm also trying to use the DEPLOY-V2 to update deployment package but when I'm sending MQTT call I'm getting no message at all. Also, I'm not getting any errors in the log as descriped in the above comments.
2016-10-15 20:35:50,003 [MQTT Call: raspberry] INFO o.e.k.c.c.CloudServiceImpl - Message arrived on topic: EDC/guest/raspberry/DEPLOY-V2/EXEC/download
Since I'm using an MQTT broker that doesn't support $ in topic names, I have renamed the 'topic.control-prefix*' parameter to simply 'EDC' in the Kura web admins CloudService page. It looks like this works, as it appears that the call is arrived in the above log.
This is what I'm sending with the Kura MQTT client:
Topic: EDC/guest/raspberry/DEPLOY-V2/EXEC/download
Request ID: REQUEST_VE0US84QLJ3KLDS2HABCHVHC5D
Requester Client ID: CLIENT_90VKK2HU5LUKTM1SSPN8HSUDQT
Request payload:
dp.uri=https://s3-us-west-2.amazonaws.com/dzmtzxbieb/terminator.dp
dp.name=terminator
dp.version=1.0.0
db.download.protocol=HTTPS
job.id=121321
dp.install.system.update=false
I've also subscribed to 'EDC/guest/CLIENT_90VKK2HU5LUKTM1SSPN8HSUDQT/DEPLOY-V2/REPLY/REQUEST_VE0US84QLJ3KLDS2HABCHVHC5D', but there is no response there.
What I find strange is that I'm getting no error logs from CloudDeploymentHandlerV2. I have Kura 2.0.1 installed on my Pi2. Do you have any suggestion?
EDIT:
Trying to use the CONF-V1 service the same way.
After setting the Kura logger to debug, I'm getting this:
2016-10-15 21:38:04,931 [MQTT Call: raspberry] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Message arrived on topic: EDC/guest/raspberry/CONF-V1/GET/configurations
2016-10-15 21:38:04,932 [MQTT Call: raspberry] DEBUG o.e.k.c.d.t.m.DataTransportListenerS - No registered listener services. Ignoring onMessageArrived
I don't understand, isn't this CONF-V1 is a default installed Kura service? Or I'm getting this entirely wrong.
[Updated on: Sat, 15 October 2016 17:45] by Moderator
|
|
| | |
Re: Bundle Remote Update [message #1746140 is a reply to message #1746051] |
Sun, 23 October 2016 08:46   |
Eclipse User |
|
|
|
Yes, I'm trying to do this tutorial but doesn't seems to work. Using MQTT Client Utility, I'm publishing to EDC/guest/raspberry/CONF-V1/GET/configurations . I've changed "$EDC" to "EDC" in Kura web admin, and also set up the client-id and account name. I'm using an MQTT broker started on my local network. There is nor response on topic 'EDC/guest/CLIENT_LLR5FI9SEFKBN7SUGVB4MURSSU/CONF-V1/REPLY/REQUEST_PV4G16CEUIFDTFIQ82025E70VR' and here is the debug log of Kura:
2016-10-23 12:36:13,545 [MQTT Call: raspberry] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Message arrived on topic: EDC/guest/raspberry/CONF-V1/GET/configurations
2016-10-23 12:36:13,545 [MQTT Call: raspberry] DEBUG o.e.k.c.d.t.m.DataTransportListenerS - No registered listener services. Ignoring onMessageArrived
2016-10-23 12:36:13,546 [MQTT Call: raspberry] DEBUG o.e.k.c.d.DataServiceImpl - Message arrived on topic: EDC/guest/raspberry/CONF-V1/GET/configurations
2016-10-23 12:36:13,546 [MQTT Call: raspberry] DEBUG o.e.k.c.d.DataServiceListenerS - No registered listener services. Ignoring onMessageArrived
2016-10-23 12:36:13,546 [MQTT Call: raspberry] DEBUG o.e.k.c.c.c.CloudCallServiceImpl - Message arrived on topic: 'EDC/guest/raspberry/CONF-V1/GET/configurations'
2016-10-23 12:36:13,546 [MQTT Call: raspberry] INFO o.e.k.c.c.CloudServiceImpl - Message arrived on topic: EDC/guest/raspberry/CONF-V1/GET/configurations
|
|
|
Re: Bundle Remote Update [message #1746246 is a reply to message #1746140] |
Tue, 25 October 2016 17:19   |
Eclipse User |
|
|
|
Hello,
So the debug messages you posted seem okay, the CloudService is what will hold the registered listeners. Do you see something in the log after that? Below is an example of my test run. I have omitted account names and device IDs.
2016-10-25 21:03:14,352 [MQTT Call: --omitted--] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Message arrived on topic: $EDC/--omitted--/--omitted--/CONF-V1/GET/configurations
2016-10-25 21:03:14,353 [MQTT Call: --omitted--] DEBUG o.e.k.c.d.t.m.DataTransportListenerS - No registered listener services. Ignoring onMessageArrived
2016-10-25 21:03:14,353 [MQTT Call: --omitted--] DEBUG o.e.k.c.d.DataServiceImpl - Message arrived on topic: $EDC/--omitted--/--omitted--/CONF-V1/GET/configurations
2016-10-25 21:03:14,354 [MQTT Call: --omitted--] DEBUG o.e.k.c.d.DataServiceListenerS - No registered listener services. Ignoring onMessageArrived
2016-10-25 21:03:14,354 [MQTT Call: --omitted--] DEBUG o.e.k.c.c.c.CloudCallServiceImpl - Message arrived on topic: '$EDC/--omitted--/--omitted--/CONF-V1/GET/configurations'
2016-10-25 21:03:14,354 [MQTT Call: --omitted--] INFO o.e.k.c.c.CloudServiceImpl - Message arrived on topic: $EDC/--omitted--/--omitted--/CONF-V1/GET/configurations
2016-10-25 21:03:14,402 [MQTT Call: --omitted--] DEBUG o.e.k.c.Cloudlet - Control Arrived on topic: GET/configurations
2016-10-25 21:03:14,410 [pool-4-thread-2] DEBUG o.e.k.c.MessageHandlerCallable - Control Arrived on topic: GET/configurations
2016-10-25 21:03:14,421 [pool-4-thread-2] DEBUG o.e.k.c.MessageHandlerCallable - Handling GET request topic: GET/configurations
2016-10-25 21:03:14,674 [pool-4-thread-2] DEBUG o.e.k.c.MessageHandlerCallable - Publishing response topic: REPLY/-2235377569487582835-1477429394775
2016-10-25 21:03:14,691 [pool-4-thread-2] INFO o.e.k.c.d.DataServiceImpl - Storing message on topic :$EDC/#account-name/--omitted--/CONF-V1/REPLY/-2235377569487582835-1477429394775, priority: 1
2016-10-25 21:03:14,699 [pool-4-thread-2] INFO o.e.k.c.d.DataServiceImpl - Stored message on topic :$EDC/#account-name/--omitted--/CONF-V1/REPLY/-2235377569487582835-1477429394775, priority: 1
2016-10-25 21:03:14,707 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.DataServiceImpl - Publishing message with ID: 1 on topic: $EDC/#account-name/--omitted--/CONF-V1/REPLY/-2235377569487582835-1477429394775, priority: 1
2016-10-25 21:03:14,709 [DataServiceImpl:Submit] DEBUG o.e.k.c.d.t.m.MqttDataTransport - Replaced tokens in topic $EDC/#account-name/--omitted--/CONF-V1/REPLY/-2235377569487582835-1477429394775 with: $EDC/--omitted--/--omitted--/CONF-V1/REPLY/-2235377569487582835-1477429394775
|
|
| | | | | |
Re: Bundle Remote Update [message #1760919 is a reply to message #1734200] |
Thu, 04 May 2017 07:04   |
Eclipse User |
|
|
|
Hi,
I am new to kura and I have been trying to remotely uninstall a deployment package using Amit's MQTT application[1], but I am unable to do so. This is the request payload I send from the application-
dp.name=hello_osgi
job.id=12345891011L
dp.version=1.0.0
I get the following error in the response topic-
-- listing properties --
response.code=500
{response.exception.message=java.lang.String cannot be cast to java.lang.Long,
response.exception.stack=java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
at org.eclipse.kura.core.deployment.uninstall.DeploymentPackageUninstallOptions.
<init>(DeploymentPackageUninstallOptions.java:38)
at org.eclipse.kura.core.deployment.CloudDeploymentHandlerV2.doExecUninstall(CloudDeploymentHandlerV2.java:594)
at org.eclipse.kura.core.deployment.CloudDeploymentHandlerV2.doExec(CloudDeploymentHandlerV2.java:343)
at org.eclipse.kura.cloud.MessageHandlerCallable.call(Cloudlet.java:270)
at org.eclipse.kura.cloud.MessageHandlerCallable.call(Cloudlet.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) ,
response.code=500}
Malformed uninstall request
Following is the kura console-
16:12:04,707 [MQTT Call: test-client] INFO CloudServiceImpl:440 - Message arrived on topic: $EDC/amir-kura/test-client/DEPLOY-V2/EXEC/uninstall
16:12:04,709 [pool-3-thread-2] ERROR CloudDeploymentHandlerV2:597 - Malformed uninstall request!
16:12:04,710 [pool-3-thread-2] INFO DataServiceImpl:441 - Storing message on topic :$EDC/#account-name/CLIENT_QED0U1F74NLHA7M0Q5KI606QAU/DEPLOY-V2/REPLY/REQUEST_OTFGFHBKFSCVOI156408A4SU26, priority: 1
16:12:04,733 [DataServiceImpl:Submit] INFO MqttDataTransport:512 - Publishing message on topic: $EDC/amir-kura/CLIENT_QED0U1F74NLHA7M0Q5KI606QAU/DEPLOY-V2/REPLY/REQUEST_OTFGFHBKFSCVOI156408A4SU26 with QoS: 0
16:12:04,745 [pool-3-thread-2] INFO DataServiceImpl:444 - Stored message on topic :$EDC/#account-name/CLIENT_QED0U1F74NLHA7M0Q5KI606QAU/DEPLOY-V2/REPLY/REQUEST_OTFGFHBKFSCVOI156408A4SU26, priority: 1
Is there some other way to send the request payload ?
[1]=https://github.com/amitjoy/Kura-MQTT-Client-Utility
|
|
| |
Re: Bundle Remote Update [message #1763380 is a reply to message #1763308] |
Sun, 14 May 2017 15:23  |
Eclipse User |
|
|
|
Hello Dave,
My goal is to develop a web application capable of Remote OSGi DeploymentAdmin Interactions via MQTT, according to the assistance I got from the above mentioned link I am trying to achieve my goal by understanding how Amit's MQTT application [1] works and eventually start with my application accordingly.
While debugging Amit's application I have found out that code identifies the value of 'job.id' as String instead of long and sends it to kura and hence the error, as of now I am attempting to fix this bug.
So I have 2 questions-
Q1. Am I giving the input correctly in the application?
Q2. Is there a better approach to achieve my goal ?
[1]=https://github.com/amitjoy/Kura-MQTT-Client-Utility
Thanks
-Amir
|
|
|
Goto Forum:
Current Time: Wed Jul 30 12:16:30 EDT 2025
Powered by FUDForum. Page generated in 0.68116 seconds
|