From 0025d60e9cd7c36e43d5f318548d0c941a700f08 Mon Sep 17 00:00:00 2001 From: 1technophile Date: Sun, 17 Sep 2017 22:12:16 +0200 Subject: [PATCH] Differentiate serial begin if arduino --- OpenMQTTGateway.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index d748e46..ea18c4e 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -119,10 +119,9 @@ void callback(char* topic, byte* payload, unsigned int length) { void setup() { - //Launch serial for debugging purposes - Serial.begin(SERIAL_BAUD, SERIAL_8N1, SERIAL_TX_ONLY); - #ifdef ESP8266 + //Launch serial for debugging purposes + Serial.begin(SERIAL_BAUD, SERIAL_8N1, SERIAL_TX_ONLY); //Begining wifi connection in case of ESP8266 setup_wifi(); // Port defaults to 8266 @@ -153,6 +152,8 @@ void setup() }); ArduinoOTA.begin(); #else + //Launch serial for debugging purposes + Serial.begin(SERIAL_BAUD); //Begining ethernet connection in case of Arduino + W5100 setup_ethernet(); #endif