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

wifi: try to connect to known network before listing #4462

Merged
merged 1 commit into from Jan 8, 2019

Conversation

Projects
None yet
3 participants
@avsej
Copy link
Contributor

avsej commented Jan 8, 2019

Iterate over available networks ordered by signal power, and check if we
can connect to saved SSIDs. If we can, then skip network list dialog.

@avsej avsej force-pushed the avsej:master branch 4 times, most recently from ff08581 to 9f0aa2f Jan 8, 2019

if complete_callback then
complete_callback()
end
UIManager:show(InfoMessage:new{text = _("Connected."), timeout = 3})

This comment has been minimized.

@Frenzie

Frenzie Jan 8, 2019

Member

The existing popup mentions the network name.

This comment has been minimized.

@avsej

avsej Jan 8, 2019

Contributor

The existing popup does not mention the network name:

text = _("Connected.")
else
text = err_msg
end
if self.setting_ui.connect_callback then
self.setting_ui.connect_callback()
end
self:refresh()
UIManager:show(InfoMessage:new{text = text, timeout = 3})

This comment has been minimized.

@Frenzie

Frenzie Jan 8, 2019

Member

I don't know in what scenario that would show. I'm talking about the regular "Connected to network insert network name" message.

This comment has been minimized.

@avsej

avsej Jan 8, 2019

Contributor

@Frenzie, I've fixed in current patch

@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 8, 2019

I'm not really seeing much of an advantage over #4055?

@Frenzie Frenzie added the UX label Jan 8, 2019

@avsej

This comment has been minimized.

Copy link
Contributor

avsej commented Jan 8, 2019

It is completely irrelevant, because the patch you mention does not even try to connect to networks. It is more about closing scanning window after connection. But my patch tries to connect to networks, and opens scan results only when no known network found.

In other words, without this patch, I have to always click to my network to connect. While typically the device should first try to connect to known network and only in case of failure ask user to select network.

@avsej avsej force-pushed the avsej:master branch from 9f0aa2f to 473a037 Jan 8, 2019

@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 8, 2019

What device are you on? That sounds like a bug.

@avsej

This comment has been minimized.

Copy link
Contributor

avsej commented Jan 8, 2019

cervantes 4, why koreader would need to show me the scan results before trying to connect?

@pazos

This comment has been minimized.

Copy link
Contributor

pazos commented Jan 8, 2019

Related to #4422

Kobos, Cervantes and Sony devices are affected by this PR. Unlike kobos, sony/cervantes devices don't repurpose a wpasupplicant configuration, so this is a way to reconnect to a known ap without going through the network menu and provides a way to automate this process after suspension.

It needs testing on kobos, or just create a new function like reconnectOrShowNetworkMenu and use that in cervantes and sony turnOnWifi implementations.

wifi: try to connect to known network before listing
Defines new function reconnectOrShowNetworkMenu(), which iterates over
available networks ordered by signal power, and check if we can connect
to saved SSIDs. If we can, then skip network list dialog.
@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 8, 2019

just create a new function like reconnectOrShowNetworkMenu and use that in cervantes and sony turnOnWifi implementations.

Works for me.

@avsej

why koreader would need to show me the scan results before trying to connect?

It doesn't "need" to, but on Kobo it's a nice informative popup that shows you your surrounding networks for half a second before it auto-dismisses because it auto-connects. :-)

@avsej avsej force-pushed the avsej:master branch from 473a037 to de31ac0 Jan 8, 2019

@avsej

This comment has been minimized.

Copy link
Contributor

avsej commented Jan 8, 2019

i've implemented reconnectOrShowNetworkMenu, but added only for cervantes as I don't have sony device to test

@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 8, 2019

@pazos Any comments before merging?

@pazos

This comment has been minimized.

Copy link
Contributor

pazos commented Jan 8, 2019

@Frenzie: nope, lgtm

@Frenzie Frenzie merged commit 12c8d4f into koreader:master Jan 8, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
ci/circleci Your tests passed on CircleCI!
Details
@Frenzie

This comment has been minimized.

Copy link
Member

Frenzie commented Jan 8, 2019

Thanks @avsej !

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