mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.4k stars 434 forks source link

MU is not compatible with M5Stack running UIFlow #1305

Open mhfalken opened 3 years ago

mhfalken commented 3 years ago

When I try to use the M5StickC running UIFlow (Python mode) together with the MU editor it doesn't work. When I press 'Files', I get the following error: image

When I press 'Run', I get the following error code in REPL (and the code don't run): image Sometimes it reboot first, and then show the error.

If I press REPL it seems to work, if I press CTRL-C a few times.

I had hoped that I could use the M5Stack devices together with the MU editor. /Michael

MU version: Mu 1.1.0.alpha.2 M5Stack UIFlow (M5StickC): version: 1.7.2,

Here is the full log. The tests are in the end of the log.

2021-02-18 13:33:42,953 - root:122(run) INFO: 

-----------------

Starting Mu 1.1.0.alpha.2
2021-02-18 13:33:42,956 - root:123(run) INFO: uname_result(system='Windows', node='Michaels-Legion', release='10', version='10.0.19041', machine='AMD64', processor='AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD')
2021-02-18 13:33:42,956 - root:124(run) INFO: Python path: ['C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs', 'C:\\Users\\Michael\\AppData\\Local\\Mu', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\python36.zip', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\DLLs', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\lib', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python', 'C:\\Users\\Michael\\AppData\\Local\\python\\mu\\site-packages', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs\\IPython\\extensions']
2021-02-18 13:33:42,956 - root:125(run) INFO: Language code: en_DK
2021-02-18 13:33:43,136 - mu.logic:845(__init__) INFO: Setting up editor.
2021-02-18 13:33:43,137 - mu.logic:867(__init__) INFO: Settings path: C:\Users\Michael\AppData\Local\python\mu\settings.json
2021-02-18 13:33:43,137 - mu.logic:868(__init__) INFO: Session path: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:33:43,137 - mu.logic:869(__init__) INFO: Log directory: C:\Users\Michael\AppData\Local\python\mu\Logs
2021-02-18 13:33:43,137 - mu.logic:870(__init__) INFO: Data directory: C:\Users\Michael\AppData\Local\python\mu
2021-02-18 13:33:43,153 - mu.logic:884(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero
2021-02-18 13:33:43,660 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:33:43,666 - mu.logic:969(restore_session) INFO: Restoring session from: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:33:43,666 - mu.logic:970(restore_session) DEBUG: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\axp-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\sound-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-18 13:33:43,673 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\axp-test.py
2021-02-18 13:33:43,679 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:33:43,679 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:33:43,680 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-18 13:33:43,680 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
from m5stack import axp
import time

while True:
    y=5
    dy = 15
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)

    if axp.getChargeState():
        lcd.text(10, y, "Charging, %imA" %axp.getBatCurrent())
        y += dy

    lcd.text(10, y, "Batt= %3.1fV" %axp.getBatVoltage())
    y += dy
    #lcd.text(10, y, "In= %iV, %imA" %(axp.getVinVoltage(), axp.getVinCurrent()))
    y += dy
    time.sleep(1)

2021-02-18 13:33:44,173 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\sound-test.py
2021-02-18 13:33:44,179 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:33:44,179 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:33:44,179 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\r\n'
2021-02-18 13:33:44,179 - mu.logic:1172(_load) DEBUG: from machine import I2S, SDCard, Pin
from m5stack import *
import os, uos
from wav import wave

#mount the sd card
sd = SDCard(slot = 2, sck = Pin(23), miso = Pin(33), mosi = Pin(19), freq = 10000000)

#initialize the I2S device
i2s = I2S(  mode = I2S.MODE_MASTER | I2S.MODE_TX | I2S.MODE_DAC_BUILT_IN,
            rate = 16000,
            bits = 16,
            channel_format = I2S.CHANNEL_ONLY_LEFT,
            data_format = I2S.FORMAT_I2S_MSB)

#create a function to play the wav
def wav_player(fname):
    wav = wave.open(fname)
    i2s.set_dac_mode(I2S.DAC_RIGHT_EN)
    i2s.sample_rate(wav.getframerate())
    i2s.bits(wav.getsampwidth() * 8)
    i2s.nchannels(wav.getnchannels())
    i2s.volume(50)

    while True:
        data = wav.readframes(0x2000)
        if len(data) > 0:
            i2s.write(data)
        else:
            wav.close()
            break
        time.sleep(0.05)

# Playing WAV audio file
lcd.clear()
lcd.print('working',0,0,0xffffff)

try:
    uos.mountsd(sd, '/sd')
except:
    #os.mountsd()
    pass

speaker.setVolume(2)
#kill the weird start noise glitch
i2s.stop()

#point the directory to the files you have on your sd card - works best with short low file size wavs
while True:
    if btnA.wasPressed():
        wav_player('/flash/res/mix.wav')
        i2s.stop()
    if btnB.wasPressed():
        wav_player('/sd/ON.wav')
        i2s.stop()
    if btnC.wasPressed():
        wav_player('/sd/ENERGYLOW.wav')
        i2s.stop()
2021-02-18 13:33:44,198 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\test.py
2021-02-18 13:33:44,206 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:33:44,206 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:33:44,206 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\r\n'
2021-02-18 13:33:44,206 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import time

#lcd.font(lcd.FONT_DejaVu18)
lcd.font(lcd.FONT_DejaVu24)
lcd.orient(lcd.LANDSCAPE_FLIP)

lcd.print('Hello world!', 90, 50, 0xff0000)

lcd.rect(78, 35, 180, 58)

# Speaker GPIO25
for i in range(5):
    speaker.setVolume(i+1)
    speaker.tone(1600, 100)
    time.sleep(0.01)
    speaker.tone(1000, 200)

while True:
    if btnA.wasPressed():
        lcd.print("A", 10, 100)
    if btnB.wasPressed():
        lcd.print("B", 10, 130)
    if btnC.wasPressed():
        lcd.print("C - exit", 10, 160)
        break

2021-02-18 13:33:44,224 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\gyro-test.py
2021-02-18 13:33:44,231 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:33:44,231 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:33:44,231 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-18 13:33:44,231 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import imu
import time

myIMU = imu.IMU()
lcd.font(lcd.FONT_DejaVu18)

while True:
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)
    #v = myIMU.acceleration
    v = myIMU.gyro
    lcd.text(10, 10, "X= %.2f" %v[0])
    lcd.text(10, 30, "Y= %.2f" %v[1])
    lcd.text(10, 50, "Z= %.2f" %v[2])
    time.sleep(0.5)

2021-02-18 13:33:44,252 - mu.logic:992(restore_session) INFO: Loaded files.
2021-02-18 13:33:44,252 - mu.logic:997(restore_session) INFO: User defined environment variables: []
2021-02-18 13:33:44,252 - mu.logic:1003(restore_session) INFO: Minify scripts on micro:bit? False
2021-02-18 13:33:44,286 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:33:44,370 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-18 13:34:29,590 - mu.modes.esp:211(toggle_files) INFO: Toggle filesystem on.
2021-02-18 13:34:31,710 - mu.modes.base:691(ls) ERROR: Could not enter raw REPL.
Traceback (most recent call last):
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\modes\base.py", line 688, in ls
    result = tuple(microfs.ls(self.serial))
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 185, in ls
    out, err = execute(["import os", "print(os.listdir())"], serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 139, in execute
    raw_on(serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 91, in raw_on
    flush_to_msg(serial, raw_repl_msg)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 72, in flush_to_msg
    raise IOError("Could not enter raw REPL.")
OSError: Could not enter raw REPL.
2021-02-18 13:34:31,769 - mu.interface.main:886(show_message) DEBUG: There was a problem getting the list of files on the device. Please check Mu's logs for technical information. Alternatively, try unplugging/plugging-in your device and/or restarting Mu.
2021-02-18 13:34:31,769 - mu.interface.main:887(show_message) DEBUG: None
2021-02-18 13:35:27,556 - mu.modes.esp:215(toggle_files) INFO: Toggle filesystem off.
2021-02-18 13:35:28,772 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:35:28,809 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:35:28,817 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:35:28,817 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:36:51,723 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:36:51,850 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:36:52,663 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:36:52,700 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:36:52,703 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:36:52,703 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:36:54,460 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:36:54,595 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:36:57,838 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:36:57,848 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:36:57,884 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:36:57,887 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:36:57,888 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:36:57,888 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:36:57,888 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:36:57,896 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:36:57,898 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:36:57,900 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:36:57,902 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:36:57,904 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:36:57,906 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:36:57,919 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:36:57,922 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:36:57,930 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:36:57,932 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:36:57,934 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:36:57,936 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:36:57,938 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:36:57,941 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:36:57,943 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:36:57,946 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:36:57,948 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:36:57,950 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:36:57,952 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:36:57,955 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:36:57,957 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:36:57,960 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:36:57,962 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:36:57,965 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:36:57,967 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:36:57,970 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:36:57,973 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:37:38,449 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:37:38,573 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:37:40,269 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:37:40,305 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:37:40,309 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:37:40,309 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:39:07,310 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:39:07,311 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:39:07,311 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:07,314 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:07,316 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:39:07,319 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:07,321 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:07,323 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:07,328 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:39:07,330 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:39:07,333 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:39:07,335 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:39:07,338 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:07,340 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:39:07,353 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:39:07,356 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:07,362 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:07,364 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:39:07,366 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:39:07,368 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:39:07,370 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:39:07,372 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:39:07,374 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:39:07,376 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:39:07,379 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:39:07,381 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:39:07,383 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:07,386 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:07,389 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:07,391 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:39:30,806 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:39:30,806 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:39:30,806 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:30,808 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:30,810 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:39:30,812 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:30,815 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:30,818 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:30,820 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:39:30,823 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:39:30,825 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:39:30,828 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:39:30,831 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:30,833 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:39:30,836 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:39:30,838 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:30,841 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:30,843 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:39:30,846 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:39:30,848 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:39:30,851 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:39:30,854 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:39:30,856 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:39:30,859 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:39:30,861 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:39:30,863 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:39:30,866 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:30,869 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:30,871 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:30,873 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:39:38,637 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:39:38,638 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:39:38,638 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:38,640 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:38,643 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:39:38,645 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:38,647 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:38,649 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:38,651 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:39:38,654 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:39:38,657 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:39:38,659 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:39:38,661 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:38,663 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:39:38,666 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:39:38,669 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:38,671 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:38,673 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:39:38,676 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:39:38,678 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:39:38,680 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:39:38,682 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:39:38,685 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:39:38,687 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:39:38,690 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:39:38,692 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:39:38,694 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:38,696 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:38,698 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:38,700 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:39:41,758 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:39:41,881 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:39:44,286 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:39:44,322 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:39:44,326 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:39:44,327 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:39:46,005 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:39:46,145 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:39:47,385 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:39:47,386 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:39:47,423 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:39:47,428 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:39:47,428 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:39:47,428 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:39:47,428 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:47,432 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:47,438 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:39:47,440 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:47,443 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:47,446 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:47,449 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:39:47,451 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:39:47,454 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:39:47,457 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:39:47,459 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:47,462 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:39:47,465 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:39:47,467 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:47,469 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:47,471 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:39:47,473 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:39:47,476 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:39:47,478 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:39:47,481 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:39:47,484 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:39:47,486 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:39:47,488 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:39:47,490 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:39:47,492 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:47,494 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:47,496 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:47,499 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:39:51,982 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:39:51,982 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:39:51,982 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:51,985 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:51,987 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:39:51,989 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:51,992 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:51,994 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:39:51,996 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:39:51,998 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:39:52,000 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:39:52,003 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:39:52,005 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:52,007 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:39:52,009 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:39:52,012 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:52,015 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:52,017 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:39:52,020 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:39:52,022 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:39:52,024 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:39:52,027 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:39:52,030 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:39:52,032 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:39:52,034 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:39:52,036 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:39:52,038 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:52,041 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:39:52,044 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:39:52,046 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:39:53,200 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:39:53,327 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:39:54,242 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:39:54,279 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:39:54,283 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:39:54,283 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:39:58,150 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:39:58,155 - mu.interface.main:886(show_message) DEBUG: Could not find an attached device.
2021-02-18 13:39:58,155 - mu.interface.main:887(show_message) DEBUG: Please make sure the device is plugged into this computer.

It must have a version of MicroPython (or CircuitPython) flashed onto it before the REPL will work.

Finally, press the device's reset button and wait a few seconds before trying again.
2021-02-18 13:40:02,160 - mu.logic:816(check_usb) INFO: esp device disconnected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer FTDI)
2021-02-18 13:40:03,151 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-18 13:40:12,615 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:40:12,616 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:40:12,651 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:40:12,654 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:40:12,654 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:40:12,654 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:40:12,654 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:12,657 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:12,662 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:40:12,664 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:12,666 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:12,669 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:12,671 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:40:12,674 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:40:12,676 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:40:12,678 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:40:12,681 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:12,683 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:40:12,686 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:40:12,688 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:12,690 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:12,692 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:40:12,694 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:40:12,696 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:40:12,698 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:40:12,701 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:40:12,703 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:40:12,705 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:40:12,708 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:40:12,710 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:40:12,712 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:12,714 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:12,716 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:12,718 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:40:13,996 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:40:13,996 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:40:13,996 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:13,998 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:14,000 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:40:14,002 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:14,005 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:14,007 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:14,010 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:40:14,012 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:40:14,014 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:40:14,016 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:40:14,018 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:14,020 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:40:14,022 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:40:14,024 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:14,026 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:14,029 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:40:14,031 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:40:14,033 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:40:14,035 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:40:14,037 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:40:14,039 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:40:14,041 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:40:14,043 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:40:14,046 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:40:14,048 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:14,051 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:14,054 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:14,057 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:40:16,436 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:40:16,562 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:40:18,142 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:40:18,142 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:40:18,179 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:40:18,183 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:40:18,183 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:40:18,183 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:40:18,183 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:18,187 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:18,192 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:40:18,194 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:18,196 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:18,198 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:18,200 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:40:18,202 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:40:18,204 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:40:18,206 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:40:18,209 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:18,212 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:40:18,214 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:40:18,216 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:18,219 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:18,221 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:40:18,223 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:40:18,226 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:40:18,228 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:40:18,230 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:40:18,233 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:40:18,235 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:40:18,237 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:40:18,240 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:40:18,242 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:18,245 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:18,248 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:18,250 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:40:23,984 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:40:23,985 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:40:23,985 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:23,987 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:23,989 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:40:23,991 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:23,993 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:23,995 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:40:23,997 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:40:23,999 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:40:24,001 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:40:24,003 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:40:24,006 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:24,008 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:40:24,010 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:40:24,012 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:24,014 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:24,016 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:40:24,018 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:40:24,020 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:40:24,022 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:40:24,024 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:40:24,026 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:40:24,028 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:40:24,030 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:40:24,032 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:40:24,034 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:24,037 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:40:24,039 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:40:24,042 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:40:58,154 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:40:58,157 - mu.interface.main:886(show_message) DEBUG: Could not find an attached device.
2021-02-18 13:40:58,157 - mu.interface.main:887(show_message) DEBUG: Please make sure the device is plugged into this computer.

It must have a version of MicroPython (or CircuitPython) flashed onto it before the REPL will work.

Finally, press the device's reset button and wait a few seconds before trying again.
2021-02-18 13:40:59,913 - mu.logic:816(check_usb) INFO: esp device disconnected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer FTDI)
2021-02-18 13:41:01,053 - mu.interface.main:886(show_message) DEBUG: Could not find an attached device.
2021-02-18 13:41:01,053 - mu.interface.main:887(show_message) DEBUG: Please make sure the device is plugged into this computer.

It must have a version of MicroPython (or CircuitPython) flashed onto it before the REPL will work.

Finally, press the device's reset button and wait a few seconds before trying again.
2021-02-18 13:41:03,337 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:41:07,152 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-18 13:41:08,171 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:41:10,408 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:41:10,411 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:41:10,411 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:41:10,652 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:41:10,777 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:41:13,230 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:41:13,230 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:41:13,267 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:41:13,270 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:41:13,270 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:41:13,270 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:41:13,270 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:41:13,272 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:41:13,278 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:41:13,280 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:41:13,282 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:41:13,284 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:41:13,286 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:41:13,288 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:41:13,290 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:41:13,292 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:41:13,294 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:41:13,297 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:41:13,299 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:41:13,302 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:41:13,304 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:41:13,306 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:41:13,308 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:41:13,310 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:41:13,313 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:41:13,315 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:41:13,317 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:41:13,319 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:41:13,321 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:41:13,323 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:41:13,326 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:41:13,328 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:41:13,331 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:41:13,333 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:42:21,229 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:42:21,356 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:42:22,172 - mu.modes.esp:211(toggle_files) INFO: Toggle filesystem on.
2021-02-18 13:42:24,285 - mu.modes.base:691(ls) ERROR: Could not enter raw REPL.
Traceback (most recent call last):
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\modes\base.py", line 688, in ls
    result = tuple(microfs.ls(self.serial))
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 185, in ls
    out, err = execute(["import os", "print(os.listdir())"], serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 139, in execute
    raw_on(serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 91, in raw_on
    flush_to_msg(serial, raw_repl_msg)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 72, in flush_to_msg
    raise IOError("Could not enter raw REPL.")
OSError: Could not enter raw REPL.
2021-02-18 13:42:24,287 - mu.interface.main:886(show_message) DEBUG: There was a problem getting the list of files on the device. Please check Mu's logs for technical information. Alternatively, try unplugging/plugging-in your device and/or restarting Mu.
2021-02-18 13:42:24,287 - mu.interface.main:887(show_message) DEBUG: None
2021-02-18 13:42:28,535 - mu.modes.esp:215(toggle_files) INFO: Toggle filesystem off.
2021-02-18 13:42:29,824 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:42:29,824 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:42:29,860 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:42:29,864 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:42:29,864 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:42:29,864 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:42:29,864 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:42:29,872 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:42:29,884 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:42:29,886 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:42:29,888 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:42:29,890 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:42:29,895 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:42:29,897 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:42:29,900 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:42:29,903 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:42:29,905 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:42:29,907 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:42:29,909 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:42:29,911 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:42:29,913 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:42:29,916 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:42:29,918 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:42:29,920 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:42:29,931 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:42:29,934 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:42:29,938 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:42:29,950 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:42:29,952 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:42:29,954 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:42:29,971 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:42:29,983 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:42:29,985 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:42:29,988 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:42:39,695 - mu.logic:1424(show_help) INFO: Showing help at 'https://codewith.mu/en/help/1.1'.
2021-02-18 13:43:14,497 - mu.logic:1491(show_admin) INFO: Showing admin with logs from C:\Users\Michael\AppData\Local\python\mu\Logs\mu.log
2021-02-18 13:43:14,497 - mu.logic:201(installed_packages) INFO: Packages found: []
2021-02-18 13:43:46,138 - mu.logic:1543(sync_package_state) INFO: Synchronize package states...
2021-02-18 13:43:46,138 - mu.logic:1544(sync_package_state) INFO: Old: set()
2021-02-18 13:43:46,138 - mu.logic:1545(sync_package_state) INFO: New: set()
2021-02-18 13:43:47,712 - mu.logic:1467(quit) DEBUG: Session: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\axp-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\sound-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-18 13:43:47,712 - mu.logic:1468(quit) DEBUG: Saving session to: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:43:47,720 - mu.logic:1482(quit) INFO: Quitting.

2021-02-18 13:43:57,021 - root:122(run) INFO: 

-----------------

Starting Mu 1.1.0.alpha.2
2021-02-18 13:43:57,021 - root:123(run) INFO: uname_result(system='Windows', node='Michaels-Legion', release='10', version='10.0.19041', machine='AMD64', processor='AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD')
2021-02-18 13:43:57,022 - root:124(run) INFO: Python path: ['C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs', 'C:\\Users\\Michael\\AppData\\Local\\Mu', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\python36.zip', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\DLLs', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\lib', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python', 'C:\\Users\\Michael\\AppData\\Local\\python\\mu\\site-packages', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs\\IPython\\extensions']
2021-02-18 13:43:57,022 - root:125(run) INFO: Language code: en_DK
2021-02-18 13:43:57,169 - mu.logic:845(__init__) INFO: Setting up editor.
2021-02-18 13:43:57,169 - mu.logic:867(__init__) INFO: Settings path: C:\Users\Michael\AppData\Local\python\mu\settings.json
2021-02-18 13:43:57,169 - mu.logic:868(__init__) INFO: Session path: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:43:57,169 - mu.logic:869(__init__) INFO: Log directory: C:\Users\Michael\AppData\Local\python\mu\Logs
2021-02-18 13:43:57,169 - mu.logic:870(__init__) INFO: Data directory: C:\Users\Michael\AppData\Local\python\mu
2021-02-18 13:43:57,186 - mu.logic:884(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero
2021-02-18 13:43:57,581 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:43:57,581 - mu.logic:969(restore_session) INFO: Restoring session from: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:43:57,581 - mu.logic:970(restore_session) DEBUG: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\axp-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\sound-test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\test.py', 'C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-18 13:43:57,586 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\axp-test.py
2021-02-18 13:43:57,586 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:43:57,586 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:43:57,587 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-18 13:43:57,587 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
from m5stack import axp
import time

while True:
    y=5
    dy = 15
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)

    if axp.getChargeState():
        lcd.text(10, y, "Charging, %imA" %axp.getBatCurrent())
        y += dy

    lcd.text(10, y, "Batt= %3.1fV" %axp.getBatVoltage())
    y += dy
    #lcd.text(10, y, "In= %iV, %imA" %(axp.getVinVoltage(), axp.getVinCurrent()))
    y += dy
    time.sleep(1)

2021-02-18 13:43:57,949 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\sound-test.py
2021-02-18 13:43:57,950 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:43:57,950 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:43:57,950 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\r\n'
2021-02-18 13:43:57,950 - mu.logic:1172(_load) DEBUG: from machine import I2S, SDCard, Pin
from m5stack import *
import os, uos
from wav import wave

#mount the sd card
sd = SDCard(slot = 2, sck = Pin(23), miso = Pin(33), mosi = Pin(19), freq = 10000000)

#initialize the I2S device
i2s = I2S(  mode = I2S.MODE_MASTER | I2S.MODE_TX | I2S.MODE_DAC_BUILT_IN,
            rate = 16000,
            bits = 16,
            channel_format = I2S.CHANNEL_ONLY_LEFT,
            data_format = I2S.FORMAT_I2S_MSB)

#create a function to play the wav
def wav_player(fname):
    wav = wave.open(fname)
    i2s.set_dac_mode(I2S.DAC_RIGHT_EN)
    i2s.sample_rate(wav.getframerate())
    i2s.bits(wav.getsampwidth() * 8)
    i2s.nchannels(wav.getnchannels())
    i2s.volume(50)

    while True:
        data = wav.readframes(0x2000)
        if len(data) > 0:
            i2s.write(data)
        else:
            wav.close()
            break
        time.sleep(0.05)

# Playing WAV audio file
lcd.clear()
lcd.print('working',0,0,0xffffff)

try:
    uos.mountsd(sd, '/sd')
except:
    #os.mountsd()
    pass

speaker.setVolume(2)
#kill the weird start noise glitch
i2s.stop()

#point the directory to the files you have on your sd card - works best with short low file size wavs
while True:
    if btnA.wasPressed():
        wav_player('/flash/res/mix.wav')
        i2s.stop()
    if btnB.wasPressed():
        wav_player('/sd/ON.wav')
        i2s.stop()
    if btnC.wasPressed():
        wav_player('/sd/ENERGYLOW.wav')
        i2s.stop()
2021-02-18 13:43:57,968 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\test.py
2021-02-18 13:43:57,969 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:43:57,969 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:43:57,969 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\r\n'
2021-02-18 13:43:57,969 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import time

#lcd.font(lcd.FONT_DejaVu18)
lcd.font(lcd.FONT_DejaVu24)
lcd.orient(lcd.LANDSCAPE_FLIP)

lcd.print('Hello world!', 90, 50, 0xff0000)

lcd.rect(78, 35, 180, 58)

# Speaker GPIO25
for i in range(5):
    speaker.setVolume(i+1)
    speaker.tone(1600, 100)
    time.sleep(0.01)
    speaker.tone(1000, 200)

while True:
    if btnA.wasPressed():
        lcd.print("A", 10, 100)
    if btnB.wasPressed():
        lcd.print("B", 10, 130)
    if btnC.wasPressed():
        lcd.print("C - exit", 10, 160)
        break

2021-02-18 13:43:57,988 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\gyro-test.py
2021-02-18 13:43:57,988 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:43:57,988 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:43:57,989 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-18 13:43:57,989 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import imu
import time

myIMU = imu.IMU()
lcd.font(lcd.FONT_DejaVu18)

while True:
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)
    #v = myIMU.acceleration
    v = myIMU.gyro
    lcd.text(10, 10, "X= %.2f" %v[0])
    lcd.text(10, 30, "Y= %.2f" %v[1])
    lcd.text(10, 50, "Z= %.2f" %v[2])
    time.sleep(0.5)

2021-02-18 13:43:58,008 - mu.logic:992(restore_session) INFO: Loaded files.
2021-02-18 13:43:58,008 - mu.logic:997(restore_session) INFO: User defined environment variables: []
2021-02-18 13:43:58,008 - mu.logic:1003(restore_session) INFO: Minify scripts on micro:bit? False
2021-02-18 13:43:58,046 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:43:58,184 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-18 13:44:00,752 - mu.logic:1491(show_admin) INFO: Showing admin with logs from C:\Users\Michael\AppData\Local\python\mu\Logs\mu.log
2021-02-18 13:44:00,752 - mu.logic:201(installed_packages) INFO: Packages found: []
2021-02-18 13:46:09,898 - mu.logic:1532(show_admin) INFO: No admin settings changed.
2021-02-18 13:46:19,134 - mu.logic:1491(show_admin) INFO: Showing admin with logs from C:\Users\Michael\AppData\Local\python\mu\Logs\mu.log
2021-02-18 13:46:19,134 - mu.logic:201(installed_packages) INFO: Packages found: []
2021-02-18 13:46:32,298 - mu.logic:1543(sync_package_state) INFO: Synchronize package states...
2021-02-18 13:46:32,298 - mu.logic:1544(sync_package_state) INFO: Old: set()
2021-02-18 13:46:32,298 - mu.logic:1545(sync_package_state) INFO: New: set()
2021-02-18 13:46:34,397 - mu.logic:1467(quit) DEBUG: Session: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-18 13:46:34,397 - mu.logic:1468(quit) DEBUG: Saving session to: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:46:34,403 - mu.logic:1482(quit) INFO: Quitting.

2021-02-18 13:46:43,164 - root:122(run) INFO: 

-----------------

Starting Mu 1.1.0.alpha.2
2021-02-18 13:46:43,165 - root:123(run) INFO: uname_result(system='Windows', node='Michaels-Legion', release='10', version='10.0.19041', machine='AMD64', processor='AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD')
2021-02-18 13:46:43,165 - root:124(run) INFO: Python path: ['C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs', 'C:\\Users\\Michael\\AppData\\Local\\Mu', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\python36.zip', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\DLLs', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\lib', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python', 'C:\\Users\\Michael\\AppData\\Local\\python\\mu\\site-packages', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs\\IPython\\extensions']
2021-02-18 13:46:43,165 - root:125(run) INFO: Language code: en_DK
2021-02-18 13:46:43,310 - mu.logic:845(__init__) INFO: Setting up editor.
2021-02-18 13:46:43,310 - mu.logic:867(__init__) INFO: Settings path: C:\Users\Michael\AppData\Local\python\mu\settings.json
2021-02-18 13:46:43,311 - mu.logic:868(__init__) INFO: Session path: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:46:43,311 - mu.logic:869(__init__) INFO: Log directory: C:\Users\Michael\AppData\Local\python\mu\Logs
2021-02-18 13:46:43,311 - mu.logic:870(__init__) INFO: Data directory: C:\Users\Michael\AppData\Local\python\mu
2021-02-18 13:46:43,327 - mu.logic:884(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero
2021-02-18 13:46:43,766 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:46:43,766 - mu.logic:969(restore_session) INFO: Restoring session from: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-18 13:46:43,766 - mu.logic:970(restore_session) DEBUG: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-18 13:46:43,771 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\gyro-test.py
2021-02-18 13:46:43,771 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-18 13:46:43,772 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-18 13:46:43,772 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-18 13:46:43,772 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import imu
import time

myIMU = imu.IMU()
lcd.font(lcd.FONT_DejaVu18)

while True:
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)
    #v = myIMU.acceleration
    v = myIMU.gyro
    lcd.text(10, 10, "X= %.2f" %v[0])
    lcd.text(10, 30, "Y= %.2f" %v[1])
    lcd.text(10, 50, "Z= %.2f" %v[2])
    time.sleep(0.5)

2021-02-18 13:46:44,150 - mu.logic:992(restore_session) INFO: Loaded files.
2021-02-18 13:46:44,150 - mu.logic:997(restore_session) INFO: User defined environment variables: []
2021-02-18 13:46:44,150 - mu.logic:1003(restore_session) INFO: Minify scripts on micro:bit? False
2021-02-18 13:46:44,196 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-18 13:46:44,325 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-18 13:46:51,334 - mu.modes.esp:211(toggle_files) INFO: Toggle filesystem on.
2021-02-18 13:46:53,457 - mu.modes.base:691(ls) ERROR: Could not enter raw REPL.
Traceback (most recent call last):
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\modes\base.py", line 688, in ls
    result = tuple(microfs.ls(self.serial))
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 185, in ls
    out, err = execute(["import os", "print(os.listdir())"], serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 139, in execute
    raw_on(serial)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 91, in raw_on
    flush_to_msg(serial, raw_repl_msg)
  File "C:\Users\Michael\AppData\Local\Mu\pkgs\mu\contrib\microfs.py", line 72, in flush_to_msg
    raise IOError("Could not enter raw REPL.")
OSError: Could not enter raw REPL.
2021-02-18 13:46:53,468 - mu.interface.main:886(show_message) DEBUG: There was a problem getting the list of files on the device. Please check Mu's logs for technical information. Alternatively, try unplugging/plugging-in your device and/or restarting Mu.
2021-02-18 13:46:53,468 - mu.interface.main:887(show_message) DEBUG: None
2021-02-18 13:46:59,222 - mu.modes.esp:215(toggle_files) INFO: Toggle filesystem off.
2021-02-18 13:47:01,174 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:47:01,175 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:47:01,212 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:47:01,218 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:47:01,218 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:47:01,218 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:47:01,218 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:01,225 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:01,240 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:47:01,247 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:47:01,249 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:01,252 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:01,254 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:47:01,256 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:47:01,259 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:47:01,262 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:47:01,264 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:01,267 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:47:01,269 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:47:01,272 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:01,280 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:01,282 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:47:01,285 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:47:01,287 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:47:01,289 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:47:01,305 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:47:01,326 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:47:01,328 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:47:01,344 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:47:01,347 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:47:01,350 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:01,353 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:01,355 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:47:01,358 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:47:06,033 - mu.modes.base:147(close) INFO: Closing connection to REPL on port: COM3
2021-02-18 13:47:06,158 - mu.modes.base:475(toggle_repl) INFO: Toggle REPL off.
2021-02-18 13:47:07,715 - mu.modes.esp:172(run) INFO: Running script.
2021-02-18 13:47:07,716 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-18 13:47:07,752 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-18 13:47:07,756 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-18 13:47:07,756 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-18 13:47:07,756 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'from m5stack import lcd\r', b'import imu\r', b'import time\r', b'\r', b'myIMU = imu.IMU()\r', b'lcd.font(lcd.FONT_DejaVu18)\r', b'\r', b'\r', b'while True:\r', b'\tlcd.clear()\r', b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r', b'\t#v = myIMU.acceleration\r', b'\tv = myIMU.gyro\r', b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r', b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r', b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r', b'\ttime.sleep(0.5)\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-18 13:47:07,756 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:07,763 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:07,765 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-18 13:47:07,767 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:47:07,769 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:07,771 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-18 13:47:07,773 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-18 13:47:07,776 - mu.modes.base:173(execute) INFO: Sending command b'from m5stack import lcd\r'
2021-02-18 13:47:07,779 - mu.modes.base:173(execute) INFO: Sending command b'import imu\r'
2021-02-18 13:47:07,781 - mu.modes.base:173(execute) INFO: Sending command b'import time\r'
2021-02-18 13:47:07,783 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:07,785 - mu.modes.base:173(execute) INFO: Sending command b'myIMU = imu.IMU()\r'
2021-02-18 13:47:07,788 - mu.modes.base:173(execute) INFO: Sending command b'lcd.font(lcd.FONT_DejaVu18)\r'
2021-02-18 13:47:07,790 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:07,793 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:07,795 - mu.modes.base:173(execute) INFO: Sending command b'while True:\r'
2021-02-18 13:47:07,797 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.clear()\r'
2021-02-18 13:47:07,800 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.orient(lcd.LANDSCAPE_FLIP)\r'
2021-02-18 13:47:07,802 - mu.modes.base:173(execute) INFO: Sending command b'\t#v = myIMU.acceleration\r'
2021-02-18 13:47:07,804 - mu.modes.base:173(execute) INFO: Sending command b'\tv = myIMU.gyro\r'
2021-02-18 13:47:07,806 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 10, "X= %.2f" %v[0])\r'
2021-02-18 13:47:07,809 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 30, "Y= %.2f" %v[1])\r'
2021-02-18 13:47:07,811 - mu.modes.base:173(execute) INFO: Sending command b'\tlcd.text(10, 50, "Z= %.2f" %v[2])\r'
2021-02-18 13:47:07,813 - mu.modes.base:173(execute) INFO: Sending command b'\ttime.sleep(0.5)\r'
2021-02-18 13:47:07,816 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:07,818 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-18 13:47:07,820 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-18 13:47:07,823 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-18 13:47:40,013 - mu.logic:1491(show_admin) INFO: Showing admin with logs from C:\Users\Michael\AppData\Local\python\mu\Logs\mu.log
2021-02-18 13:47:40,013 - mu.logic:201(installed_packages) INFO: Packages found: []
dybber commented 3 years ago

Thanks for reporting this, is the crc error2k and the question marks the only thing printed in the REPL?

@mhfalken and I had a video call yesterday, and I think we can add that it seems this problem only occurs in Mu, not when using e.g. Visual Studio Code and their extensions for interacting with M5Stack devices. Perhaps there's something we could learn from reading their code: https://github.com/curdeveryday/vscode-m5stack-mpy/blob/master/src/serialport.js

Currently I can't replicate the crc error2k-issue with the REPL on Mac OS X, but I can replicate the issue about M5Stack devices and not being able to open the file system pane. I will try to investigate further...

mhfalken commented 3 years ago

Yes, this is the only thing in the REPL when I press Run.

carlosperate commented 3 years ago

Entering the MicroPython raw REPL can fail depending on the user code, were the devices running something? We should definitely make it more robust, but to reduce factors that could be affecting this it'd be good to check first it still fails with no user code.

dybber commented 3 years ago

The M5Stack firmware runs a start-up script that's rather long running, initializing WiFi. Probably even interactive until some point, waiting for user to select what to do, I think.

So it's not even user code, it's just built-in when they ship these devices. When we execute user code, we do abort the current program with keyboard interrupts before executing the program:

https://github.com/mu-editor/mu/blob/52cb622575f60290318892c42ebc5a6a8e0665b9/mu/modes/base.py#L168-L189

carlosperate commented 3 years ago

The M5Stack firmware runs a start-up script that's rather long running, initializing WiFi. Probably even interactive until some point, waiting for user to select what to do, I think.

Can the REPL be accessed from boot.py? I thought it can't until the user code starts executing. How long does this take? Is it waiting for user interaction and therefore never letting the user code run?

When we execute user code, we do abort the current program with keyboard interrupts before executing the program:

Yes, but that can take several attempts, and in serial heavy programmes Mu might lock up a bit and somehow affect sending the commands as weel. Apart from that, if Mu is reading serial data to determine if the commands worked, like when it needs to transfer files, since it has to confirm the RAW REPL has been activated, the serial pipeline can be full of old user data and also affect the detection of the raw REPL; CTRL-B to exit string.

So many things can affect the process, so to identify the underlying problem it'd be better if we could test with a little else going on first, and then start introducing more things until it stops working.

dybber commented 3 years ago

The M5Stack firmware runs a start-up script that's rather long running, initializing WiFi. Probably even interactive until some point, waiting for user to select what to do, I think.

Can the REPL be accessed from boot.py? I thought it can't until the user code starts executing. How long does this take? Is it waiting for user interaction and therefore never letting the user code run?

I'm not sure what you mean "Can the REPL be accessed from boot.py?", but e.g. if you do print(something) in boot.py it will be printed to serial and shown in the Mu REPL-pane. The MicroPython REPL where user can enter their commands will first be made available after boot.py and main.py is executed.

It can take 30-60+ seconds for firmware on M5Stack devices or Edublocks to discover that it couldn't connect to WiFi. On M5Stack it seems like it's just trying indefinitely...

IMO we could perhaps wait 2 seconds for startup code to run, but not much more than that, and if it's not completed we should abort the start-up and go on with out business (list files or execute user code).

In my opinion M5Stack, Edublocks, etc. are abusing boot.py to do what should be part of application code (e.g. connecting to Wifi), and shouldn't be part of the boot process. However, we should at least try to let the boot process complete, for those devices who actually are well-behaved.

dybber commented 3 years ago

So many things can affect the process, so to identify the underlying problem it'd be better if we could test with a little else going on first, and then start introducing more things until it stops working.

I agree. @mhfalken could we get you to try running the same experiment as before, but with only a simple print("Hello world") programme and grab the logs one more time? Just to make sure none of your own code is interfering in anyway.

carlosperate commented 3 years ago

I'm not sure what you mean "Can the REPL be accessed from boot.py?", but e.g. if you do print(something) in boot.py it will be printed to serial and shown in the Mu REPL-pane. The MicroPython REPL where user can enter their commands will first be made available after boot.py and main.py is executed.

Yes, sorry, I meant if sending "ctrl+c" while boot.py was running would halt execution of boot.py and start the REPL. Sounds like "ctrl+c" to enter the REPL only works from main.py, right?

It can take 30-60+ seconds for firmware on M5Stack devices or Edublocks to discover that it couldn't connect to WiFi. On M5Stack it seems like it's just trying indefinitely...

Edublocks meaning https://edublocks.org ? Are they compatible with this device? Or are you referring to this problem with other devices as well?

IMO we could perhaps wait 2 seconds for startup code to run, but not much more than that, and if it's not completed we should abort the start-up and go on with out business (list files or execute user code).

I think 2 seconds from pressing something like the "files" button and the panel opening is a bit too long. I guess we if we do that we would have to show some kind of spinner or "connecting" view.

Btw, what does work while boot.py runs? If "ctrl+c" does nothing, do other shorcuts, like the soft reboot, work?

dybber commented 3 years ago

Yes, sorry, I meant if sending "ctrl+c" while boot.py was running would halt execution of boot.py and start the REPL. Sounds like "ctrl+c" to enter the REPL only works from main.py, right?

That was also my assumption, and I think I errorneously came to that conclusion in a previous issue/PR here on Github as well. But no, sending CTRL-C does abort any running boot.py scripts.

Edublocks meaning https://edublocks.org ? Are they compatible with this device? Or are you referring to this problem with other devices as well?

I only own M5Stack devices, not the Edublocks. The issue is however the same, as has been reported previously: https://github.com/mu-editor/mu/issues/985

IMO we could perhaps wait 2 seconds for startup code to run, but not much more than that, and if it's not completed we should abort the start-up and go on with out business (list files or execute user code).

I think 2 seconds from pressing something like the "files" button and the panel opening is a bit too long. I guess we if we do that we would have to show some kind of spinner or "connecting" view.

I just attempted the following: https://github.com/dybber/microfs/blob/3d51c22b5c2585c91b22ce4055a6a7c5f39ab14e/microfs.py#L104-L114

Where we:

This seems to work, and the timeout for serial.read_until is 1 seconds: https://github.com/dybber/microfs/blob/3d51c22b5c2585c91b22ce4055a6a7c5f39ab14e/microfs.py#L133 It does take a bit more than a second, but it will not introduce further delays for "well-behaved" devices.

It's still just a suggestion, it will need further scrutiny and checks on more devices.

mhfalken commented 3 years ago

I have now tried with the print("Hello world") and I get the same error on REPL as before. image

The log is here:

2021-02-19 15:56:25,345 - root:122(run) INFO: 

-----------------

Starting Mu 1.1.0.alpha.2
2021-02-19 15:56:25,347 - root:123(run) INFO: uname_result(system='Windows', node='Michaels-Legion', release='10', version='10.0.19041', machine='AMD64', processor='AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD')
2021-02-19 15:56:25,347 - root:124(run) INFO: Python path: ['C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs', 'C:\\Users\\Michael\\AppData\\Local\\Mu', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\python36.zip', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\DLLs', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python\\lib', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\Python', 'C:\\Users\\Michael\\AppData\\Local\\python\\mu\\site-packages', 'C:\\Users\\Michael\\AppData\\Local\\Mu\\pkgs\\IPython\\extensions']
2021-02-19 15:56:25,347 - root:125(run) INFO: Language code: en_DK
2021-02-19 15:56:25,503 - mu.logic:845(__init__) INFO: Setting up editor.
2021-02-19 15:56:25,503 - mu.logic:867(__init__) INFO: Settings path: C:\Users\Michael\AppData\Local\python\mu\settings.json
2021-02-19 15:56:25,503 - mu.logic:868(__init__) INFO: Session path: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-19 15:56:25,503 - mu.logic:869(__init__) INFO: Log directory: C:\Users\Michael\AppData\Local\python\mu\Logs
2021-02-19 15:56:25,503 - mu.logic:870(__init__) INFO: Data directory: C:\Users\Michael\AppData\Local\python\mu
2021-02-19 15:56:25,520 - mu.logic:884(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero
2021-02-19 15:56:25,913 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-19 15:56:25,918 - mu.logic:969(restore_session) INFO: Restoring session from: C:\Users\Michael\AppData\Local\python\mu\session.json
2021-02-19 15:56:25,918 - mu.logic:970(restore_session) DEBUG: {'theme': 'night', 'mode': 'esp', 'paths': ['C:\\Users\\Michael\\Documents\\Projects\\m5stack\\gyro-test.py'], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': 87, 'y': 118, 'w': 1448, 'h': 1167}}
2021-02-19 15:56:25,924 - mu.logic:1073(_load) INFO: Loading script from: C:\Users\Michael\Documents\Projects\m5stack\gyro-test.py
2021-02-19 15:56:25,929 - mu.logic:351(read_and_decode) DEBUG: Trying to decode with utf-8
2021-02-19 15:56:25,929 - mu.logic:354(read_and_decode) INFO: Decoded with utf-8
2021-02-19 15:56:25,930 - mu.logic:367(read_and_decode) DEBUG: Detected newline '\n'
2021-02-19 15:56:25,930 - mu.logic:1172(_load) DEBUG: from m5stack import lcd
import imu
import time

myIMU = imu.IMU()
lcd.font(lcd.FONT_DejaVu18)

while True:
    lcd.clear()
    lcd.orient(lcd.LANDSCAPE_FLIP)
    #v = myIMU.acceleration
    v = myIMU.gyro
    lcd.text(10, 10, "X= %.2f" %v[0])
    lcd.text(10, 30, "Y= %.2f" %v[1])
    lcd.text(10, 50, "Z= %.2f" %v[2])
    time.sleep(0.5)

2021-02-19 15:56:26,317 - mu.logic:992(restore_session) INFO: Loaded files.
2021-02-19 15:56:26,317 - mu.logic:997(restore_session) INFO: User defined environment variables: []
2021-02-19 15:56:26,317 - mu.logic:1003(restore_session) INFO: Minify scripts on micro:bit? False
2021-02-19 15:56:26,355 - mu.logic:1612(change_mode) INFO: Workspace directory: C:\Users\Michael\mu_code
2021-02-19 15:56:26,518 - mu.logic:833(check_usb) INFO: esp device connected on port: COM3(VID: 0x0403, PID: 0x6001, manufacturer: 'FTDI')
2021-02-19 15:56:30,161 - mu.logic:1057(new) INFO: Added a new tab.
2021-02-19 15:56:46,094 - mu.modes.esp:172(run) INFO: Running script.
2021-02-19 15:56:46,094 - mu.modes.base:123(open) INFO: Connecting to REPL on port: COM3
2021-02-19 15:56:46,131 - mu.modes.base:141(open) INFO: Connected to REPL on port: COM3
2021-02-19 15:56:46,135 - mu.modes.base:507(add_repl) INFO: Started REPL on port: COM3
2021-02-19 15:56:46,135 - mu.modes.base:478(toggle_repl) INFO: Toggle REPL on.
2021-02-19 15:56:46,136 - mu.modes.base:199(send_commands) INFO: [b'\x03', b'\x03', b'\x01', b'\x04', b'\x03', b'\x03', b'print("\\n");', b'print("Hello world")\r', b'\r', b'\r', b'\x04', b'\x02']
2021-02-19 15:56:46,136 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-19 15:56:46,142 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-19 15:56:46,146 - mu.modes.base:173(execute) INFO: Sending command b'\x01'
2021-02-19 15:56:46,148 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-19 15:56:46,150 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-19 15:56:46,152 - mu.modes.base:173(execute) INFO: Sending command b'\x03'
2021-02-19 15:56:46,154 - mu.modes.base:173(execute) INFO: Sending command b'print("\\n");'
2021-02-19 15:56:46,156 - mu.modes.base:173(execute) INFO: Sending command b'print("Hello world")\r'
2021-02-19 15:56:46,158 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-19 15:56:46,161 - mu.modes.base:173(execute) INFO: Sending command b'\r'
2021-02-19 15:56:46,163 - mu.modes.base:173(execute) INFO: Sending command b'\x04'
2021-02-19 15:56:46,166 - mu.modes.base:173(execute) INFO: Sending command b'\x02'
2021-02-19 15:56:57,512 - mu.logic:1491(show_admin) INFO: Showing admin with logs from C:\Users\Michael\AppData\Local\python\mu\Logs\mu.log
2021-02-19 15:56:57,512 - mu.logic:201(installed_packages) INFO: Packages found: []
aivarannamaa commented 3 years ago

Somebody has met similar error elsewhere, again related to os.listdir: https://community.m5stack.com/topic/2070/when-are-we-going-to-get-new-firmware/12

aivarannamaa commented 3 years ago

When meeting similar problems in Thonny, I start by checking, whether it goes away when I reduce the write block size or increase the delay between blocks.

Most boards/ports are rather fragile in this regard and it's easy to overfill the serial input buffer (sometimes because of bugs in the firmware, sometimes because something (eg. flushing a file) makes everything else stall for serveral seconds).

Besides raw REPL, where you need to wait "enough time" between each block written, I've tried paste mode (by using the echo as flow control) and the new raw-paste mode. Each of these modes fails with some devices, so for me, the serial communication (and also websocket communication with WebREPL) has been the most frustrating part of developing a MicroPython GUI.

dybber commented 3 years ago

Hi @aivarannamaa, thanks! I think you're right with experimenting with timing/delays, but it's a bit difficult when I can't replicate the issue myself.

Right now our delays in Mu are 2 milliseconds, which we could try to increase.

I think @mhfalken and I perhaps could try investigating it a bit over a video call, or wait until lockdown ends here in Denmark, and meet in person (we live around 20-25 km apart)

mhfalken commented 3 years ago

@dybber I am open for a debug session either online or later in person.

dybber commented 3 years ago

@dybber I am open for a debug session either online or later in person.

Great, I'll just write to you outside Github to try and schedule it

dybber commented 3 years ago

Okay, @mhfalken and I just had a longer debugging session, trying various things. It's very unpredictable and confusing, so we're not sure we actually learned anything from the debugging session other than we might point blame towards the M5Stack MicroPython firmware itself.

Firmware The M5Stack firmware version 1.7.2 doesn't seem to work either on Mu or with Thonny, at least for running code in the REPL.

It seems that the 1.7.2 version of the firmware has a boot-procedure that can't be disabled, unlike previous versions of their boot procedures which were in boot.py. We had better luck with 1.4.5.1 firmware from M5Stack, where we could modify boot.py to avoid it trying to log onto WiFi etc.

It also seems that they distribute different firmware depending on the model e.g. M5StickC vs M5 Core, even though they have the same name and version numbers. It's all very confusing.

Timing We tried changing the delay between commands send in the MicroPython mode, that is in the line QTimer.singleShot(2, remaining_task) in mu/modes/base.py. If @mhfalken changed it to 50 ms or 80 ms executing code through the "Run"-button still didn't work, if @mhfalken changed it to 100 ms or 120 ms it did work, however, if we increased it even further to 150 ms to 200 ms it stopped working again.

So we're a bit confused. Do we really need to delay it that much, 100 ms between every line send, seems like a lot - that's a second per 10 lines, or is something else at play? And why wouldn't it work if we increased the delay even further?

File system access Accessing the file system did seem to work in Thonny, but not in Mu.

We didn't play around with microfs.py and file system access, it seemed to work sporadically with the 1.4.5.1 firmware and not at all with the 1.7.2 version of the firmware.

Other @mhfalken have found an VSCode extension for interfacing with M5Stack's MicroPython devices, which seems to connect through their own protocol. That is, it doesn't communicate with the MicroPython REPL directly, instead with a MicroPython program running on the device. The code is here: https://github.com/curdeveryday/vscode-m5stack-mpy/blob/master/src/serialport.js