Metro M0 Express: PuTTY works for serial, but Mu doesn't

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
NickSabaj
 
Posts: 6
Joined: Tue Jul 27, 2021 10:48 pm

Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by NickSabaj »

Started working with my first Metro M0 Express today, and I'm having a weird issue which I haven't found documentation for.

I'm using Mu to upload programs.
I modified main.py to just move a servo.
The program uploads ok, and the servo is moving as expected, but mu says no device connected.
Debugging with a print statement, PuTTY reads the serial without any trouble.

So, I'm not sure what's wrong with mu.
I'm using Windows 10, I haven't installed the Windows 7 or 8.1 drivers, and I don't know what the source of the problem could be.
I would just assume that plotter functionality wasn't working for Windows, but I haven't seen that documented, so I'm posting this in hopes of finding help.
PuTTY would be ok to use alone, but I'd really like to be able to use the Mu plotter.
Attachments
main.py
(1.36 KiB) Downloaded 5 times

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by mikeysklar »

@NickSabaj,

Based on your description it seems the version of Mu you are running is the next step.

Would you mind downloading and installing the 1.1.0b5 (beta release):

https://github.com/mu-editor/mu/releases

User avatar
NickSabaj
 
Posts: 6
Joined: Tue Jul 27, 2021 10:48 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by NickSabaj »

Hi again! Sorry for my delay in replying, especially after your prompt reply. Busy couple of days.

Unfortunately, I was already on the version of Mu you described. Log is shown below, embedded in a "code" block per convention.

Code: Select all

2021-08-02 12:18:34,649 - root:271(run) INFO: 

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

