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.42k stars 438 forks source link

File System Navigator vs WinnerMicro W600-PICO board #1052

Closed federicomm closed 4 years ago

federicomm commented 4 years ago

1_W600-PICO_mu_editor_esp_mode 2_mu_FSN_W600 3_0_1_mu_w600_issue 3_0_2_mu_w600_issue_code 3_2_W600_mu_Files_ERROR_1 4_mu_w600_FSN_ok1 5_Mu_W600_FSN_getting Hi, first of all I want to express my appreciation and gratitude for the great work of the Mu team. Thanks.

Issue for W600-PICO : Unable to list the board & local dir(mu-code) files in the Mu File System Navigator UI panes.

Mu 1.1.0.alpha.2 installed on Windows 10 ( see the mu.log attachment for more details)

Mu mode : ESP MCU board :Winner MIcro W600-PICO

!!! All others Mu UI functionalities are OK on WinnerMicro W600-PICO

If I am right the following correct (*) line of code is the cause of the problem on W600-PICO board:

mu-master\mu\contrib\microfs.py", line 185, in ls out, err = execute(["import os", "print(os.listdir())"], serial)

To be sure of the above I proceeded to disable by # the line of code in question in a subsequent test thus having the disappearance of the error message.

Perhaps the function : def ls(serial = None) in the microfs.py module, correct for the esp boards, must be integrated with code suitable for the W600

(*)Remark : I have tested the same File System Navigator functionality on ESP8266 board without any problem except: a- the fs dirs cannot be opened in order to access the files contained in them b- I am unable to load fs files on editor pane while it is possible from the local dir pane

To give you more information see the pictures( in one of them I have simulated the correct FSN behavior substituting the code instruction with the expected tuple ) and the following partial mu.log attachment .

2020-06-01 08:27:26,952 - root:122(run) INFO:


