#include #include // WiFi const char *ssid = "xxxxx"; // Enter your WiFi name const char *password = "xxxxx"; // Enter WiFi password // MQTT Broker const char *mqtt_broker = ""; const char *topic = "reinhold/test"; const int mqtt_port = 1883; const char *client_id = "m5-esp"; Wifi.begin(ssid, password); client.setServer(mqtt_broker, mqtt_port); client.setCallback(callback); client.connect(client_id.c_str()); void callback(char *topic, byte *payload, unsigned int length) { for (int i = 0; i < length; i++) { Serial.print((char) payload[i]); } }