monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

Wifi connection says 'failed' but actually connected #521

Closed rross101 closed 5 years ago

rross101 commented 6 years ago

New update installed. Connection to wi-fi shows status: failed on display but actually it's fine.

tehn commented 6 years ago

is this new since the update? i've heard reports of this prior, and i don't think anything specifically touched the wifi functionality in the update.

none the less, the wifi management will be getting an overhaul so it's less fragile.

catfact commented 6 years ago

no its not new

ranch-verdin commented 5 years ago

probably a bit late, since it seems wifi.sh will be replace by networkmanager now. However, in case teething problems with NM can't be ironed out, just a quick note what could be done to further battle-harden this unholy shell script:

https://github.com/monome/norns/blob/master/wifi.sh#L44

this invocation: sudo wpa_cli status|grep wpa_state|sed -e s/wpa_state=// != "COMPLETED" ]

looks like an obvious weak point of the little beast, it could be hardened a bit. Could potentially gerry-rig something to log the entire output of sudo wpa_cli status and make that available for debugging the field failures which have clearly been plaguing wifi.sh. Also it is only waiting 5s currently to associate before concluding 'password failure'. I guess 100 tries (10s) would be a better reflection of real-world wifi flakiness.

These points also look bad, since the error message is duplicated for different error conditions: https://github.com/monome/norns/blob/master/wifi.sh#L109 https://github.com/monome/norns/blob/master/wifi.sh#L113

oh, and sorry for not coming back sooner to fix/replace this buggy piece of crap!