CTBot
CTBot copied to clipboard
Add serial info to new IP on ver 2.1.14
Hello I have been thinking about adding these lines in the CTBotWifiSetup.cpp file to report the IP change in the CTBotWifiSetup::setIP function.
Following the same rules as in the line 111-113 in function CTBotWifiSetup::wifiConnect
if` (WiFi.status() == WL_CONNECTED) {
IPAddress ip = WiFi.localIP();
message = (String)FSTR("\nWiFi connected IPAddress: ") + ip.toString() + (String)"\n";
serialLog(message, CTBOT_DEBUG_WIFI);
I have inserted the same to line 71-73 in function CTBotWifiSetup::setIP
if (WiFi.config(IP, GW, SN, DNS1, DNS2)){
IPAddress ip = WiFi.localIP();
String message = (String)FSTR("New IP address: ") + ip.toString() + (String)"\n";
serialLog(message, CTBOT_DEBUG_WIFI);
Although it would be better if these lines were like this:
#ifdef CTBOT_DEBUG_DISABLED == 1
IPAddress ip = WiFi.localIP();
String message = (String)FSTR("New IP address: ") + ip.toString() + (String)"\n";
serialLog(message, CTBOT_DEBUG_WIFI);
#endif
this way it would not compile if CTBOT_DEBUG_DISABLED == 0
Thanks for your hard work. Regards
Hello bosoft-ESP, I added the functionality you asked for in the v 2.1.5 (with others patches) and a new release is on the way. Thanks fo using the library!
Cheers
Stefano
Thanks to you for your great work Best regards