mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2024-10-05 20:47:50 -04:00
.
MQTT SSL channel
This commit is contained in:
parent
fa580c4ca2
commit
f3dca0a3f0
@ -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
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user