ESPLORER unable to run a proper main.py file ...

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESPLORER unable to run a proper main.py file ...

Post by Roberthh » Wed Nov 23, 2016 7:17 pm

but how to upload a file on my ESP8266?
Hello @Bigman. I just gave rshell a try, One started, you have to connect it:

Code: Select all

connect serial /dev/ttyUSB0 115200
The you can use the commands like ls and cp. The esp8266 files are at the virtual director /pyboard, even if it is not a pyboard. So to see them, type

Code: Select all

ls /pyboard
To copy files, use for instance

Code: Select all

cp myfile.py /pyboard/myfile.py
to change into the esp's file system, enter:

Code: Select all

cd /pyboard

ym58
Posts: 3
Joined: Tue Nov 08, 2016 6:38 pm

Re: ESPLORER unable to run a proper main.py file ...

Post by ym58 » Wed Nov 23, 2016 7:33 pm

ernitron wrote:I understand that you "really" want ESPlorer to work with micropython. You should probably contact the author of the program https://esp8266.ru/esplorer/
As far as I can tell it is NOT working properly with micropython. To me is a deprecated tool that should not be considered for micropython development. If you manage to get it working please inform the forum of the current status. I will reconsider my position.
Your stance is quite clear and I agree 100% with you.
What is tricky here is that Esplorer claims to be compliant with Lua 'AND' Python ... that's confusing and has misled me.

User avatar
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: ESPLORER unable to run a proper main.py file ...

Post by ernitron » Wed Nov 23, 2016 7:40 pm

ym58 wrote:
ernitron wrote:I understand that you "really" want ESPlorer to work with micropython. You should probably contact the author of the program https://esp8266.ru/esplorer/
As far as I can tell it is NOT working properly with micropython. To me is a deprecated tool that should not be considered for micropython development. If you manage to get it working please inform the forum of the current status. I will reconsider my position.
Your stance is quite clear and I agree 100% with you.
What is tricky here is that Esplorer claims to be compliant with Lua 'AND' Python ... that's confusing and has misled me.
Sorry ym58 my reply was to BigMan. My apologies for not having quoted him so it was not clear to whom I was replying.

I understand that a pretty GUI like ESPlorer would be invaluable. Actually I did use a lot with NodeMCU and LUA.

Personally I find that CLI and a simple terminal is far more better (and productive) to any GUI. I appreciate Robert efforts to help. My statement was just to say that probably we should contact the author of ESPlorer and ask him what is the current status of support for micropython.

Again sorry for the misunderstanding ;)

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

Re: ESPLORER unable to run a proper main.py file ...

Post by dhylands » Tue Nov 29, 2016 12:14 am

BigMan wrote:update: okay, an upload of a file from ESplorer to the ESP8266 is really not working fine. Although ESPlorer wrote a file to the ESP8266 it was empty (I checked with f=open('<filename>'), f.read() -> Results '').

So I gave rshell a try: well I can connect to my ESP8266 and even access repl ... but how to upload a file on my ESP8266? https://github.com/dhylands/rshell speaks about copying files to /flash ... can it be that rshell only works with the pyboard? I don't have the pyboard. I'm working with a "bare" ESP8266 .... so rshell is dead. Also Pymakr, which even after two days I couldn't install on my Arch Linux system.
rshell should work anyplace that pyboard.py works. It requires that MicroPython be flashed on the board (so its not going to work with a "bare" ESP8266.

I haven't personally tried the esp8266 version of MicroPython myself, so I don't know if rshell works or not. rshell has a boards command to show the connected boards and what their root directory filenames are. You'd use whatever that shows in place of /flash (I don't know if /flash is correct for the esp8266 or not).

You should also be able to use:

Code: Select all

import uos
uos.listdir('/')
to determine the names of the root directories. If none show up, then you need to resolve that before rshell will be able to copy files anyplace.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESPLORER unable to run a proper main.py file ...

Post by Roberthh » Tue Nov 29, 2016 8:03 am

@bigman. The tools foreseen with eps8266 are webrepl and it's up- and download options. You have to set-up webrepl first through the USB link (import webrepl-setup), then connect to esp8266 by wifi, and then you can use it with a web browser of your choice.
I tried rshell with my esp8266 models (see post above), and it worked. The esp8266 file system is visible at the directory name /pyboard.
I would not try pymakr. It's a closed box design, and if anything fails, you cannot tell why. It's designed for a debian based linux, and even there it's not free of surprises - to be polite.

Lornioiz
Posts: 36
Joined: Wed Aug 03, 2016 11:39 am
Location: Florence, Italy

