File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,11 @@ class EasyMqtt : public MqttMap {
28
28
debug (" Connected to MQTT" );
29
29
subscribe ();
30
30
} else {
31
+ #ifdef DEBUG
31
32
Serial.print (" failed, rc=" );
32
33
Serial.print (mqttClient.state ());
33
34
Serial.println (" try again in 5 seconds" );
35
+ #endif
34
36
delay (5000 );
35
37
}
36
38
}
@@ -53,7 +55,9 @@ class EasyMqtt : public MqttMap {
53
55
}
54
56
55
57
void debug (String msg) {
58
+ #ifdef DEBUG
56
59
Serial.println (msg);
60
+ #endif
57
61
get (" system" )[" debug" ].publish (msg);
58
62
}
59
63
@@ -66,14 +70,18 @@ class EasyMqtt : public MqttMap {
66
70
67
71
while (WiFi.status () != WL_CONNECTED) {
68
72
delay (500 );
73
+ #ifdef DEBUG
69
74
Serial.print (" ." );
75
+ #endif
70
76
}
77
+ #ifdef DEBUG
71
78
Serial.println (" WiFi connected" );
72
79
Serial.print (" IP address: " );
73
80
Serial.println (WiFi.localIP ());
74
81
75
82
Serial.print (" Chip ID : " );
76
83
Serial.println (ESP.getChipId ());
84
+ #endif
77
85
78
86
// Setup wifi diag
79
87
get (" system" )[" wifi" ][" rssi" ] << []() {
@@ -99,8 +107,10 @@ class EasyMqtt : public MqttMap {
99
107
mqtt_username = username;
100
108
mqtt_password = password;
101
109
110
+ #ifdef DEBUG
102
111
Serial.print (" Topic: " );
103
112
Serial.println (getTopic ());
113
+ #endif
104
114
}
105
115
106
116
/* *
You can’t perform that action at this time.
0 commit comments