µPIDE a new IDE for beginners

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.
davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: µPIDE a new IDE for beginners

Post by davef » Thu Aug 19, 2021 8:23 pm

When I hit the green arrow to run a simple Micropyton script it appeared in the bottom box.

However, I just re-ran upide.exe hoping to get a screenshot ... now the program runs and the error message was no where to be seen!

The reason I wanted to use the Windows option is that I wanted to setup an IDE for my grandson.

Thanks for the support.

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Fri Aug 20, 2021 8:01 am

davef wrote:
Thu Aug 19, 2021 8:23 pm
When I hit the green arrow to run a simple Micropyton script it appeared in the bottom box.
Uhm, so the IDE was running? And you used it to start a PyQt5 script on the target? That isn't supposed to work at all. There is no PyQt on the target device.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: µPIDE a new IDE for beginners

Post by davef » Fri Aug 20, 2021 8:29 am

Yes, the IDE was running and no PyQt5 stuff anywhere in the scripts. I'll fire-it up again and run several of my Micropython projects to see I can provoke the error.

No errors. If it pops-up again I will try to gather more information.

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Sat Aug 21, 2021 10:47 am

davef wrote:
Fri Aug 20, 2021 8:29 am
If it pops-up again I will try to gather more information.
Yes, please. I have no explanation to what you report other than that you tried to run PyQt on the target itself.

And the use case with your grand children is exactly what I had in mind. So that's exactly what's supposed to work flawlessly ...

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Mon Oct 25, 2021 3:08 pm

The µPIDE is now nearly feature complete. There were various improvements and bug fixes in the meantime and I use it myself on a daily basis now while writing a Micropython beginners book for my kids.

The latest version is available at https://github.com/harbaum/upide/releases/latest

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Mon Oct 25, 2021 3:44 pm

BTW: There was the request to allow the user to explicitly specify a port rather than auto detecting it. For advanced users this definitely makes sense. But for beginners choosing a port may be rather confusing even with the very nice ability of the pyserial framework to provide speaking port names.

I have implemented this in a way that you can rename the binary to something like upide_noscan.[exe|py] and it'll then no more scan for ports but open a dialog to request the user to choose one from a list.

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Fri Feb 25, 2022 1:56 pm

jimmo wrote:
Thu Jul 08, 2021 7:40 am
FYI, are you aware of https://github.com/micropython/micropyt ... pyboard.py -- rather than maintain your own board remote control library. A lot of work has gone into making pyboard.py reliable and efficient.
I have now switched to pyboard.py. This actually made up- and download of big files possible on memory constraint devices. That's nice.

But I had to work around a bunch of small issues mostly by the fact that I'd like to deal nicely with all sorts of serial problems like the user trying to open something that's not MP board or unplugging it during use. But that was only minor, so no real problem there.

But the one thing I am really struggling with is the fact that reading data off the board is awfully slow under Windows while it works nice and smooth under Linux. It's pyboard.py's follow() function that runs ten times longer under Windows than under Linux for the same task on the same type of machine.

Is anyone else using pyboard.py under Windows? Did you encounter the same issue?

I suspect the fact that read_until() reads single bytes as the culprit. So I'll try to write some kind of caching wrapper around pyserial. I actually did something similar for my own board control routines. But I cannot tell if that coincidentally protected my from read performance issues.

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Fri Feb 25, 2022 4:33 pm

A caching wrapper around pyserial gives a ~5% improvement ... under Linux as well as under Windows 10. Unfortunately pyboard.py's fs_get is still ~5 times slower under Win10 than under Linux. And it's purely pyboard.py related. My own old code runs the same speed as Linux on that same Win10 PC.

MasterOfGizmo
Posts: 50
Joined: Sun Nov 29, 2020 8:17 pm

Re: µPIDE a new IDE for beginners

Post by MasterOfGizmo » Sun Feb 27, 2022 10:44 am

Finally I found the culprit of the low performance under Windows: Pyserials inWaiting() function is extremely slow on Windows 10 and the pyboard.py makes excessive use of that. So I implemented a little buffer between pyboard.py and pyserial which buffers and caches serial data. It will thus reduce the necessary calls to inWaiting() and thus brings read performance back again.

Summary: µPIDE now uses pyboard.py for remote control communication at the same performance it did before. On the plus side is a more reliable communication especially when transferring big files from and to memory restricted devices or devices that have a fast USB serial interface.

Find the latest release at https://github.com/harbaum/upide/releases/tag/V1.1.1

Post Reply