set mqtt client id

This commit is contained in:
SH 2020-11-25 11:03:55 +01:00
parent dcd93dfe97
commit 89141622d7
1 changed files with 1 additions and 0 deletions

View File

@ -28,6 +28,7 @@ void MQTT::init(const char* ip, uint16_t port, const char* id, const char *usern
Serial.println("[MQTT] pubsub client");
mqttClient.setServer(ip, port);
mqttClient.setClientId(id);
if (strlen(password) > 0) {
mqttClient.setCredentials(username, password);
}