mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-29 16:37:17 +02:00
@ -266,10 +266,17 @@ static void mdnsInit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void initMqtt(void) {
|
static void initMqtt(void) {
|
||||||
if (mqttClient.begin(configuration.getMqttBrokerUri())) {
|
String mqttUri = configuration.getMqttBrokerUri();
|
||||||
Serial.println("Setup connect to MQTT broker successful");
|
if (mqttUri.isEmpty()) {
|
||||||
|
Serial.println(
|
||||||
|
"MQTT is not configured, skipping initialization of MQTT client");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mqttClient.begin(mqttUri)) {
|
||||||
|
Serial.println("Successfully connected to MQTT broker");
|
||||||
} else {
|
} else {
|
||||||
Serial.println("setup Connect to MQTT broker failed");
|
Serial.println("Connection to MQTT broker failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,10 +264,17 @@ static void mdnsInit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void initMqtt(void) {
|
static void initMqtt(void) {
|
||||||
if (mqttClient.begin(configuration.getMqttBrokerUri())) {
|
String mqttUri = configuration.getMqttBrokerUri();
|
||||||
Serial.println("Setup connect to MQTT broker successful");
|
if (mqttUri.isEmpty()) {
|
||||||
|
Serial.println(
|
||||||
|
"MQTT is not configured, skipping initialization of MQTT client");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mqttClient.begin(mqttUri)) {
|
||||||
|
Serial.println("Successfully connected to MQTT broker");
|
||||||
} else {
|
} else {
|
||||||
Serial.println("setup Connect to MQTT broker failed");
|
Serial.println("Connection to MQTT broker failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,10 +291,17 @@ static void mdnsInit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void initMqtt(void) {
|
static void initMqtt(void) {
|
||||||
if (mqttClient.begin(configuration.getMqttBrokerUri())) {
|
String mqttUri = configuration.getMqttBrokerUri();
|
||||||
Serial.println("Setup connect to MQTT broker successful");
|
if (mqttUri.isEmpty()) {
|
||||||
|
Serial.println(
|
||||||
|
"MQTT is not configured, skipping initialization of MQTT client");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mqttClient.begin(mqttUri)) {
|
||||||
|
Serial.println("Successfully connected to MQTT broker");
|
||||||
} else {
|
} else {
|
||||||
Serial.println("setup Connect to MQTT broker failed");
|
Serial.println("Connection to MQTT broker failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,11 +382,18 @@ static void createMqttTask(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void initMqtt(void) {
|
static void initMqtt(void) {
|
||||||
if (mqttClient.begin(configuration.getMqttBrokerUri())) {
|
String mqttUri = configuration.getMqttBrokerUri();
|
||||||
Serial.println("Connect to MQTT broker successful");
|
if (mqttUri.isEmpty()) {
|
||||||
|
Serial.println(
|
||||||
|
"MQTT is not configured, skipping initialization of MQTT client");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mqttClient.begin(mqttUri)) {
|
||||||
|
Serial.println("Successfully connected to MQTT broker");
|
||||||
createMqttTask();
|
createMqttTask();
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Connect to MQTT broker failed");
|
Serial.println("Connection to MQTT broker failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user