correct MQTT connection issue with arduino boards
This commit is contained in:
1 parent
02d959a25e
commit
f0648f481f
1 file changed
+17
-16
+17
-16
@@ -195,6 +195,23 @@ void setup()
|
||||
});
|
||||
ArduinoOTA.begin();
|
||||
|
||||
#else // arduino case
|
||||
//Launch serial for debugging purposes
|
||||
Serial.begin(SERIAL_BAUD);
|
||||
//Begining ethernet connection in case of Arduino + W5100
|
||||
setup_ethernet();
|
||||
//setup LED status, turn all ON for short amount then leave only the RED LED ON
|
||||
pinMode(led_receive, OUTPUT);
|
||||
pinMode(led_send, OUTPUT);
|
||||
pinMode(led_error, OUTPUT);
|
||||
digitalWrite(led_receive, LOW);
|
||||
digitalWrite(led_send, LOW);
|
||||
digitalWrite(led_error, LOW);
|
||||
delay(500);
|
||||
digitalWrite(led_receive, HIGH);
|
||||
digitalWrite(led_send, HIGH);
|
||||
#endif
|
||||
|
||||
#ifdef MDNS_SD
|
||||
trc(F("Connecting to MQTT by mDNS without mqtt hostname"));
|
||||
connectMQTTmdns();
|
||||
@@ -211,22 +228,6 @@ void setup()
|
||||
trc(String(mqtt_server));
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
//Launch serial for debugging purposes
|
||||
Serial.begin(SERIAL_BAUD);
|
||||
//Begining ethernet connection in case of Arduino + W5100
|
||||
setup_ethernet();
|
||||
//setup LED status, turn all ON for short amount then leave only the RED LED ON
|
||||
pinMode(led_receive, OUTPUT);
|
||||
pinMode(led_send, OUTPUT);
|
||||
pinMode(led_error, OUTPUT);
|
||||
digitalWrite(led_receive, LOW);
|
||||
digitalWrite(led_send, LOW);
|
||||
digitalWrite(led_error, LOW);
|
||||
delay(500);
|
||||
digitalWrite(led_receive, HIGH);
|
||||
digitalWrite(led_send, HIGH);
|
||||
#endif
|
||||
|
||||
client.setCallback(callback);
|
||||
|
||||
|
||||
Reference in new issue
Block a user