|
|
@ -55,8 +55,8 @@ public class MqttManager { |
|
|
|
private static final String PRODUCT_KEY = "qr3rximCZnT6ZU0NsAAiTC7O"; // 动态注册用的ProductKey |
|
|
|
|
|
|
|
// MQTT连接配置 - 根据腾讯云IoT官方文档配置 |
|
|
|
// MQTTS(8883): ${productid}.iotcloud.tencentdevices.com |
|
|
|
private static final String BROKER_URL = "ssl://" + PRODUCT_ID + ".iotcloud.tencentdevices.com:8883"; // 腾讯云IoT Hub SSL地址 |
|
|
|
// MQTT(1883): ${productid}.iotcloud.tencentdevices.com - 使用TCP连接避免SSL证书问题 |
|
|
|
private static final String BROKER_URL = "tcp://" + PRODUCT_ID + ".iotcloud.tencentdevices.com:1883"; // 腾讯云IoT Hub TCP地址 |
|
|
|
private static final int KEEP_ALIVE_INTERVAL = 240; // 增加心跳间隔 |
|
|
|
private static final int CONNECTION_TIMEOUT = 30; // 增加连接超时时间 |
|
|
|
private static final int QOS = 1; |
|
|
|