ibm-watson-iot / iot-nodejs

Client libraries and samples for connecting to IBM Watson IoT using nodejs
https://internetofthings.ibmcloud.com
Eclipse Public License 1.0
180 stars 100 forks source link

keep throwing [BaseClient:connect] Iotfclient is offline. Retrying connection #88

Closed cbsnagur closed 6 years ago

cbsnagur commented 7 years ago

@jeffdare even inspite of using unique id i keep getting this following error

[DeviceClient:publish] Client is not connected 10 Jul 12:07:58 - [error] [wiot:connectionPool:getClient] [DeviceClient:publish] Client is not connected [BaseClient:connect] Iotfclient is offline. Retrying connection [BaseClient:onClose] Connection was closed.

I have tried to run it multiple times but it keeps giving me the same error. can you plz help out with this?

:)Here I am trying to send real time data from my laptop to bluemix cloud using node-red.

cbsnagur commented 7 years ago

speaking with reference to bellow issue

https://github.com/ibm-watson-iot/iot-nodejs/issues/34

jeffdare commented 7 years ago

Hi @Channabasawa Can you please check if the MQTT port(1883/8883) is not blocked in your network.

cbsnagur commented 6 years ago

Yes the port was blocked.Thank you Sir now the problem is solved

jeffdare commented 6 years ago

Issue was with the port being blocked. Closing this issue.

aditiagarwal1 commented 6 years ago

@jeffdare @Channabasawa how do I check if the MQTT port(1883/8883) is blocked on my raspberry pi?

jeffdare commented 6 years ago

Most probably it will not be blocked by your raspberry pi, it will be blocked at your network level or your firewall. Check with your network admins, for blocked ports. Easy test to see it the port is blocked, do a telnet and check you can connect(you can replace the orgid with your orgid).

$ telnet u5uw0v.messaging.internetofthings.ibmcloud.com 1883
$ telnet u5uw0v.messaging.internetofthings.ibmcloud.com 8883
[You should be able to see this connected message]
Connected to us.messaging.internetofthings.ibmcloud.com.
aditiagarwal1 commented 6 years ago

@jeffdare thanks, I did the telnet - the port is not blocked and I am still getting the same errors.

I am doing a tutorial of simulating a doorbell camera and am on the part where the user presses the doorbell and a picture of their face is sent to the Cloudant database in Bluemix. So far, I have three flows. Two flows (Process Doorbell flow and Send Picture flow) are onNode-RED on my raspberry pi and the other flow (Retrieve Picture flow) is in Node-RED on Bluemix. This is what is supposed to happen: The Process Doorbell flow should send an IBM IoT visitorAlert event message to Node-RED on Bluemix (Retrieve Picture Flow) which should, in turn, send an IBM IoT sendPicture command message back to Node-RED on Raspberry Pi (Send Picture Flow).  This will eventually create a Base64 encoded image string, package it up with the filename, length and status into a payload that gets sent to Cloudant in Bluemix by the insertPicture node.  I would see if it worked by going to the Bluemix Cloudant dashboard. I think I am having trouble connecting the flow on the pi to the flow on Bluemix and back.

However, when I deploy these flows and test if they work, I get errors in all Node-RED flows. In particular, these errors on the raspberry pi Node-RED flows are: "Error stopping node: Error: [BaseClient: disconnect] Client is not connected" and "[ApplicationClient: publish] Client is not connected".

The errors on the Bluemix Node-RED flow are: "Error stopping node: Error [BaseClient: disconnect] Client is not connected" and "Error: Connection refused: Not authorized".

Do you know what the issue/issues could be?

Nivetha272003 commented 1 year ago

sir i dont know how to check whether mqtt server is blocked or not

jeffdare commented 1 year ago

@Nivetha272003 The Watson IoT platform is deprecated now. Please follow this - https://cloud.ibm.com/docs/IoT?topic=IoT-deprecation