我正在使用Adafruit创建的MQTT库,该库位于here,并且库本身运行良好-但是我发现自己无法编辑客户端ID或配置PINGRESP。我当前使用的代码可以在下面看到-
WiFiClient client;
Adafruit_MQTT_Client mqtt(&client, "10.116.10.191", 1883);
当客户端连接到MQTT Broker时,客户端ID变成由字母,数字和符号组成的随机字符串,如下所示-
1534023607: Client ]7llG5K6J4=^tPHJHqgTUFc<Ep^m3vJ`4vSL2oB<cO[^_chw[GBp]v3smagpOqWS has exceeded timeout, disconnecting.
1534023608: New connection from 10.116.7.21 on port 1883.
1534023608: New client connected from 10.116.7.21 as ^k_aQq];7xigbIUD`htDex>IPfAoNX:4JiUkR9vY9WG[`m`GL[KqZJAk7RaEkkIu (c1, k300).
1534023608: Sending CONNACK to ^k_aQq];7xigbIUD`htDex>IPfAoNX:4JiUkR9vY9WG[`m`GL[KqZJAk7RaEkkIu (0)
1534023608: Received SUBSCRIBE from ^k_aQq];7xigbIUD`htDex>IPfAoNX:4JiUkR9vY9WG[`m`GL[KqZJAk7RaEkkIu
1534023608: quantity (QoS 0)
1534023608: ^k_aQq];7xigbIUD`htDex>IPfAoNX:4JiUkR9vY9WG[`m`GL[KqZJAk7RaEkkIu 0 quantity
1534023608: Sending SUBACK to ^k_aQq];7xigbIUD`htDex>IPfAoNX:4JiUkR9vY9WG[`m`GL[KqZJAk7RaEkkIu
经过一段时间后,客户超过了超时时间并断开了连接。对于克服此障碍的任何建议,我们将不胜感激
答案 0 :(得分:0)