if ntf == 1001: # 获取数据 # print(internet_date) display() gc_count += 1 # gc.collect() # 将debug_date 数据显示到debug窗口 if len(debug_date) > 0: de(debug_date[0]) del debug_date[0] gc_count += 1 if gc_count > 20: gc.collect() gc_count = 0 window.page.append(page1) window.page.append(page2) window.active() # thread.stack_size(1024*8*10) thread.stack_size(1024 * 8 * 10) main_thread = thread.start_new_thread('main', main, ()) # windows线程 get_date_thread = thread.start_new_thread('get_date', get_date, (main_thread, )) # 获取数据线程 machine.heap_info() thread.list()
text("connnecting") text("connnecting2") PROXY_HOST = "http://meter.nnapz.com/meter/" PROXY_PORT = 8081 utime.sleep_ms(1500) text("connnecting3") while True: try: print("Starting WiFi ...") wlaninfo = bsnet.connectBS() if (wlaninfo): text(wlaninfo) bsnet.setTime() bsnet.mailHome( "[SP-2] Started ", "WLAN: " + wlaninfo + "\nFlash Mem Size: " + str(machine.heap_info()) + "\nFlash Id: " + str(machine.unique_id()) + "\nRead from " + PROXY_HOST + " PORT " + str(PROXY_PORT)) #bsutil.blink(2, 'slow') break except Exception as e: text(str(e)) print("Error connecting to WLAN: " + str(e)) #tft.clear(tft.BLUE)