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

Improve logic for WiFi setup connection check: fails too fast #322

Open
zehnm opened this issue Oct 27, 2019 · 1 comment

Comments

@zehnm
Copy link
Member

@zehnm zehnm commented Oct 27, 2019

Expected behavior

The WiFi setup process checks for successful WiFi connection after entering the credentials and clicking connect. If after a certain time the connection cannot be established, display an error message to retry again. Invalid credentials should lead to a specific error message.
The user is informed about the connection progress "connecting, waiting, connection rejected, connection established".

Current behavior

  • If after 6 seconds the connection hasn't been established yet, the "Not connected ... try again" error message is displayed.
  • There's no specific error message if the user entered invalid credentials.
  • If the remote takes longer than 6 seconds to connect, the error message remains even though the remote is already connected to the network.
    On my Ubiquiti UniFi AP AC-LR the initial connection takes sometimes over 10 seconds and I get stuck in the setup wizard!

Possible implementation

The WiFi setup needs a major rework. Everything is in wifiSetup.qml, no separation from UI and controller. Shell scripts are directly called from the UI event handler.
Connection check is hard coded to 6000 ms.

TODO:

  • MVC implementation
  • Abstraction of WiFi device, preferably in library
  • Define a better feedback mechanism from the low level connection scripts, especially for credential errors

We should also look into how to directly communicate with the wpa_supplicant API instead of calling shell scripts and parsing console output. Advantages:

  • Significantly improve reliability
  • More and better options of status feedback
  • Support for different OS (e.g. Android)

wpa_supplicant developer documentation:

Example implementations:

Further examples:

See related issue: YIO-Remote/remote-os#13

zehnm added a commit that referenced this issue Nov 14, 2019
Increased timout to 10s to be able to connect to UniFi access points as
an immediate improvement before the connection rewrite.
This is related to #322
@zehnm zehnm added this to Backlog in Yio remote via automation Nov 16, 2019
@zehnm zehnm moved this from Backlog to Design in Yio remote Nov 16, 2019
@zehnm zehnm self-assigned this Nov 16, 2019
@zehnm

This comment has been minimized.

Copy link
Member Author

@zehnm zehnm commented Nov 16, 2019

Started with rewriting the WiFi integration and designing a general WiFi control API for using different implementations. Starting with:

  1. Mock implementation for testing
  2. Wrapping current shell scripts
  3. wpa_supplicant control API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Yio remote
  
Design
1 participant
You can’t perform that action at this time.