Code: Select all
#include "EspMQTTClient.h"
void onConnectionEstablished();
EspMQTTClient client(
"ssid*****", // Wifi ssid
"********", // Wifi password
"192.168.1.101", // MQTT broker ip
1883, // MQTT broker port
"89delta", // MQTT username
"*********", // MQTT password
"test1", // Client name DO I NEED THIS????????
onConnectionEstablished, // Connection established callback
true, // Enable web updater
true // Enable debug messages
);
void setup()
{
Serial.begin(115200);
}
void onConnectionEstablished()
{
client.subscribe("89delta/out", [] (const String &payload)
{
Serial.println(payload);
});
Thanks