uPyLoader - simple file transfer and communication

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
profra
Posts: 39
Joined: Sat Jan 03, 2015 12:23 am

Re: uPyLoader - simple file transfer and communication

Post by profra » Mon Aug 22, 2016 12:57 pm

@Beta_Ravener
I tried new version still at work :D ... W10... but I had problems with flashing, program crashed, see the output...

Code: Select all

C:\VM_shared\z_git_inst\uPyLoader-master>python3 main.py
Traceback (most recent call last):
  File "C:\VM_shared\z_git_inst\uPyLoader-master\src\flash_dialog.py", line 101, in _update_output
    self.outputEdit.setPlainText(self._flash_output.decode('utf-8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 179: invalid start byte

C:\VM_shared\z_git_inst\uPyLoader-master>python3 main.py
Traceback (most recent call last):
  File "C:\VM_shared\z_git_inst\uPyLoader-master\src\flash_dialog.py", line 101, in _update_output
    self.outputEdit.setPlainText(self._flash_output.decode('utf-8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 100: invalid start byte
QWaitCondition: Destroyed while threads are still waiting

C:\VM_shared\z_git_inst\uPyLoader-master>
... some idea?

Beta_Ravener
Posts: 35
Joined: Tue Aug 09, 2016 6:56 pm

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Mon Aug 22, 2016 3:01 pm

Yeah, it means that esptool outputs some strange characters that can't be encoded into unicode (more specifically 0x80 and 0x90). As I didn't expect this to happen, there's unhandled exception that causes crash. The fix should be easy, I'm just wondering how those bytes can appear in the esptool's output (because they are even off standard ASCII table so console should have hard time interpreting them). Also another question is why I'm not seeing them. Do you have, by any chance, special characters like č,š,ť,... in path to either Python2 executable or firmware binary?

Anyway, I'll try to fix it and we can move the conversation to here: https://github.com/BetaRavener/uPyLoader/issues/6

profra
Posts: 39
Joined: Sat Jan 03, 2015 12:23 am

Re: uPyLoader - simple file transfer and communication

Post by profra » Mon Aug 22, 2016 6:14 pm

I am at home now... working on Linux Mint and have similar problems... look at picture... I have certainly no special characters in path only ASCII....
I don't know how to add picture... :lol: ...
...finally...wrong name :D

NOTE1: ...BUT esp8266 is flashed OK
NOTE2: ...Further communication on github
Attachments
pic_scan.png
pic_scan.png (228.53 KiB) Viewed 12130 times

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: uPyLoader - simple file transfer and communication

Post by Llwy » Mon Aug 22, 2016 8:04 pm

Dear Beta_Ravener,

Thank you for implementing this feature.
I also get the same encoding error:

Code: Select all

C:\Users\Llwynog\Documents\ESP\uPyLoader>python3 main.py
Traceback (most recent call last):
  File "C:\Users\Llwynog\Documents\ESP\uPyLoader\src\flash_dialog.py", line 101, in _update_output
    self.outputEdit.setPlainText(self._flash_output.decode('utf-8'))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 308: invalid continuation byte
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Best regards,
Llwy

Beta_Ravener
Posts: 35
Joined: Tue Aug 09, 2016 6:56 pm

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Mon Aug 22, 2016 11:29 pm

profra wrote:I am at home now... working on Linux Mint and have similar problems... look at picture... I have certainly no special characters in path only ASCII....
Ooops, actually the screen from your linux is showing another issue. I have, by mistake, hardcoded "COM3" port into rebooting routine that should bring ESP to normal working mode after flashing. But of course there is not such port on the Linux, so crash++. I have now fixed both issues, the errors in encoding should be silently ignored. It's hard to test if I can't reproduce it, so please report back if there are any more issues.

Llwy
Posts: 34
Joined: Thu Mar 10, 2016 7:43 am

Re: uPyLoader - simple file transfer and communication

Post by Llwy » Tue Aug 23, 2016 5:38 am

Thank you, works great on my side now.

askvictor
Posts: 24
Joined: Tue Mar 22, 2016 9:08 pm

Re: uPyLoader - simple file transfer and communication

Post by askvictor » Thu Oct 13, 2016 4:17 am

Hey @BetaRavener - nice to see someone else working in this space! I've been working on a fork of mu (https://github.com/eduvik/mu/tree/feature/multi-board) to support ESP8266 which has quite a bit of overlap with your project (all done in Python, PyQT5, REPL, file transfers). Perhaps we should exchange notes :) I'm currently having some issues with file transfers over the REPL; suspect it's thread related from using the QT websockets library :-/

gradoj
Posts: 27
Joined: Mon Aug 11, 2014 5:47 pm

Re: uPyLoader - simple file transfer and communication

Post by gradoj » Mon Mar 13, 2017 6:15 pm

I am trying to use uPyLoader with a uart but cannot get the file transfer scripts to the board. My build 1.8.7 does not include machine.UART which uPyLoader is dependent on. What is machine.UART - can I use pyb.UART? Cannot transfer files with rshell over UART reliably either.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: uPyLoader - simple file transfer and communication

Post by dhylands » Mon Mar 13, 2017 6:45 pm

With rshell over UART, specifying --buffer-size=32 usually makes things work much better.

Beta_Ravener
Posts: 35
Joined: Tue Aug 09, 2016 6:56 pm

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Fri Jun 09, 2017 6:15 pm

Hi, sorry for not replying I stopped monitoring this thread some time ago. The uPyLoader was intended for ESP8266, mainly because that's the only micropython capable device I have. These transfer scripts are used to create separate connection from REPL, through which the files are sent using simple protocol. The reason is that UART REPL is not very suitable for file transfers. My experience is that it was slow, parts of files didn't get transferred and so on.

To specifically address your issue - it should be possible to replace machine.UART with pyb.UART as long as the modules have read/write functions named the same (if so, I believe they will operate similarly). These scripts are just sitting in mcu folder in uPyLoader, so you should be able to change them and just reupload fixed version.

Post Reply