Wifi Invalid Mode
-
Hi All,
I have an issue where, if I create this as main.py, I will get an error when I try to start my M5 paper. The error is Wifi Invalid Mode.
My script is below. I have the same configuration in M5 burner and it seems to correctly trying to start main.py as I get the error straight away. If I chose to show the menu at start up then I can see the M5 paper in UIFlow 2 and I can see the device has connected to my account. Any ideas? It's a bit of a pain having choose the app from the applist on the devices screen, but I can run it like that. My app is a bit more complicated than this but this script does the same thing:
import os, sys, io
import M5
from M5 import *
import networklabel0 = None
wlan = Nonedef setup():
global label0, wlanwlan = network.WLAN(network.STA_IF)
M5.begin()
Widgets.fillScreen(0xeeeeee)
label0 = Widgets.Label("label0", 124, 542, 1.0, 0xffffff, 0x000000, Widgets.FONTS.DejaVu18)wlan.connect('network', 'testtesttest')
label0.setFont(Widgets.FONTS.DejaVu24)
label0.setText(str(wlan.ifconfig()[0]))def loop():
global label0, wlan
M5.update()if name == 'main':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")Thanks,
-
Hello @JensH
please check my example in UIFlow2 Project Zone: M5Paper_WLAN_Test_UIFlow2.2.5
Thanks
Felix -
Thanks Felix. I've added the same delay as in your code and that has fixed my issue. I still have an error in the terminal if I have it connected to my PC but at least the app is functioning now and I can restart my M5 Paper straight into the app.
Thanks very much for your help.
J
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login