Web wizard page

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Web wizard page

#1 Post by rayE » 25 Oct 2019, 09:54

Hi all,
Self build 20191003

Im trying to force open the web wizard page using the rules below.

Code: Select all

//***Set to web wizard page with a 5 second key press***
on switch#switch=10 do 
    GPIO,15,0                                        //Turn off Blue LED 
    GPIO,12,1                                        //Turn on Red LED
    WifiSSID,""
    WifiKey,""
    save
    reboot
endon
The problem is the command WiFiSSID,"" will not over write the old SSID name UNLESS it contains at least one character. Is there a way around this? or is there a simple change in the ESPEasy code i can make?

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Web wizard page

#2 Post by TD-er » 25 Oct 2019, 11:17

Is it to trigger the AP mode?
There is a command for setting the AP mode active.

You can also set the SSID to "ssid" (small caps)

See:

Code: Select all

bool wifiSettingsValid(const char *ssid, const char *pass) {
  if ((ssid[0] == 0) || (strcasecmp(ssid, "ssid") == 0)) {
    return false;
  }

  //  if (pass[0] == 0) return false; // Allow for empty pass
  if (strlen(ssid) > 32) { return false; }

  if (strlen(pass) > 64) { return false; }
  return true;
}
As you can see, you don't even have to erase the password to invalidate the WiFi settings.

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Web wizard page

#3 Post by rayE » 25 Oct 2019, 13:09

Im doing this for two reasons.
1. If i set the unit to AP mode it will switch to AP mode but when i log onto it via 192.168.4.1 the interface is very sluggish as it's reporting using 100% CPU time. When i look in the debug window in looks like its constantly trying to connect with whatever credentials are in the SSID config, maybe this is causing 100% CPU usage?

2. I actually prefer the wizard interface as it's more intuitive for newby's (my device users) to set the unit to their router.

I can see from the code above that this is the trigger to pop up the wizard, but this will only work if the SSID contains no characters, i can manually clear the SSID in the web configure page and after a save and restart the wizard pops up, great. How can i clear the characters in the SSID from rules? The command WifiSSID, "" does NOT clear the SSID in the configuration web page?

TIA

TD-er
Core team member
Posts: 8728
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Web wizard page

#4 Post by TD-er » 25 Oct 2019, 13:43

For point 1, see this issue: https://github.com/letscontrolit/ESPEasy/issues/2650
Working on it as we speak.
The command WifiSSID, "" does NOT clear the SSID in the configuration web page?
As a work-around you can set the SSID to "ssid", which is also considered as a "not yet set" value.

So use:

Code: Select all

WifiSSID,"ssid"
Make sure you don't use a space and a comma, since both are considered a parameter separator.

rayE
Normal user
Posts: 144
Joined: 12 Oct 2017, 12:53
Location: Philippines

Re: Web wizard page

#5 Post by rayE » 25 Oct 2019, 14:04

Many thanks TD-er, it works a treat :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests