Hey all,
I’m following along with Matt’s video and so far so good.
The only snag I’m running into, is that my MQTT server is purposefully password protected. It’s also going to use SSL, but for now I don’t have any certificates installed just for testing my LED strip.
Matt’s code for the ESP8266 doesn’t seem to have provisions for an MQTT login and password. I’ve gone ahead and defined them, but I’m not sure on the syntax as far as how or where they need to be called in order to connect.
Any tips?
I’ve added this commented code to the beginning of the ESP8266 Sketch
//MQTT Login
const char* mqtt_username = "usernamehere";
const char* mqtt_password = "PasswordHere";
I want to say that the relevant snippet is here:
Code Snippet
void setup()
{
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
client.begin(server, net);
client.onMessage(messageReceived);
connect();
MDNS.begin(host);
httpUpdater.setup(&httpServer, update_path, update_username, update_password);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
}
Specifically the client.begin(server, net); part, but this is literally my first foray into the esp8266.