I had tried this before. Cant remember all the results of various combinations. But it looks like Webrepl is the culprit. Please see my earlier post.fdushin wrote:Using the webrepl console, try
and verify the file has the contents you expect it to have. (I have found that using webrepl will wrap the output, making long lines possible to read, whereas minicom will not. YMMV if you are using a different serial protocol tool (e.g., screen).Code: Select all
f = open('main.py') print(f.read()) f.close()
The only other thing I can think of:
- * You accidentally uploaded a compiled main.mpy, but that would show up with os.listdir()
* You accidentally burned main.mpy onto your image. (I have noticed that you cannot over-ride modules that are burned into firmware)
Despite copying a new one, old main.py is operational
Re: Despite copying a new one, old main.py is operational
Re: Despite copying a new one, old main.py is operational
Just joined the forum. First day experimenting with an ESP8266. I encountered the same problem using the WebREPL client when trying to resend a modified file that I previously sent. I think the problem is that some browsers cache the uploaded file.
In FireFox (51.0.1 Windows) to resend a file, you have to click Browse and reselect the file before clicking Send to Device. Otherwise, the prior cached version is sent again.
Unfortunately, in Chrome (56.0.2924.87 Windows) the above doesn't work. It continues to send the original cached file. As KrishanCA mentioned, you can send a dummy file to clear the cache.
Not sure how other browsers behave.
In FireFox (51.0.1 Windows) to resend a file, you have to click Browse and reselect the file before clicking Send to Device. Otherwise, the prior cached version is sent again.
Unfortunately, in Chrome (56.0.2924.87 Windows) the above doesn't work. It continues to send the original cached file. As KrishanCA mentioned, you can send a dummy file to clear the cache.
Not sure how other browsers behave.
Re: Despite copying a new one, old main.py is operational
I use the adafruit ampy utility to move files to the device over the serial port. Usually works okay, though sometimes I will have to try it twice or reset the 8266 to get it to work.
https://learn.adafruit.com/micropython- ... stall-ampy
https://learn.adafruit.com/micropython- ... stall-ampy
Re: Despite copying a new one, old main.py is operational
I saw the ampy utility but I need a network based solution. Too bad the WebREPL CLI can't be used simultaneously with the WebREPL.
I think the script just needs to be modified to clear the file input after sending or maybe place it in a form and use form reset.
I think the script just needs to be modified to clear the file input after sending or maybe place it in a form and use form reset.
Re: Despite copying a new one, old main.py is operational
There are quiet a few methods for sending files over USB, like rshell and ampy. I use FTP with a small server embedded into the ESP. Even small, it's best to embed it into the flash. As compiled version it can run from the command line. And I do not use Webrepl, not even the CLI, which can coexist with the ftp server.
Two links to ftp. The first one can run in background, the second one runs in foreground and is much smaller. As client you can use Filezilla, FireFtp or command line ftp (not on Windows for the smaller version)
https://github.com/robert-hh/ESP8266-FTP-Server
https://github.com/cpopp/MicroFTPServer
Two links to ftp. The first one can run in background, the second one runs in foreground and is much smaller. As client you can use Filezilla, FireFtp or command line ftp (not on Windows for the smaller version)
https://github.com/robert-hh/ESP8266-FTP-Server
https://github.com/cpopp/MicroFTPServer
-
- Posts: 2
- Joined: Thu Mar 02, 2017 12:51 am
Re: Despite copying a new one, old main.py is operational
I have found the adafruit ampy utility to be a better choice for manipulating files. I've done it with the webREPL as well, but ampy just seems more solid. Easy-enough to try it.