Starting Mu 1.1.0.beta.5
2021-08-02 12:18:34,650 - root:272(run) INFO: uname_result(system='Windows', node='CompyV2', release='10', version='10.0.19041', machine='AMD64', processor='Intel64 Family 6 Model 142 Stepping 12, GenuineIntel')
2021-08-02 12:18:34,650 - root:273(run) INFO: Platform: Windows-10-10.0.19041-SP0
2021-08-02 12:18:34,650 - root:274(run) INFO: Python path: ['C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\python38.zip', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\DLLs', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\setuptools-49.6.0-py3.8.egg', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\pip-20.2.2-py3.8.egg', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\win32', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\win32\\lib', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\Pythonwin', 'C:\\Users\\nicks\\AppData\\Local\\Programs\\Mu Editor\\Python\\lib\\site-packages\\IPython\\extensions']
2021-08-02 12:18:34,650 - root:275(run) INFO: Language code: en_US
2021-08-02 12:18:34,651 - mu.settings:220(load) WARNING: No settings file found at C:\Users\nicks\AppData\Local\python\mu\settings.json; skipping
2021-08-02 12:18:34,716 - mu.virtual_environment:585(ensure_and_create) INFO: Added log handler.
2021-08-02 12:18:34,716 - mu.virtual_environment:596(ensure_and_create) DEBUG: Checking virtual environment; attempt #1.
2021-08-02 12:18:34,717 - mu.virtual_environment:685(ensure_path) INFO: Virtual Environment found at: C:\Users\nicks\AppData\Local\python\mu\mu_venv-38-20210727-174435
2021-08-02 12:18:35,085 - mu.virtual_environment:698(ensure_interpreter) INFO: Interpreter found at: C:\Users\nicks\AppData\Local\python\mu\mu_venv-38-20210727-174435\scripts\python.exe
2021-08-02 12:18:35,086 - mu.virtual_environment:429(run_subprocess) INFO: Running ('C:\\Users\\nicks\\AppData\\Local\\python\\mu\\mu_venv-38-20210727-174435\\scripts\\python.exe', '-c', 'import sys; print("%s%s" % sys.version_info[:2])') with kwargs {}
2021-08-02 12:18:35,218 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 38
2021-08-02 12:18:35,219 - mu.virtual_environment:729(ensure_interpreter_version) INFO: Both interpreters at version 38
2021-08-02 12:18:35,228 - mu.virtual_environment:755(ensure_pip) INFO: Pip found at: C:\Users\nicks\AppData\Local\python\mu\mu_venv-38-20210727-174435\scripts\pip.exe
2021-08-02 12:18:35,228 - mu.virtual_environment:741(ensure_key_modules) DEBUG: Verifying import of: pgzero
2021-08-02 12:18:35,228 - mu.virtual_environment:429(run_subprocess) INFO: Running ('C:\\Users\\nicks\\AppData\\Local\\python\\mu\\mu_venv-38-20210727-174435\\scripts\\python.exe', '-c', 'import pgzero') with kwargs {}
2021-08-02 12:18:35,333 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2021-08-02 12:18:35,333 - mu.virtual_environment:741(ensure_key_modules) DEBUG: Verifying import of: flask
2021-08-02 12:18:35,333 - mu.virtual_environment:429(run_subprocess) INFO: Running ('C:\\Users\\nicks\\AppData\\Local\\python\\mu\\mu_venv-38-20210727-174435\\scripts\\python.exe', '-c', 'import flask') with kwargs {}
2021-08-02 12:18:35,815 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2021-08-02 12:18:35,815 - mu.virtual_environment:741(ensure_key_modules) DEBUG: Verifying import of: qtconsole
2021-08-02 12:18:35,815 - mu.virtual_environment:429(run_subprocess) INFO: Running ('C:\\Users\\nicks\\AppData\\Local\\python\\mu\\mu_venv-38-20210727-174435\\scripts\\python.exe', '-c', 'import qtconsole') with kwargs {}
2021-08-02 12:18:35,920 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2021-08-02 12:18:35,921 - mu.virtual_environment:741(ensure_key_modules) DEBUG: Verifying import of: esptool
2021-08-02 12:18:35,921 - mu.virtual_environment:429(run_subprocess) INFO: Running ('C:\\Users\\nicks\\AppData\\Local\\python\\mu\\mu_venv-38-20210727-174435\\scripts\\python.exe', '-c', 'import esptool') with kwargs {}
2021-08-02 12:18:36,066 - mu.virtual_environment:441(run_subprocess) DEBUG: Process returned 0; output: 
2021-08-02 12:18:36,066 - mu.virtual_environment:628(ensure_and_create) INFO: Valid virtual environment found at C:\Users\nicks\AppData\Local\python\mu\mu_venv-38-20210727-174435
2021-08-02 12:18:36,067 - mu.settings:169(save) DEBUG: Saving to C:\Users\nicks\AppData\Local\python\mu\venv.json
2021-08-02 12:18:36,158 - mu.logic:758(__init__) INFO: Setting up editor.
2021-08-02 12:18:36,158 - mu.logic:778(__init__) INFO: Log directory: C:\Users\nicks\AppData\Local\python\mu\Logs
2021-08-02 12:18:36,158 - mu.logic:779(__init__) INFO: Data directory: C:\Users\nicks\AppData\Local\python\mu
2021-08-02 12:18:36,158 - mu.logic:793(setup) INFO: Available modes: python, circuitpython, microbit, esp, web, pyboard, debugger, pygamezero, lego, pico
2021-08-02 12:18:36,159 - mu.modes.base:61(get_default_workspace) INFO: Using workspace C:\Users\nicks\mu_code from settings file
2021-08-02 12:18:36,250 - mu.modes.base:61(get_default_workspace) INFO: Using workspace C:\Users\nicks\mu_code from settings file
2021-08-02 12:18:36,250 - mu.logic:1523(change_mode) INFO: Workspace directory: C:\Users\nicks\mu_code
2021-08-02 12:18:36,250 - mu.logic:867(restore_session) DEBUG: <SessionSettings from C:\Users\nicks\AppData\Local\python\mu\session.json>
2021-08-02 12:18:36,257 - mu.logic:978(_load) INFO: Loading script from: D:\main.py
2021-08-02 12:18:36,257 - mu.logic:989(_load) INFO: The file D:\main.py does not exist.
2021-08-02 12:18:36,257 - mu.logic:889(restore_session) INFO: Loaded files.
2021-08-02 12:18:36,257 - mu.logic:892(restore_session) INFO: User defined environment variables: []
2021-08-02 12:18:36,257 - mu.logic:897(restore_session) INFO: Minify scripts on micro:bit? False
2021-08-02 12:18:36,287 - mu.modes.base:61(get_default_workspace) INFO: Using workspace C:\Users\nicks\mu_code from settings file
2021-08-02 12:18:36,318 - mu.interface.main:1024(show_message) DEBUG: Could not find an attached CircuitPython device.
2021-08-02 12:18:36,318 - mu.interface.main:1025(show_message) DEBUG: Python files for CircuitPython devices are stored on the device. Therefore, to edit these files you need to have the device plugged in. Until you plug in a device, Mu will use the directory found here:

 C:\Users\nicks\mu_code

