amended wifi connection for compatibility with list format wifi.json#64
amended wifi connection for compatibility with list format wifi.json#64prehensile wants to merge 3 commits intoemfcamp:tilda-masterfrom
Conversation
|
@marekventur Can you review this one please. |
stmhal/init-files/bootstrap.py
Outdated
| n.connect(w["ssid"], w["pw"], timeout=10) | ||
| else: | ||
| n.connect(w["ssid"], timeout=10) | ||
| except Exception as e: |
There was a problem hiding this comment.
Could you be more specific with the kind of exception your catching here?
|
If we change this here, we also need to change bootstrap.py and the files baked into the firmware (wifi.json and bootstrap.json), otherwise it will be very confusing to users. |
|
And it also needs to update the |
|
On that note the changefi app needs to read the json to populate the entries, not just assume it's set to emfcamp-insecure. |
|
I've made a bunch of improvements in the PR on Unfortunately, it doesn't build / deploy cleanly for me - It'll be a while before I can get to amending Apologies for these loose ends - I'm limited by skillset & available time. |
|
To get the badge to rewrite the bootstrap.json you need follow the factory reset procedure: See the box on https://badge.emfcamp.org/wiki/TiLDA_MK3 |
|
Aha, thanks @drrk! In that case, I can confirm that performing a factory reset writes the correct bootstrap.py & wifi.json and behaves as expected. |
| known_ssids = [ ap['ssid'] for ap in w ] | ||
|
|
||
| if len(set(known_ssids).intersection(visible_ssids)) < 1: | ||
| label.text("Couldn't find any networks listed in wifi.json :(" + wifi_info) |
There was a problem hiding this comment.
nitpick: could you add a \n before the wifi_info?
|
looks good to me |
Corresponds to a PR on
emfcamp/Mk3-Firmwareto supportwifi.jsonfiles containing more than one network.