コード例 #1
0
ファイル: copy_for_web.py プロジェクト: danswett/purple_air
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)
コード例 #2
0
ファイル: m5stickc.py プロジェクト: jamesrhietala/purple_air
    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)