...to store your code.
2021-08-02 12:18:38,916 - mu.logic:1523(change_mode) INFO: Workspace directory: C:\Users\nicks\mu_code
2021-08-02 12:18:39,295 - mu.logic:943(restore_session) INFO: Starting with blank file.
2021-08-02 12:18:43,904 - mu.logic:1396(show_admin) INFO: Showing admin with logs from C:\Users\nicks\AppData\Local\python\mu\Logs\mu.log
2021-08-02 12:18:43,904 - mu.virtual_environment:917(installed_packages) INFO: Discovering installed third party modules in venv.
2021-08-02 12:18:43,904 - mu.virtual_environment:114(run_blocking) INFO: About to run blocking C:\Users\nicks\AppData\Local\python\mu\mu_venv-38-20210727-174435\scripts\pip.exe with args ['list', '--disable-pip-version-check'] and envvars {}
2021-08-02 12:18:44,659 - mu.virtual_environment:164(wait) DEBUG: Finished: True; exitStatus 0; exitCode 0
2021-08-02 12:18:44,659 - mu.virtual_environment:249(run) DEBUG: Process output: Package           Version
----------------- -------
backcall          0.2.0
bitstring         3.1.7
cffi              1.14.5
click             8.0.1
colorama          0.4.4
BANNED      3.4.7
debugpy           1.3.0
decorator         5.0.9
ecdsa             0.17.0
esptool           3.1
Flask             1.1.2
ipykernel         6.0.1
ipython           7.25.0
ipython-genutils  0.2.0
itsdangerous      2.0.1
BANNED              0.18.0
Jinja2            3.0.1
jupyter-client    6.1.12
jupyter-core      4.7.1
MarkupSafe        2.0.1
matplotlib-inline 0.1.2
numpy             1.21.0
parso             0.8.2
pgzero            1.2.1
pickleshare       0.7.5
pip               21.1.2
prompt-toolkit    3.0.19
pycparser         2.20
pygame            2.0.1
Pygments          2.9.0
pyserial          3.5
python-dateutil   2.8.1
pywin32           301
pyzmq             22.1.0
qtconsole         4.7.4
QtPy              1.9.0
reedsolo          1.5.4
setuptools        57.0.0
six               1.16.0
tornado           6.1
traitlets         5.0.5
wcwidth           0.2.5
Werkzeug          2.0.1
wheel             0.36.2
2021-08-02 12:18:44,659 - mu.virtual_environment:926(installed_packages) INFO: []

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by mikeysklar »

@NickSabaj,

Going through the Mu github issues I'm not seeing a Mu issue specific to Win10/CircuitPython on the stable tree. Have you confirmed that same behavior with v1.0.3 (last stable from Jan 2020)

https://github.com/mu-editor/mu/tags

User avatar
NickSabaj
 
Posts: 6
Joined: Tue Jul 27, 2021 10:48 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by NickSabaj »

Ok, I switched to the version you suggested. It produced the following results.

In my first attempt, the following happens.
>Mu now displays messages from the REPL, any coding errors, and the ctrl+D to reload and any key to enter REPL text. The plotter also opens successfully.
>However, the print statement outputs from my program still aren't displayed in Mu, still displaying in PuTTY.
>In addition, though Mu now displays the "any key to enter REPL" message, clicking that serial panel and pressing keys didn't enter the REPL.

I closed Mu and PuTTY and unplugged my board, and began typing this up.
Then, I realized that I hadn't yet tested whether typing in the PuTTY terminal while Mu displayed the "any key" message would enter the REPL.
So, I plugged my board back in, opened PuTTY, and opened Mu. Things were printing in PuTTY, but now Mu wouldn't open its serial monitor.
I closed PuTTY, and then I think I restarted the board, went to bootloader restart, back to regular restart.
Then either the Mu serial monitor displayed the print statements immediately, or I restarted Mu and it worked. Maybe restarted Mu before restarting board.
I don't confidently remember the exact sequence of restarts I took, but it resulted in Mu displaying print statements.
Mu still doesn't enter REPL when typing.
I think I managed to enter the REPL in the 1.1.0b5 Mu before I changed Mu versions, but I can't be certain of that recollection.
In addition, I think I might have entered the 1.1.0b5 Mu editor at some point after installing the 1.0.3 editor, either before opening 1.0.3 or between 1.0.3 sessions.
The 1.1.0b5 opening was a mistake due to having it pinned in my taskbar; not sure whether that influenced the 1.0.3 sequence of observations.

I'll try to replicate my weird pattern of results again later today while taking contemporaneous notes on the sequence of actions and events.

For now, just posting this update; gotta go attend to other matters for a few hours.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by mikeysklar »

Okay, I appreciate the summary. It sounds like the order of operations is important.

[*] Do you open the Mu editor first or plugin the controller?

It also sounds like both versions of Mu work to some extent, but with varying limitations.

I think Putty might be causing an extra layer of confusion when your goal is to make the REPL work for both input and output over serial. It might be best to leave it out of some testing to reduce variables.

User avatar
NickSabaj
 
Posts: 6
Joined: Tue Jul 27, 2021 10:48 pm

Re: Metro M0 Express: PuTTY works for serial, but Mu doesn't

Post by NickSabaj »

Hi again; sorry for the delay since my last post. I've been busy getting ready for the next semester of school to begin, so I haven't yet done additional work on this troubleshooting.

I'll post again if I take the time to resolve the issue, but for now, since the system works enough for my purposes, I'm going to leave it as-is while I concentrate on testing my hardware's temperature and power consumption, since I now have the wrist and pantographic motors of my system moving on a basic level.

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”