无法连接到Watson IoT-连接被拒绝

时间:2018-12-19 10:11:32

标签: watson-iot

我正在使用Watson IoT平台提供的orgID跟踪these instructions

然后我使用此orgID在Node-RED中创建MQ客户端,并 d:orgID:mydevicetype:mydevicedid使用任意mydevicetype和mydevicedid。

这些是Node-RED错误消息:

"Error: Connection refused: Not authorized"
"Error stopping node: Error: [BaseClient:disconnect] Client is not connected"

然后我使用mydevicetype和mydevicedid在Watson IoT平台上创建了一个设备,并且eas提供了令牌。 使用 use-token-auth 作为用户并将令牌用作密码时,我遇到了相同的错误。

Watson IoT平台上的设备日志:

Invalid userID () for device auth: 
ClientID='d:orgID:mydevicetype:mydevicdeid', 
ClientIP=169.50.40.xxx 

2 个答案:

答案 0 :(得分:1)

Can you try:

  • url: mqtts://[orgId].messaging.internetofthings.ibmcloud.com
  • port:8883
  • username: use-token-auth
  • password: [the token you got when you created the device]
  • client id: d:[orgID]:[mydevicetype]:[mydeviceid]

Looks like not much different from what you've tried, perhaps your are not using a secure (mqtts) connection ?

答案 1 :(得分:0)

If the client id that you are specifying really is:

d:orgID:mydevicetype:mydevicdeid

then your problem is that you need to specify the actual 6 character orgId, e.g.:

d:abcdef:mydevicetype:mydevicdeid

Give that a go and let us know how you get on.