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.
ym58
Posts: 3
Joined: Tue Nov 08, 2016 6:38 pm

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

Post by ym58 » Tue Nov 08, 2016 6:58 pm

Hello,

I am kind of lost and spent hours on trying to get ESPLORER execute a proper main.py file on my ESP8266 (MicroPython 1.8.5).

As long as I call the MicroPython interpreter, it works quite well, but ESPLORER definitely refuses to 'DOFILE' a quite simple main.py script !!!

ESPLORER always returns me :
> dofile("main.py")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'dofile' is not defined

Please watch the 3 following pics :
https://dl.dropboxusercontent.com/u/298 ... s/mpf1.jpg
https://dl.dropboxusercontent.com/u/298 ... s/mpf2.jpg
https://dl.dropboxusercontent.com/u/298 ... s/mpf3.jpg

Thanks for any help.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

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

Post by deshipu » Wed Nov 09, 2016 7:57 am

Well, that's quite correct, there is no "dofile" function defined.

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 » Fri Nov 11, 2016 6:45 pm

I think Esplorer is faaaar from updated to support to micropython. dofile() is a LUA NodeMCU function which is not suited for micropython. In other words forget it... ;)

If you browse the forum, you'll discover much more effective ways to develop with micropython and target devices like ESP8266. You can choose from GUI to CLI to install and check your applications. Enjoy!

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 » Fri Nov 11, 2016 7:23 pm

Just to name a few:
rshell (from dhylands)
webrepl (from paul & damien)
ampy (adafruit)
mu editor (?)
pymakr (last, not least) (pycom.io)
.. more, whco do not come to my mind at the moment

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

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

Post by ym58 » Mon Nov 14, 2016 10:31 am

Thanks to all !
I'll check other options than ESPlorer from now on ...

BigMan
Posts: 22
Joined: Sat Oct 29, 2016 2:29 pm

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

Post by BigMan » Sun Nov 20, 2016 2:24 pm

Hello together,
I have the same issue as ym58 ... well ... pls. excuse ... but I am not fully "happy" with the replies.

1) ESPlorer is uploading the main.py on the ESP8266. The file is there. Based on the micropython documentation I thought main.py files would be automatically executed after the ESP8266 has booted (1st boot.py, then main.py). --> this doesn't happen.
@ym58: can you confirm, that your main.py is stored on the ESP8266, but doesn't start autmatically after a reboot?

2) I tested all the named IDEs/editors and ESPlorer is the only one I can really work with (I am on an Arch Linux machine)
- rshell -> seems to be a CLI only. With ESPlorer I can write code and send it in total or line by line to the ESP8266; Also a GUI is just nicer;
- ampy -> also seem sto be a CLI interface only.
- mu editor -> doesn't connect to my UART ... and there is nowhere a setting option, e.g. to determine the USB interface, set the baud-rate etc.
- pymakr -> I couldn't find the source code and there doesn't seem to be a package for Arch Linux (only debian and red hat).

==> So this leave me with ESPlorer.
But again. That the main.py doesn't start directly from ESPlorer is only a minor issue. Why isn't main.py not starting after the reboot?

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 » Sun Nov 20, 2016 6:21 pm

If main.py is in the root directory, it will start. Do you see it, when in REPL you issue:

Code: Select all

import uos
uos.listdir()
The pymakr source code is here: https://github.com/pycom/Pymakr
For file exchange with esp8266, you can also use ftp clients, once you managed to upload this sever to esp8266 (better put it in flash). https://github.com/robert-hh/ESP8266-FTP-Server
A prebuild esp8266 image with installed ftp is here: https://github.com/robert-hh/Shared-Stuff

BigMan
Posts: 22
Joined: Sat Oct 29, 2016 2:29 pm

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

Post by BigMan » Mon Nov 21, 2016 6:05 pm

Roberthh wrote:If main.py is in the root directory, it will start. Do you see it, when in REPL you issue:

Code: Select all

import uos
uos.listdir()
I will double-check the day after tomorrow, and will post the results (currently I am bit to busy with the work I am getting paid for :-))
Roberthh wrote: The pymakr source code is here: https://github.com/pycom/Pymakr
... unfortunately the installation results in "an internal error". I already send this to support@pycom.io
Don't get me wrong: I highly appreciate open-source and for me the people investing their time in such applications are heros in my eyes!
Roberthh wrote: For file exchange with esp8266, you can also use ftp clients, once you managed to upload this sever to esp8266 (better put it in flash). https://github.com/robert-hh/ESP8266-FTP-Server
A prebuild esp8266 image with installed ftp is here: https://github.com/robert-hh/Shared-Stuff
Good point. I will keep in mind.

BigMan
Posts: 22
Joined: Sat Oct 29, 2016 2:29 pm

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

Post by BigMan » Wed Nov 23, 2016 4:57 pm

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.

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 6:46 pm

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.

Thanks

Post Reply