def Connect(): try: ssid, password = wifiCfg.deviceCfg.wifi_read_from_flash() except AttributeError: try: ssid, password = wifiCfg.wifi_read_from_flash() except AttributeError: ShowText('no SSID found', error=True) if not (wifiCfg.wlan_sta.isconnected()): wifiCfg.doConnect(ssid, password)
def _GetDefaults(self): """The SSID & Password are already on the device: Use them. Hard code them in the program? What am I, a farmer? """ try: # >= 1.5 self.ssid, self.password = wifiCfg.deviceCfg.wifi_read_from_flash() except AttributeError: try: # < 1.4 self.ssid, self.password = wifiCfg.wifi_read_from_flash() except AttributeError: self.ShowError('no SSID found') wait_ms(10000)