mqtt,Could not connect: CONNECTION_REFUSED_NOT_AUTHORIZED

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;

你可能感兴趣的:(mqtt,Could not connect: CONNECTION_REFUSED_NOT_AUTHORIZED)