schollz / raspberry-pi-turnkey

How to make a Raspberry Pi image that can be deployed anywhere and assigned to a WiFi network without SSH :ok_hand:
MIT License
830 stars 90 forks source link

Does not connect to open wifi #22

Open thecolorblue opened 5 years ago

thecolorblue commented 5 years ago

There is no place in the flask site to indicate the AP is open. It will accept any password but will not connect to the AP.

I am assuming this would require:

Anything I missed? I can take a shot at this if that these are the only changes needed.

ilirb commented 5 years ago

If it returns Wrong password! when you reconnect to the AP then the issue is here: https://github.com/schollz/raspberry-pi-turnkey/blob/master/startup.py#L154 where check_cred() should not run if password is empty

bust4rhymes commented 1 year ago

i'm having the exact issue when using an open network. The web form wont let me pass without a password saying "Please fill this field" and i cannot continue. After looking at the code this seems to be managed for this case:

pwd = 'psk="' + password + '"'
    if password == "":
        pwd = "key_mgmt=NONE" # If open AP

key_mgmt=NON is what should be used in wpa_suppliquant.conf in order to use an "open ap". I just dont see why the form wont le me pass without password.

*Edit: From index.html i tried removing the "required" from the password input id just to check if i can make past the login form. It goes trought but i end up with a "internal server error".

houshmandX commented 1 year ago

index.html need to be:

<input id="inputPassword" autocorrect="off" autocapitalize="none" pattern=".{0}|.{8,}" name="password" class="form-control" placeholder="SSID Password">
<label for="inputPassword">Password</label>

AND in the startup.py as mentioned in line 154:

if password == "": pwd = "key_mgmt=NONE" # If open AP valid_psk = True else: valid_psk = check_cred(ssid, password)