File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -668,9 +668,10 @@ void NetworkEvent(WiFiEvent_t event) {
668
668
eth_connected = true ;
669
669
670
670
// Switch the MQTT connection to Ethernet from WiFi (or initially)
671
- // Preference the Ethernet wired interence if its available
671
+ // Preference the Ethernet wired interface if its available
672
672
// Disconnect the MQTT session
673
673
if ( mqtt.connected () ){
674
+ Serial.println (" Previously connected to WiFi, try to switch the MQTT connection to Ethernet" );
674
675
mqtt.disconnect ();
675
676
// No need to call mqtt.setClient(ETH); because ETH is a ETHClient which is not the same class as WiFi client
676
677
// Connect2MQTTbroker(); // The MQTT reconnect will be handled by the main loop()
@@ -681,6 +682,7 @@ void NetworkEvent(WiFiEvent_t event) {
681
682
eth_connected = false ;
682
683
// Disconnect the MQTT client
683
684
if ( mqtt.connected () ){
685
+ Serial.println (" Previously connected to Ethernet, try to switch the MQTT connection to WiFi" );
684
686
mqtt.disconnect ();
685
687
}
686
688
break ;
You can’t perform that action at this time.
0 commit comments