-
Notifications
You must be signed in to change notification settings - Fork 13
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
modified wifi.py to use wifi.json files containing lists of networks #82
base: master
Are you sure you want to change the base?
Conversation
Thanks for looking at this, its one thing we've been meaning to do. Does this work on the home screen where connect() is used in a non-blocking way? Here, connect() is called, and is exited before the wifi gets a chance to complete the connect proceedure. |
Also, this is a bit brute force, where it's trying to connect to all known SSIDs until it manages to connect to a known one. I think a better way would be to use |
networks = connection_details() | ||
|
||
exc = None | ||
for details in networks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we check the list of currently visible ssids first and filter the ones out that are not in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed (this is also what I suggested in the PR conversation tab)
@thibault-ml @marekventur yep, I was going to have a look at comparing with a list of visible ssids in the next iteration :) This way works for now, depends if we want to wait 'til the ssid checking is done to have multiple APs. @mattbrejza it does work on the home screen, but it's a good point about the blocking calls - I haven't specifically tested that, maybe it happens to work at the moment by accident! |
I think it'd be good to have the code going through known APs only rather than connecting to all those we know about even if they are out of range. But then I'm not a maintainer of this repo, so not my decision. Just my 2cts. |
…blocking-assumed code
OK, I've made a few improvements. Should be safer for the non-blocking uses now (@mattbrejza) , and uses the list of visible ssids from I've also amended |
Note there are some currently some wider issues with merging this into the firmware that are discussed in the PR on |
Allows connections to wifi networks in >1 locations (say, home + work) without having to update
wifi.json
every time.Requires a small modification to
wifi.json
: the root entity is now a list of dicts, rather than just a dict, e.g.[{"ssid": "emfcamp-insecure"},{"ssid": "home-insecure"}]
(still supports the original format, though)
Has a corresponding PR on
emfcamp/micropython
to support the new format during bootstrap.