diff --git a/ESP32_Temperture-Node/src/config.h b/ESP32_Temperture-Node/src/config.h index 81d6b558..056800d0 100644 --- a/ESP32_Temperture-Node/src/config.h +++ b/ESP32_Temperture-Node/src/config.h @@ -37,6 +37,7 @@ #define MQTT_IOT_CHANNEL_OUTPUT_SWITCH_1 "node1/output/sw1" #define MQTT_IOT_CHANNEL_OUTPUT_SWITCH_2 "node1/sw2" #define MQTT_IOT_CHANNEL_OUTPUT_PWM_1 "node1/pwm1" +#define MQTT_IOT_CHANNEL_0 "test_topic" // Uncomment corresponding board //#define devkit_30pin_001 @@ -75,7 +76,7 @@ D13 28 => Assigned to read RPM ---------------------------------------------- */ #define PING_PIN 33 // GPIO 33 pin # of audio ping -#define LED_PIN 32 +#define LED_PIN 33 #define SWITCH_1 14 // GPIO 14 #define SWITCH_2 12 // GPIO 12 #define DAC_CH1 25 // GPIO 25 diff --git a/ESP32_Temperture-Node/src/main.cpp b/ESP32_Temperture-Node/src/main.cpp index c4e30c18..8adb0716 100644 --- a/ESP32_Temperture-Node/src/main.cpp +++ b/ESP32_Temperture-Node/src/main.cpp @@ -22,6 +22,7 @@ struct { float pressure = 0.0; float temperature = 0.0; } sensors_values; +char cstr[16]; // Sensors modules specified in config.h file. // BME280 @@ -358,14 +359,14 @@ void loop() { Serial.println(connection.state()); // state() == 0 => Connected to MQTT Serial.print("MQTT Connected: "); Serial.println(connection.connected()); // connected() == 1 => Connected to MQTT - Serial.print("Wi-Fi Connection tatus: "); + Serial.print("Wi-Fi Connection status: "); Serial.println(WiFi.status()); // status() == 3 => Connected to WiFi delay(1000); connection.loop(); digitalWrite(PING_PIN, LOW); digitalWrite(PING_PIN, HIGH); - delay(250); + delay(150); digitalWrite(PING_PIN, LOW); } // Call function to establish connection if not connected to MQTT server.