mpremote usage on windows

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
haybarry
Posts: 8
Joined: Mon Nov 07, 2016 10:16 am

mpremote usage on windows

Post by haybarry » Sun Jun 13, 2021 6:23 am

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

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: mpremote usage on windows

Post by stijn » Sun Jun 13, 2021 7:22 am

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.

haybarry
Posts: 8
Joined: Mon Nov 07, 2016 10:16 am

Re: mpremote usage on windows

Post by haybarry » Sun Jun 13, 2021 10:08 am

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

Post Reply