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.
User avatar
c.man
Posts: 21
Joined: Thu Jul 06, 2017 9:12 pm

Re: uPyLoader - simple file transfer and communication

Post by c.man » Fri Jul 07, 2017 5:39 pm

wonderful !!!
work !!
I installed

sudo pip install simplejson

and I modified first line in src/setting.py:

from simplejson import JSONDecodeError

and now work !. Thanks !

eradicatore
Posts: 52
Joined: Thu Apr 20, 2017 9:19 pm

Re: uPyLoader - simple file transfer and communication

Post by eradicatore » Fri Jul 07, 2017 9:05 pm

So what is your version number of Python? You mentioned using python3, but oddly from this site it seems that JSONDecodeError should exist for python three:

https://www.peterbe.com/plog/jsondecode ... on-2-and-3

Let me raise the issue on github for uPyLoader and discuss the solution with the author.

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

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Sat Jul 08, 2017 6:31 pm

Hi. I'm not sure why you got the error, but my wild guess is that python3 is incorrect link and actually points to version 2. I have seen it happen few times and you can check that by actually invoking python3 in console (it should output python version in first few lines).

Anyway to prevent further problems, I'm changing the exception type to ValueError which is sufficient for the use case. Also, there is already an executable for Windows that should pack all requirements in correct versions and I hope that in near future I will be able to create one for Linux too. That should solve all setup problems for regular users.

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

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Sat Jul 08, 2017 8:28 pm

In fact, I managed to put that Linux executable together just now. I'd be glad if some Linux users could test it on their machines and report any problems. Got it working on my system but Linux environment is much more diverse than Windows. Releases with executables may be found here: https://github.com/BetaRavener/uPyLoader/releases.

iv3wjr
Posts: 1
Joined: Fri Nov 10, 2017 10:40 am
Location: Italy, Friuli-Venezia Giulia, Trieste

Re: uPyLoader - simple file transfer and communication

Post by iv3wjr » Fri Nov 10, 2017 10:50 am

Hi,
uPyLoader-linux seems the answer to my questions but I am not able to "Init transfer files":
From my Terminal window:

Traceback (most recent call last):
File "_boot.py", line 4, in <module>
File "flashbdev.py", line 1, in <module>
KeyboardInterrupt:
OSError: [Errno 1] EPERM
OSError: [Errno 1] EPERM

MicroPython v1.9.2-8-gbf8f45cf on 2017-08-23; ESP module with ESP8266
Type "help()" for more information.
>>>
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== #V1
=== from machine import UART
=== import time
===
=== def read_timeout(uart, cnt, retries=1000):
=== data = b""
=== for i in range(0, retries):
=== rec = uart.read(cnt - len(data))
=== if rec:
=== data += rec
=== if len(data) == cnt:
=== return data
=== time.sleep(0.01)
=== return None
===
=== def main():
=== uart = UART(0, 115200)
=== suc = False
=== with open("__upload.py", "wb") as f:
=== while True:
=== d = read_timeout(uart, 2)
=== if not d or d[0] != ord("#"):
=== x = uart.write(b"#2")
=== break
=== cnt = d[1] & 0x7F
=== if cnt == 0:
=== suc = True
=== break
=== d = read_timeout(uart, cnt)
=== if d:
=== esc = False
=== for c in d:
=== if c == 0:
=== esc = True
=== continue
=== x = f.write(bytes([c & 0x0F if esc else c]))
=== esc = False
=== x = uart.write(b"#1")
=== else:
=== x = uart.write(b"#3")
=== break
=== x = uart.write(b"#1#" if suc else b"#0#")
===
=== main()
===
Traceback (most recent call last):
File "<stdin>", line 44, in <module>
File "<stdin>", line 19, in main
OSError: [Errno 1] EPERM
>>> V1from machine import UARTimport timedef read_timeout(uart,file_name="__download.py"
... with open("__upload.py") as f:
... exec(f.read(), globals())
... V1from machine import UARTimport timedef read_timeout(uart
>>>
>>>
...and Init transfer file fails showing two "Error" windows with the message "File transfer failed". The two windows are stacked one upon the other.

Any idea on how to debug this issue?

Roberto

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

Re: uPyLoader - simple file transfer and communication

Post by Beta_Ravener » Fri Nov 10, 2017 6:58 pm

I haven't seen the EPERM error code before, but results on google suggest problem with filesystem. Probably flashing firmware again or choosing some older version might help?

On the other note, the transfer scripts are currently being rewritten to work with ESP32, so it may solve your issue even if it wasn't direct cause. I will notify you here on forum once the new version is ready (possibly this weekend).

ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Re: uPyLoader - simple file transfer and communication

Post by ajocius » Tue Jan 01, 2019 3:48 pm

Hey, trying uPyloader and am able to connect to ESP32 board via USB. I also wanted to try wifi connection. I do know IP address to my ESP32, but what port should I use? I left default port 8266, that was there after installing uPyLoader, but that gave me error message.Perhaps it is not that simple and some code must be insterted into boot.py or main.py first?

ajocius
Posts: 83
Joined: Mon Feb 19, 2018 6:31 am

Re: uPyLoader - simple file transfer and communication

Post by ajocius » Tue Jan 01, 2019 4:05 pm

just figured out myself, that I was missing webrepl installed. So added it to boot.py and trying to connect, however, still not successfully. Any other changes?

cyberlab
Posts: 56
Joined: Sat Apr 21, 2018 5:02 am

Re: uPyLoader - simple file transfer and communication

Post by cyberlab » Thu Jan 03, 2019 6:38 am

Hello, when installing micropython you need to activate webrepl, and by default it is active in acces point, check your available networks and you will see one that starts with ESP ... connect to it with the default password micropythoN, in upyloader select wifi port 8266 and ip by default 198.168.4.1 press connect ...

cyberlab
Posts: 56
Joined: Sat Apr 21, 2018 5:02 am

Re: uPyLoader - simple file transfer and communication

Post by cyberlab » Thu Jan 03, 2019 6:50 am

the first time you connect via usb, a message comes out that you need some files that are used to transfer files, select file ... init transfer files, transfer 2 files to your ESP32 once done this you can select any file from the window left (work folder) and select transfer

Post Reply