Re: ESPLORER unable to run a proper main.py file ...

Post by Lornioiz » Tue Nov 29, 2016 10:01 am

BigMan wrote:update: okay, an upload of a file from ESplorer to the ESP8266 is really not working fine. Although ESPlorer wrote a file to the ESP8266 it was empty (I checked with f=open('<filename>'), f.read() -> Results '').

So I gave rshell a try: well I can connect to my ESP8266 and even access repl ... but how to upload a file on my ESP8266? https://github.com/dhylands/rshell speaks about copying files to /flash ... can it be that rshell only works with the pyboard? I don't have the pyboard. I'm working with a "bare" ESP8266 .... so rshell is dead. Also Pymakr, which even after two days I couldn't install on my Arch Linux system.
If you are looking for a way to upload the file in the board, ampy should do.
I use in windows, ubuntu and macosx and it works very well.
You can use it to delete file and execute them as well.

User avatar
rcolistete
Posts: 352
Joined: Thu Dec 31, 2015 3:12 pm
Location: Brazil
Contact:

Re: ESPLORER unable to run a proper main.py file ...

Post by rcolistete » Tue Nov 29, 2016 10:56 am

Thanks @Roberthh for the tip about "/pyboard" virtual folder to see the "/" of ESP8266.
dhylands wrote:I haven't personally tried the esp8266 version of MicroPython myself, so I don't know if rshell works or not. rshell has a boards command to show the connected boards and what their root directory filenames are. You'd use whatever that shows in place of /flash (I don't know if /flash is correct for the esp8266 or not).
@dhylands, rshell works very well with ESP8266, on Linux :

Code: Select all

$ rshell -p /dev/ttyUSB0 -b 115200
Inside rshell, ESP8266 root folder (internal flash) is seen as "/pyboard", as first told by @Roberthh :

Code: Select all

> boards
pyboard @ /dev/ttyUSB0 connected Dirs: /boot.py /pyboard/boot.py
> ls -l /pyboard/
   160 Jan  1 2000  boot.py
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

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

Re: ESPLORER unable to run a proper main.py file ...

Post by dhylands » Tue Nov 29, 2016 5:53 pm

Interesting. So it works by accident.

The /pyboard stuff was intended to support multiple Micropython boards being connected at the same time. They would each show up under /pyboard/BOARDNAME and the very first board allows for an empty board name. It looks like the ESP8266 just has everything in the root directory.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESPLORER unable to run a proper main.py file ...

Post by Roberthh » Tue Nov 29, 2016 7:09 pm

Seems so. It is a little bit confused since it shows every file in the root directory as subdirectory. Example:

Code: Select all

robert@DELL-HH:~$ rshell -p /dev/ttyUSB0 -b 115200
Connecting to /dev/ttyUSB0 ...
Welcome to rshell. Use Control-D to exit.
/home/robert> boards
pyboard @ /dev/ttyUSB0 connected Dirs: /boot.py /station.py /main.py /test_dl.py /port_config.py /junk.jpg /utelnetserver.mpy /utelnetserver.py /test_dl2.py /client.py /pesp8266.py /toggle.py /ftp.mpy /test.py /shuffle.py /aicwebpage.htm /aicwebserver.py /pyboard/boot.py /pyboard/station.py /pyboard/main.py /pyboard/test_dl.py /pyboard/port_config.py /pyboard/junk.jpg /pyboard/utelnetserver.mpy /pyboard/utelnetserver.py /pyboard/test_dl2.py /pyboard/client.py /pyboard/pesp8266.py /pyboard/toggle.py /pyboard/ftp.mpy /pyboard/test.py /pyboard/shuffle.py /pyboard/aicwebpage.htm /pyboard/aicwebserver.py
/home/robert> ls /pyboard
aicwebserver.py   pesp8266.py       test.py           utelnetserver.py  utelnetserver.mpy
boot.py           port_config.py    test_dl.py        aicwebpage.htm   
client.py         shuffle.py        test_dl2.py       ftp.mpy          
main.py           station.py        toggle.py         junk.jpg         

But: trying to edit a file and saving it back killed the file system. Conclusion: Not recommended at the moment.

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

Re: ESPLORER unable to run a proper main.py file ...

Post by dhylands » Tue Nov 29, 2016 7:39 pm

For anything that uses a real serial port, and I'm pretty sure that the esp8266 is in this camp, you should specify a smallish buffer size like --buffer-size=32

This impacts any type of file transfer (and editing a file copies the files to the host, edits a local copy and copies the file back). The default buffer size is only appropriate for direct usb-serial devices (like the pyboard or teensy).

Post Reply