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

Auto join to networks whenever not connected #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

1Revenger1
Copy link
Contributor

@1Revenger1 1Revenger1 commented Jul 26, 2020

Whenever HeliPort gets scanned networks, it'll compare them with stored networks and autoconnect if it matches a stored network. It will only do this when not connected.

I did move the network updates over to the same timer that updates the status, as it made it a little easier to get the scanned networks without calling scanNetwork again. Though, this can be changed back

@ErrorErrorError
Copy link
Collaborator

I think having status with a shorter period as stand alone would be better because if you set the wifi as off, all the other methods would still be able to connect because the status won't be updated until 5 seconds later.

@williambj1 williambj1 added the enhancement New feature or request label Jul 26, 2020
@williambj1 williambj1 added this to the v1.0.0 milestone Jul 26, 2020
@williambj1 williambj1 requested a review from Goshin July 26, 2020 02:41
@Goshin
Copy link
Collaborator

Goshin commented Jul 26, 2020

As @ErrorErrorError mentioned, status updating needs a shorter period. And I suspect trying to connect saved networks all the time will interrupt and cause conflicts with the manual connecting, because the status will shift several times amid the connecting process.

@ErrorErrorError
Copy link
Collaborator

As @ErrorErrorError mentioned, status updating needs a shorter period. And I suspect trying to connect saved networks all the time will interrupt and cause conflicts with the manual connecting, because the status will shift several times amid the connecting process.

Looks like it will only reconnect to networks that are already saved and that have the auto join checked, not just any network saved

@1Revenger1
Copy link
Contributor Author

1Revenger1 commented Jul 26, 2020

The update right now updates status before updating networks and connecting - so I don't think there will be issues with auto join messing with a user manually joining before autojoin does. Additionally, autojoin is more likely to join before a user is able to open the wifi panel anyway if coming out of sleep and putting in a password and stuff. Autojoin will only attempt to connect to networks which are currently returned from scanning and are saved off in the keychain. Though there is the concern of a user attempting to connect after autojoin has started connecting, though 5 seconds is a short window for this to happen. I'll see what I can do about that I guess

@Goshin
Copy link
Collaborator

Goshin commented Jul 26, 2020

I meant a connecting attempt in itlwm might last like 10~15s, so "autojoin" can happen in the middle of this. Also, what if people just want to keep disconnected?

@1Revenger1
Copy link
Contributor Author

The state during a connection attempt shouldn't be init as far as I know - it'd likely be auth unless I'm missing something.
If a user wants to stay disconnected, pressing disconnect disables autojoin for that one network so it won't automatically reconnect to that network.

@ErrorErrorError
Copy link
Collaborator

I think we should wait until authentication is fully implemented in itlwm, so we can at least know when it's actually authenticating/associating, and if that's so we could have a Boolean when autoconnect was active or something that notifies that auto connect made an attempt to connect so when the user decides to connect to a network we can intercept that connection. Or the other way around, check if there was an attempt to manually connect and not autoconnect in the meantime.

Well I think it will all depend once itlwm auth is implemented, and just an idea :p

@Goshin
Copy link
Collaborator

Goshin commented Jul 26, 2020

According to zxystd, the driver might crash in the connecting phase, then it will reload the firmware and re-initialize the hardware, therefore an 'init' state could show up when connecting. It would be a better solution to get the result from itlwm side when trying to connect a network, but currently it is not yet implemented in itlwm.

@1Revenger1
Copy link
Contributor Author

It's likely better to wait until such an API is put in then, at which point this PR can be reworked to use it.

@williambj1 williambj1 modified the milestones: v1.0.0, v1.0.1 Aug 23, 2020
@williambj1 williambj1 modified the milestones: v1.0.1, v1.0.2 Sep 23, 2020
@williambj1 williambj1 removed this from the v1.0.2 milestone Jan 15, 2021
@ianmubangizi
Copy link

Also, what if people just want to keep disconnected?

Giving a user the option on when and how to connect is a good idea

Thank you all for the Great Work you've done ✔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

5 participants