您的位置:首页 > 编程语言 > Qt开发

mqtt,Could not connect: CONNECTION_REFUSED_NOT_AUTHORIZED

2015-08-24 17:48 453 查看
mqtt IoT service,Could not connect: CONNECTION_REFUSED_NOT_AUTHORIZED

publish msg端:org,host,registered device type,registered device id,apikey,apitoken都必须一致才可以。

device端id格式:

String clientId = "d:" + org + ":" + "MqttUtil.DEVICE_TYPE" + ":" + id;

// app key

String username = "use-token-auth";(just only this,not any others)

// app auth token

String password = "JNyh&!x9i0z1*daDb&";(registered device token)

也就是说,registered device apikey是没用的,只用到apitoken。

subscribe msg端:org,REGISTERED device id,host,registered app apikey,registered app apitoken用于subscribe msg。

app端id格式:String clientId = "a:" + org + ":" + id;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: