mqttclient.cpp: Set Ethernet hostname
This commit is contained in:
1 parent
e6782185ca
commit
fc1ac508ef
1 file changed
+1
@@ -22,6 +22,7 @@ esp_err_t mqtt_init(void) {
|
||||
|
||||
// setup network connection and MQTT client
|
||||
ETH.begin();
|
||||
ETH.setHostname(clientId);
|
||||
mqttClient.begin(MQTT_SERVER, MQTT_PORT, netClient);
|
||||
mqttClient.setKeepAlive(MQTT_KEEPALIVE);
|
||||
mqttClient.onMessageAdvanced(mqtt_callback);
|
||||
|
||||
Reference in new issue
Block a user