I am not able to connect to my MQTT broker (Mosquitto). But it appears to be related to the clientid setting in the ESP EASY code. The following message is being displayed in the serial monitor:
INIT : Booting Build nr:78
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
MQTT : Failed to connected to broker
MQTT : Failed to connected to broker
INIT : Boot OK
INIT : Normal boot
I found the following code that is generating the error message:
// MQTT needs a unique clientname to subscribe to broker
String clientid = "ESPClient";
clientid += Settings.Unit;
String subscribeTo = "";
.
.
if (MQTTresult)
{
log = F("MQTT : Connected to broker");
addLog(LOG_LEVEL_INFO, log);
subscribeTo = Settings.MQTTsubscribe;
subscribeTo.replace("%sysname%", Settings.Name);
MQTTclient.subscribe(subscribeTo);
log = F("Subscribed to: ");
log += subscribeTo;
addLog(LOG_LEVEL_INFO, log);
break; // end loop if succesfull
}
else
{
log = F("MQTT : Failed to connected to broker");
addLog(LOG_LEVEL_ERROR, log);
Is it possible to change the clientid within ESP Easy?
How to set ClientID fo MQTT.
Moderators: grovkillen, Stuntteam, TD-er
How to set ClientID fo MQTT.
Last edited by MarkIngle on 18 Feb 2016, 03:45, edited 1 time in total.
Re: How to set ClientID fo MQTT....
I was way off on posting this entry. Sorry if I confused anyone...the answer to my problem can be found here:
http://www.esp8266.nu/forum/viewtopic.php?f=6&t=813
http://www.esp8266.nu/forum/viewtopic.php?f=6&t=813
Re: How to set ClientID fo MQTT....
looks if the question is for the devs...MarkIngle wrote: INIT : Booting Build nr:78
// MQTT needs a unique clientname to subscribe to broker
String clientid = "ESPClient";
clientid += Settings.Unit;
Is it possible to change the clientid within ESP Easy?
as long as this is in the code this way...:
clientid += Settings.Unit;
Re: How to set ClientID fo MQTT....
Yeah the code is fine....I am just learning and misunderstood the root of my problem. This post can be deleted.
Who is online
Users browsing this forum: No registered users and 17 guests