diff --git a/src/global.h b/src/global.h index 65c9151..9f8ce4f 100644 --- a/src/global.h +++ b/src/global.h @@ -7,6 +7,10 @@ #include #include +// MQTT +#define MQTT_ADDR "192.168.2.196" +#define MQTT_PORT 1883 + // DAC #define DAC1 25 diff --git a/src/helpers/mqtt.cpp b/src/helpers/mqtt.cpp index ff6d609..2d6bf9c 100644 --- a/src/helpers/mqtt.cpp +++ b/src/helpers/mqtt.cpp @@ -2,9 +2,10 @@ MqttTopic::MqttTopic(WiFiClient* espClient): wifiClient(espClient), client(PubSubClient(*espClient)) { - IPAddress server(192, 168, 2, 196); + IPAddress server; + server.fromString(MQTT_ADDR); - this->client.setServer(server, 1883); + this->client.setServer(server, MQTT_PORT); this->client.setCallback(this->callback); }