Page 3 of 6

Re: uPyLoader - simple file transfer and communication

Posted: Mon Aug 22, 2016 12:57 pm
by profra
@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?

Re: uPyLoader - simple file transfer and communication

Posted: Mon Aug 22, 2016 3:01 pm
by Beta_Ravener
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

Re: uPyLoader - simple file transfer and communication

Posted: Mon Aug 22, 2016 6:14 pm
by profra
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

Re: uPyLoader - simple file transfer and communication

Posted: Mon Aug 22, 2016 8:04 pm
by Llwy
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

Re: uPyLoader - simple file transfer and communication

Posted: Mon Aug 22, 2016 11:29 pm
by Beta_Ravener
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.

Re: uPyLoader - simple file transfer and communication

Posted: Tue Aug 23, 2016 5:38 am
by Llwy
Thank you, works great on my side now.

Re: uPyLoader - simple file transfer and communication

Posted: Thu Oct 13, 2016 4:17 am
by askvictor
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 :-/

Re: uPyLoader - simple file transfer and communication

Posted: Mon Mar 13, 2017 6:15 pm
by gradoj
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.

Re: uPyLoader - simple file transfer and communication

Posted: Mon Mar 13, 2017 6:45 pm
by dhylands
With rshell over UART, specifying --buffer-size=32 usually makes things work much better.

Re: uPyLoader - simple file transfer and communication

Posted: Fri Jun 09, 2017 6:15 pm
by Beta_Ravener
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.