Starting Mu 1.1.0.alpha.2 2020-06-01 08:27:26,952 - root:123(run) INFO: uname_result(system='Windows', node='federico', release='10', version='10.0.17134', machine='AMD64', processor='Intel64 Family 6 Model 69 Stepping 1, GenuineIntel') 2020-06-01 08:27:26,952 - root:124(run) INFO: Python path: ['C\Users\federico\ESP32_uPython\mu-master', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\python37.zip',

2020-06-01 08:27:27,171 - mu.logic:682(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero

====-======== etc ================

2020-06-01 08:27:27,608 - mu.logic:1379(change_mode) INFO: Workspace directory: C:\Users\federico\mu_code 2020-06-01 08:27:27,671 - mu.logic:813(restore_session) INFO: Starting with blank file. 2020-06-01 08:27:36,405 - mu.logic:1332(select_mode) INFO: Showing available modes: ['python', 'circuitpython', 'microbit', 'esp', 'web', 'debugger', 'pygamezero'] 2020-06-01 09:04:47,356 - mu.modes.base:269(find_device) INFO: Found device on port: COM15 2020-06-01 09:04:47,356 - mu.modes.base:270(find_device) INFO: Serial number: 2020-06-01 09:04:47,371 - mu.modes.base:327(add_repl) INFO: Started REPL on port: COM15 2020-06-01 09:04:47,371 - mu.modes.base:307(toggle_repl) INFO: Toggle REPL on. 2020-06-01 09:04:54,105 - mu.modes.base:304(toggle_repl) INFO: Toggle REPL off. 2020-06-01 09:04:55,168 - mu.modes.esp:210(add_fs) INFO: Add the file system navigator to the UI. fm debug 2020-06-01 09:04:55,183 - mu.modes.base:269(find_device) INFO: Found device on port: COM15 2020-06-01 09:04:55,183 - mu.modes.base:270(find_device) INFO: Serial number: 2020-06-01 09:04:55,183 - mu.modes.esp:199(toggle_files) INFO: Toggle filesystem on. 2020-06-01 09:04:55,183 - mu.modes.base:443(on_start) INFO: Create a new serial connection to COM15 -fm 2020-06-01 09:04:55,246 - mu.modes.base:458(ls) ERROR: Could not enter raw REPL. Traceback (most recent call last): File "C:\Users\federico\ESP32_uPython\mu-master\mu\modes\base.py", line 455, in ls result = tuple(microfs.ls(self.serial)) File "C:\Users\federico\ESP32_uPython\mu-master\mu\contrib\microfs.py", line 185, in ls out, err = execute(["import os", "print(os.listdir())"], serial) File "C:\Users\federico\ESP32_uPython\mu-master\mu\contrib\microfs.py", line 139, in execute raw_on(serial) File "C:\Users\federico\ESP32_uPython\mu-master\mu\contrib\microfs.py", line 91, in raw_on flush_to_msg(serial, raw_repl_msg) File "C:\Users\federico\ESP32_uPython\mu-master\mu\contrib\microfs.py", line 72, in flush_to_msg raise IOError("Could not enter raw REPL.") OSError: Could not enter raw REPL. 2020-06-01 09:04:55,277 - mu.interface.main:944(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.

If you are reporting a bug, we would like to know:

Please remember to attach a copy of the full log files for Mu. You can get the logs by clicking on the cog icon in the bottom right of the editor window. Click on the logs and use CTRL-A to select all, then CTRL-C to copy and CTRL-V to paste the contents into the issue.

Thank you for contributing to Mu! :-)

federicomm commented 4 years ago

Mu_FSN_W600_OK 2020-06-05 22:22:57,949 -

I have found a solution . Inspect the picture and the log file. The raw_on(serial) function in microfs.py, for the trial, has been substituted by the enter_raw_repl(serial) cloned from a modified ( for W600 boards) pyboard.py file ( author Volodomjr Shjmanskyy). That's all. -------- mu.log ----- root:122(run) INFO:


Starting Mu 1.1.0.alpha.2 2020-06-05 22:22:57,949 - root:123(run) INFO: uname_result(system='Windows', node='Monaldi', release='10', version='10.0.17134', machine='AMD64', processor='Intel64 Family 6 Model 69 Stepping 1, GenuineIntel') 2020-06-05 22:22:57,949 - root:124(run) INFO: Python path: ['C:\Users\federico\ESP32_uPython\mu-master', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\python37.zip', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\DLLs', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32', 'C:\Users\federico\AppData\Roaming\Python\Python37\site-packages', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib\site-packages', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32\lib', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Pythonwin', 'C:\Users\federico\AppData\Local\python\mu\site-packages', 'C:\Users\federico\AppData\Local\Programs\Python\Python37-32\lib\site-packages\IPython\extensions'] 2020-06-05 22:22:57,949 - root:125(run) INFO: Language code: it_IT 2020-06-05 22:22:58,090 - mu.logic:644(init) INFO: Setting up editor. 2020-06-05 22:22:58,090 - mu.logic:666(init) INFO: Settings path: C:\Users\federico\AppData\Local\python\mu\settings.json 2020-06-05 22:22:58,090 - mu.logic:667(init) INFO: Session path: C:\Users\federico\AppData\Local\python\mu\session.json 2020-06-05 22:22:58,090 - mu.logic:668(init) INFO: Log directory: C:\Users\federico\AppData\Local\python\mu\Logs 2020-06-05 22:22:58,090 - mu.logic:669(init) INFO: Data directory: C:\Users\federico\AppData\Local\python\mu 2020-06-05 22:22:58,168 - mu.logic:682(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, debugger, pygamezero 2020-06-05 22:22:58,559 - mu.logic:1379(change_mode) INFO: Workspace directory: C:\Users\federico\mu_code 2020-06-05 22:22:58,559 - mu.logic:746(restore_session) INFO: Restoring session from: C:\Users\federico\AppData\Local\python\mu\session.json 2020-06-05 22:22:58,559 - mu.logic:747(restore_session) DEBUG: {'theme': 'night', 'mode': 'esp', 'paths': [], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': -1, 'y': -8, 'w': 1366, 'h': 705}} 2020-06-05 22:22:58,559 - mu.logic:768(restore_session) INFO: Loaded files. 2020-06-05 22:22:58,559 - mu.logic:773(restore_session) INFO: User defined environment variables: [] 2020-06-05 22:22:58,559 - mu.logic:779(restore_session) INFO: Minify scripts on micro:bit? False 2020-06-05 22:22:58,606 - mu.logic:1379(change_mode) INFO: Workspace directory: C:\Users\federico\mu_code 2020-06-05 22:22:58,684 - mu.logic:813(restore_session) INFO: Starting with blank file. 2020-06-05 22:23:04,512 - mu.modes.base:269(find_device) INFO: Found device on port: COM15 2020-06-05 22:23:04,512 - mu.modes.base:270(find_device) INFO: Serial number: 2020-06-05 22:23:04,527 - mu.modes.esp:199(toggle_files) INFO: Toggle filesystem on. 2020-06-05 22:23:43,275 - mu.interface.panes:478(dropEvent) INFO: Getting 'rgb_hex.py' from micro:bit. Copying to 'C:\Users\federico\mu_code\rgb_hex.py'. 2020-06-05 22:24:21,522 - mu.modes.esp:203(toggle_files) INFO: Toggle filesystem off. 2020-06-05 22:24:22,584 - mu.modes.base:269(find_device) INFO: Found device on port: COM15 2020-06-05 22:24:22,584 - mu.modes.base:270(find_device) INFO: Serial number: 2020-06-05 22:24:22,600 - mu.modes.base:327(add_repl) INFO: Started REPL on port: COM15 2020-06-05 22:24:22,600 - mu.modes.base:307(toggle_repl) INFO: Toggle REPL on. 2020-06-05 22:25:30,212 - mu.logic:1242(quit) DEBUG: Session: {'theme': 'night', 'mode': 'esp', 'paths': [], 'envars': [], 'minify': False, 'microbit_runtime': '', 'zoom_level': 2, 'window': {'x': -1, 'y': -8, 'w': 1366, 'h': 705}} 2020-06-05 22:25:30,212 - mu.logic:1243(quit) DEBUG: Saving session to: C:\Users\federico\AppData\Local\python\mu\session.json 2020-06-05 22:25:30,212 - mu.logic:1257(quit) INFO: Quitting.