BetaRavener / uPyLoader

File transfer and communication tool for MicroPython boards
MIT License
355 stars 76 forks source link

What is the list of required modules for Micropython to cummunicate with uPyloader? #72

Closed wuhanstudio closed 5 years ago

wuhanstudio commented 5 years ago

Hello, recently I'm trying to use micropython on rt-thread, a burgeoning RTOS in China, through serial connection. Micropython has been released as a package on rt-thread and it works for now, while it failed to "Init transfer files" when I tried to use uPyloader to upload files, though "List Files" did work.

I think some modules required for mpy to communicate with uPyloader my be missing but I cannot figure it/them out.

Here's the list of available packages:

Could you please help me figure out what packages have to be enabled? Thanks sincerely for your time.

wuhanstudio commented 5 years ago

With uos and ubinascii enabled, I can do:

But still download (Transfer from pyboard to PC) is not working

QQ截图20190603143430

And the error code:

paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== file_name="hello.txt"
=== with open("__download.py") as f:
===     exec(f.read(), globals())
=== 
ceback (most recent call last):
  File "<stdin>", in <module>
  File "<stdin>", in <module>
  File "<string>", in <module>
  File "<string>", in _download
OSError: 0
>>> #2
BetaRavener commented 5 years ago

I've looked at the differences between __upload.py and __download.py since former is working while later is not, but there are not many differences. I suppose that ubinascii has symmetric functions so if a2b_base64 is supported, b2a_base64 is also. In that case, there's just line 25 & 26 which might cause issues: https://github.com/BetaRavener/uPyLoader/blob/master/mcu/download.py#L25 .

I can't try to make it work for you as I lack the device, but you can modify the transfer scripts by commenting out lines that seem problematic until you pinpoint the issue and the script executes (it may produce error later on due to changed behavior but that's fine). You can use Path to custom transfer scripts in the Settings to upload your edited transfer scripts or if you are running from source, simply editing scripts in mcu folder will work.

wuhanstudio commented 5 years ago

Thanks a lot for your help. It's lucky that the working one is upload which makes it easier to upload/test scripts.

If I manage to find a solution later, I'll post it here. Thanks again for your suggestion.