W600-PICO vs Mu 1.1.0.alpha2 editor

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

W600-PICO vs Mu 1.1.0.alpha2 editor

Post by federico » Mon Jun 08, 2020 11:56 am

Info for W600-PICO owner that want to use or experiment Mu 1.1.0.alpha.2

https://github.com/mu-editor/mu/issues/1052

On github I have opened ( and closed after few days) the following. issue:

File System Navigator vs WinnerMicro W600-PICO board #1052

The software solution is shortly described below .
( With the attached modified microfs.py file and pyboard.py. - a modified solution by Volodymyr Shymanskyy to enable Adafruit ampy to work by raw REPL with W600 boards - we can have all the elements to follow the explanation )
For my trials, the default raw_on(serial) function in microfs.py, has been substituted by the enter_raw_repl(serial) cloned from a modified ( for W600 boards) pyboard.py file (from my search the author should be Volodymyr Shymanskyy).
I only have adapted the enter_raw_repl() function to the microfs.py code context ( for example substituting the PyboardError with IOError, etc, ...) and :

a- In the microfs.py ls(serial) function , to remove the spurious b"\n>OK" I have added after the line:

out, err = execute(["import os", "print(os.listdir())"], serial)

the following instruction:
out = out.lstrip(b"\n>OK")

b- and in :
execute(commands, serial=None)

I have commented the raw_on(serial) and added the cloned enter_raw_repl(serial ):
#raw_on(serial) # default raw REPL function
enter_raw_repl(serial) # from pyboard.py modified by WS

( see the attachments )

Remarks: This is only a positive trial , the optimal code solution can be surely different)

I have also tested the solution with an ESP8266 board without nothing any functionality difference.

On the WEB, to visually show what I have described, I have placed. the following short video:

W600-PICO vs Mu 1.1.0.alpha.2. Micropython Editor

That's all.
Attachments
5_Mu_Files_W600-PICO_a.PNG
5_Mu_Files_W600-PICO_a.PNG (104.1 KiB) Viewed 4204 times
3_Mu_raw_repl_in REPL_shell.png
3_Mu_raw_repl_in REPL_shell.png (134.87 KiB) Viewed 4204 times
2_Mu_Files_OSError_3.PNG
2_Mu_Files_OSError_3.PNG (105.56 KiB) Viewed 4204 times

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by federico » Thu Jun 11, 2020 3:27 pm

Just to specify that the video showing the code modifications to microfs.py module is W600-PICO vs Mu 1.1.0.alpha.2 & code

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by federico » Sun Jun 14, 2020 1:00 pm

From one of my previous post on this forum:
viewtopic.php?f=12&t=7652&start=10

Re: Wemos W600-Pico
Post Mon Apr 13, 2020 6:31 am

"
A precondition to work minimizing the problems with uPyCraft is of flashing the last micropython firmware( file wm_w600.fls) for W600-PICO in place of the default one on the board, following the Shymanskyy procedure. In the same dir where we have the w600tool.py copy the last micropython firmware file wm_w600.fls and :

1st - erase the flash with (**):
python ./w600tool.py -p COM15 -b 115200 -e
2nd - upload the fls file:
python ./w600tool.py -p COM15 -b 115200 --upload wm_w600.fls

(**) or with the w600tool.exe

To download un new firmware we need to use the Volodymyr Shymanskyy w600tool ( Python or Windows version) that can be downloaded from github.
"

Note:
COMxx with Windows OS
/dev/ttyUSB0 with Linux

was suggested before to work with uPyCraft.

Well, the same thing must be done to avoid any problem with Mu editor.

I want to remark this point because one w600-pico user, watching on the WEB the video(*) mentioned in my previous post (W600-PICO vs Mu 1.1.0.alpha.2. Micropython Editor) ask me:

"Hi Federico,
Could you kindly explain in a bit more detail how to implement the modifications?
Thank you.
Regards,
Hxxxx"

Hxxxx, after to have modified the microfs.py module :

"....
I have flashed the firmware several times on different boards leading to the same results.
I also notice strange files ( libraries ??) on the board.
I have included screenshots.
If you have any suggestions please let me know "

And the screenshot that I received ( see the attachment Screenshot_mu.png) shows me the same image that I have on uPyCraft before to have reflashed the board - shortly the same issue.

This is the reason of this new post regarding the use of Mu 1.1.0.alpha.2 micropyton editor vs W600-PICO.

After to have erased the flash and flashed the last update micropython release that can be downloaded. from:

https://github.com/robert-hh/Shared-Stu ... m_w600.fls

( my persomal thanks to robert-hh to have included the User free flash size in the ls command)

I received the following message :
"
Hi Federico,
Good results thanks to your help.
The latest Firmware definitely works better.
You are absolutely right, I needed to erase the memory with : python ./w600tool.py -p /dev/ttyUSB0 -e
before flashing with the new firmware.
.......
I can finally start to play with some code ...
Many thanks to you for your patience and explanations.
Have a great Sunday,
Regards,

Hxxxx
"
In the Hxxxx attachments the results after to have reflashed the board.

(*)And for this reason I posted a more detailed video on the WEB - the second one mentioned in my previous post, to make more clear what must be done to correctly work with Mu micropyt
Attachments
yeah_4.png
yeah_4.png (174.7 KiB) Viewed 4099 times
yeah_3.png
yeah_3.png (91.95 KiB) Viewed 4099 times
Screenshot_mu.png
Screenshot_mu.png (157.26 KiB) Viewed 4099 times

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by Roberthh » Sun Jun 14, 2020 7:01 pm

I have update the fls files for the W600 at this place: https://github.com/robert-hh/Shared-Stuff. Compared to the May 26 version, there are a few changes, listed in the commit description. For more details, the repository branch is here: https://github.com/robert-hh/micropython/tree/w60x

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by federico » Mon Jun 15, 2020 6:47 am

A new thank you roberthh for your timely clarification and mainly for the contribution you make to the micropython community.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by Roberthh » Mon Jun 15, 2020 8:18 am

Thanks, but that's not only me. Most of the work had been done by @wdyichen, who made the initial port. And the latest changes to the machine.pin module have been contributed by @etobi. I see my part as just smoothing some rough edges.

federico
Posts: 34
Joined: Tue Feb 07, 2017 11:34 pm

Re: W600-PICO vs Mu 1.1.0.alpha2 editor

Post by federico » Mon Jun 15, 2020 2:10 pm

I fully share your observation. My thanks, although indirect, go to all those who on stage or behind the scenes help us with their work

Post Reply