Пример #1
0
def checkWiFi():
    """
    WiFi接続チェック
    """
    if not wifiCfg.isconnected():
        logger.warn('Reconnect to WiFi')
        if not wifiCfg.reconnect():
            machine.reset()
Пример #2
0
def wificheck():
    while not wifiCfg.wlan_sta.isconnected():
        blink('red')
        wifiCfg.reconnect()
    blink('white')
def Wifi_reconnect():
  while (wifiCfg.wlan_sta.isconnected()) != 1:
    wifiCfg.reconnect()
  label0.setText('Wifi connected')
Пример #4
0
setScreenColor(0x000000)
env1 = unit.get(unit.ENV, unit.PORTA)
earth1 = unit.get(unit.EARTH, unit.PORTB)
relay1 = unit.get(unit.RELAY, unit.PORTC)
earth2 = unit.get(unit.EARTH, (36, 35))
relay13 = unit.get(unit.RELAY, (1, 2))

screen_is_on = None
margin_top = None
i = None
watering_frequency = None
watering_duration = None

wifiCfg.autoConnect(lcdShow=True)
wifiCfg.reconnect()
wifiCfg.reconnect()
tank = M5Rect(1, 196, 8, 1, 0x729fcf, 0x729fcf)
icon = M5Img(36, 0, "res/icon.png", True)
qr = M5Img(153, 140, "res/qr.jpg", True)
temperature = M5Circle(5, 126, 5, 0x73d216, 0x000000)
humidity = M5Circle(5, 143, 5, 0x73d216, 0x000000)
button0 = M5Img(60, 204, "res/button0.png", True)
tank_border = M5Rect(0, 178, 10, 20, 0x000000, 0xffffff)
level2 = M5Circle(169, 77, 5, 0xef2929, 0x000000)
icons = M5Img(0, 48, "res/icons.png", True)
level1 = M5Circle(169, 93, 5, 0xfcaf3e, 0x000000)
battery_border = M5Rect(164, 130, 16, 10, 0x000000, 0xFFFFFF)
battery = M5Rect(165, 131, 14, 8, 0x73d216, 0x73d216)
button1 = M5Img(136, 204, "res/button1.png", True)