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

Bug in parameter Switch automatically to AP if STA network is not found or broken #172

Closed
ukicar opened this issue Apr 17, 2015 · 9 comments
Assignees
Milestone

Comments

@ukicar
Copy link

ukicar commented Apr 17, 2015

Checkbox has never been cabled behind for this functionality. This is the place where variable comes from IDE : https://github.com/nodesign/weio/blob/master/handlers/userSettingsHandler.py#L121

But in config.weio there is nothing called auto_to_ap
To resolve this issue we have to

@ukicar ukicar added the bug label Apr 17, 2015
@ks156 ks156 added this to the v1.2 milestone May 12, 2015
drasko added a commit that referenced this issue Oct 17, 2015
Fix #172 : Auto to AP when STA is not reachable
@ks156
Copy link
Contributor

ks156 commented Oct 17, 2015

@ukicar Please confirm this fix and close the issue if OK

@drasko
Copy link
Contributor

drasko commented Oct 19, 2015

@ukicar action from you needed!

@ks156 ks156 closed this as completed in f72e751 Oct 19, 2015
@ks156
Copy link
Contributor

ks156 commented Oct 20, 2015

Fix confirmed by @manuio (email)

@ks156
Copy link
Contributor

ks156 commented Nov 1, 2015

The original fix works if the connection is lost when the board is powered.
But if the STA network is not available at system boot, it fall back in AP mode.

From my point of view, the system must stays waiting for the STA network in this case. For example, after a power cut, home routers are often longer to boot than WeIO, and falling back to AP is probably not the intended behavior.

@ks156 ks156 modified the milestones: v1.3, v1.2 Nov 1, 2015
@ks156 ks156 removed the Fixed label Nov 1, 2015
@ks156 ks156 self-assigned this Nov 1, 2015
@ks156
Copy link
Contributor

ks156 commented Nov 1, 2015

I propose to transform this part https://github.com/nodesign/weio/blob/master/scripts/run_weio.sh#L118-L127 by :

if grep -q '"auto_to_ap": "YES"' /weio/config.weio; then
    while [ $WIFI_READY -ne 1 ]; do
        echo "WiFi network is not ready. Switching to RESCUE mode."

        # We did not connect even after whole delay expired
        # Something went wrong - got to RESCUE
        /weio/scripts/wifi_set_mode.sh rescue

        # Re-check WiFi
        check_wifi
    done
fi

to prevent an auto reconfiguration if auto_to_ap is not set and the wifi network is not available at boot start.

@ukicar, @drasko, ok with that ?

@drasko
Copy link
Contributor

drasko commented Nov 1, 2015

OK for me. Note - if for some reason you can not log in as a STA (for example typo in the password), you will not come back to AP mode. This will demand manual network set-up, and after that restart of WeIO app.

But this is OK for me, as I suppose that auto_to_ap : "NO" is for advanced users.

@ks156
Copy link
Contributor

ks156 commented Nov 2, 2015

Yeah, but there's a button to fall back in AP if needed.
I'll do the change tonight.

@drasko
Copy link
Contributor

drasko commented Nov 2, 2015

OK, +1

drasko added a commit that referenced this issue Nov 2, 2015
Fix auto_to_ap during boot. (ref #172)
@ks156
Copy link
Contributor

ks156 commented Nov 2, 2015

PR #260 merged, and fully tested on my side.
Can be closed once the fix is confirmed by someone else.

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

No branches or pull requests

3 participants