Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serial info to new IP on ver 2.1.14 #79

Open
bosoft-ESP opened this issue Mar 7, 2021 · 2 comments
Open

Add serial info to new IP on ver 2.1.14 #79

bosoft-ESP opened this issue Mar 7, 2021 · 2 comments

Comments

@bosoft-ESP
Copy link

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

@shurillu
Copy link
Owner

shurillu commented Mar 9, 2021

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

@bosoft-ESP
Copy link
Author

Thanks to you for your great work
Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants