🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ImportError: no module named 'M5'

    UiFlow 2.0
    1
    2
    928
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      brendonhatcher
      last edited by

      I am using the Stick C Plus 2
      I used the M5Burner-v3-beta-win-x64 burner
      Downloaded UIFlow2.0 StickC Plus2 v 2.0.7
      Burnt to Stick with no error
      Using UIFlow 2.0.7 at https://uiflow2.m5stack.com/
      I connected the Stick via USB and the screen shows:
      V1.13.4
      API key
      Cloud

      I loaded a new project in UIFlow, for the correct device.
      Run > Connect
      Connected to serial port
      Run

      Traceback (most recent call last):

      File "_flow.py", line 41, in <module>
      KeyboardInterrupt: 
      MicroPython 9d61eff07-dirty on 2024-04-25; M5StickC-Plus2 with ESP32
      Type "help()" for more information.
      >>> 
      MicroPython 9d61eff07-dirty on 2024-04-25; M5StickC-Plus2 with ESP32
      Type "help()" for more information.
      >>> 
      >>> import gc
      >>> gc.collect()
      >>> 
      paste mode; Ctrl-C to cancel, Ctrl-D to finish
      === import os, sys, io
      === import M5
      === from M5 import *
      === def setup():
      ===   M5.begin()
      === def loop():
      ===   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")
      === 
      === 
      === 
      Traceback (most recent call last):
      File "<stdin>", line 2, in <module>
      ImportError: no module named 'M5'
      >>>
      

      How do I resolve this?

      Thanks
      Brendon

      B 1 Reply Last reply Reply Quote 1
      • B
        brendonhatcher @brendonhatcher
        last edited by

        Worked it out.

        The Stick was showing V1.13.4, which was the firmware version for UIFlow 1.
        I had previously flashed that onto the stick.
        When I was burning UIFlow 2, it didn't erase or overwrite the V1 firmware.
        I forced an erase by going to Burn / Erase.

        The stick is now showing the V2 firmware and I am able to flash new programs to it.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post