Page 1 of 1

mpremote usage on windows

Posted: Sun Jun 13, 2021 6:23 am
by haybarry
Hi,

Feeling stupid, but can't run mpremote from win64 laptop target RPi PICO.

Error message
File "c:\python39\lib\site-packages\mpremote\console.py", line 145, in set_conout_mode
fdout = os.open("CONOUT$", os.O_RDWR)
NameError: name 'os' is not defined

I can import os in REPL on laptop but something is missing here.

Thanks for any help

Barry

Re: mpremote usage on windows

Posted: Sun Jun 13, 2021 7:22 am
by stijn
It's a bug in mpremote: it is missin an 'import os' statement. I created an issue for it: https://github.com/micropython/micropython/issues/7390

As a a workaround for now, you could open console.py and insert 'import os' on line 145. Also if that works would be great if you could leave a comment in the github issue mentioned above. Or if you find other problems; seems likely no-one used this on windows yet.

Re: mpremote usage on windows

Posted: Sun Jun 13, 2021 10:08 am
by haybarry
Thank you.

That gets mpremote started on windows.

Now to work out how to terminate code running on the target (RPi PICO) without terminating mpremote ....


Barry