Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

raspberry pi - Device connected, but 'IBMIoT: Error: Connection refused: Not authorized' message keeps popping up

I am experimenting with IoT services in IBM Bluemix, attending a running MOOC at Coursera. I have set up my trial account and successfully registered some devices. I am testing the connectivity between Bluemix and my Raspberry Pi with the following simple Node-RED flow in Bluemix:

Node-RED flow @ Bluemixenter image description here

where normal and alert are simple injection nodes of the respective strings, the format message node is similarly simple (returns msg, where msg.payload = {'a' : {'indicator' : msg.payload}};, and the IBM IoT node is as follows:

enter image description here

The senseHAT device is registered and successfully connected to Bluemix, as apparent from the Watson IoT Platform dashboard:

enter image description here

From the Raspberry side, I have set the following simple flow to catch the 'commands' (normal and alert) issued in Bluemix:

Node-RED flow @ Raspberry Pienter image description here

with the all commands node being as follows:

enter image description here

Now, although the 'commands' normal and alert pass through from Bluemix to my Raspberry, I keep on getting the subject error message, as shown below (notice the time stamps):

enter image description here

and a similar error message is logged in the Node-RED console (once per minute):

Connection Error :: Error: Connection refused: Not authorized
9 Jun 19:41:19 - [error] IBMIoT: Error: Connection refused: Not authorized
Iotfclient is offline. Retrying connection
Connection was closed.

I wonder how it is possible, on the one hand to have the 'commands' passed through, while on the other hand to get at error message per minute claiming that I am not connected since my device is not authorized.

Any ideas?

On a side note (and as possibly useful additional info):

  1. pressing 'Refresh' in the Watson IoT Platform dashboard, the senseHAT device appears disconnected; refreshing the whole page (ie from the browser), it appears again connected
  2. no matter what I have tried, I cannot connect the other two devices shown above (b827eb0a0ee8 and b827eb5f5bbd) - I even tried deleting and re-registering them again in Bluemix...
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like the cause of this could be the mix up of gateways and devices as per my previous comment. From the logs it looks like you have changed the types of the device IDs between gateway and device, and in some cases a device with id b827eb0a0ee8 has connected as a gateway (shown as just a device in your screen shot) and subsequently been disconnected because it attempts something unauthorised (probably attempting to connect an unregistered device; ie the client ID mix up issue).

Auto registration of devices is temporarily disabled and so if a device does not exist (because the client ID is wrong) then the gateway device will be disconnected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...