Toggle Navigation
Hatchery
Eggs
Websockets test
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
### Author: Mattsi Jansky ### Description: Testing network functionality ### Category: Unpublished ### License: MIT ### Appname: nettest ### Built-in: no import badge import ugfx import deepsleep import wifi import time import sys sys.path.append('/lib/Websockets_test') import network_lib testDict = {"foo":"bar", "pos": {"x": 1, "y": 2}, "name":"barry", "items":["fish", "barry"]} def network_test(): badge.eink_init() ugfx.init() ugfx.input_init() wifi_up() cleanScreen() ugfx.input_attach(ugfx.BTN_START, reboot) ugfx.flush() #Test webSockets network_lib.connectWebsocket() def cleanScreen(): ugfx.clear(ugfx.WHITE) ugfx.flush() def reboot(wut): deepsleep.reboot() def wifi_up(): wifi.init() while not wifi.sta_if.isconnected(): time.sleep(0.1) pass return wifi.sta_if.ifconfig()[0] network_test()