How to Disconnect ? from bluemix MQTT in tutorial ?

Ask, and ye shall receive.
kiranshashiny
Posts: 12
Joined: 09:35, 14 Feb 2016

How to Disconnect ? from bluemix MQTT in tutorial ?

Postby kiranshashiny » 06:16, 16 Feb 2016

I am going thru the code and found it useful.

https://evothings.com/evothings-does-mqtt-with-bluemix/

Q : How do I disconnect from the Bluemix broker ?
I see a app.onConnect(),
app.initialize()
app.onReady (), and so on..

but I did not see a disconnect().

gokr
Posts: 13
Joined: 12:50, 02 Nov 2015

Re: How to Disconnect ? from bluemix MQTT in tutorial ?

Postby gokr » 09:15, 16 Feb 2016

The Paho client has disconnect() so you can easily expose that function in our "app":

Code: Select all

app.disconnect = function() {
   app.client.disconnect();
   console.log("Disconnected ");
}


Reference docs for the Paho js library is here:

http://www.eclipse.org/paho/files/jsdoc ... lient.html

regards, Göran

kiranshashiny
Posts: 12
Joined: 09:35, 14 Feb 2016

Re: How to Disconnect ? from bluemix MQTT in tutorial ?

Postby kiranshashiny » 09:31, 16 Feb 2016

Thanks Goran,
Your suggestion and the link really helped.
Shashi

kiranshashiny
Posts: 12
Joined: 09:35, 14 Feb 2016

Re: How to Disconnect ? from bluemix MQTT in tutorial ?

Postby kiranshashiny » 12:33, 16 Feb 2016

Please close this issue.

kiranshashiny
Posts: 12
Joined: 09:35, 14 Feb 2016

Re: How to Disconnect ? from bluemix MQTT in tutorial ?

Postby kiranshashiny » 15:53, 20 Feb 2016

I used your code to control DC motors and LEDs from the app using Evothings Workbench and connected to IBM BLuemix .

[img][img][img][/img][/img][/img]
Attachments
duplicate.jpg
duplicate.jpg (119.28 KiB) Viewed 33089 times


Return to “Questions and answers”

Who is online

Users browsing this forum: No registered users and 24 guests