Skip to content

Commit

Permalink
Added IP debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Dec 19, 2024
1 parent e33052d commit 0a10676
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/Factory/Factory.ino
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,17 @@ void setup()
#endif
}

WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info) {
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(IPAddress(info.got_ip.ip_info.ip.addr));
}, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_GOT_IP);

WiFiEventId_t eventID = WiFi.onEvent([](WiFiEvent_t event, WiFiEventInfo_t info) {
Serial.print("WiFi lost connection. Reason: ");
Serial.println(info.wifi_sta_disconnected.reason);
}, WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);

setupBoards(true);

setupBLE();
Expand Down

0 comments on commit 0a10676

Please sign in to comment.