Flash an ESP8266 in no time (nodemcu & arduino)
In building build-yours.com, a company developing and selling products based on ESP8266s, a large problem we encountered was
How do you flash a large number of chips with little effort in a short amount time?
To solve this, I created autoflash, of which I am now publishing the third generation.
You can wipe a chip clean, create backups and upload them again.
Uploading to a 4MB chip takes a mere 15s.
Autoflash automatically selects the port depending on the OS.
Autoflash uses npm as a means of distribution.
$ npm i -g autoflash
Autoflash works with binary files. The only reason we use the file extension .afl
is so that we know that they are ESP8266 images, but it can also be omitted.
Adding the flag -v
or --verbose
tells autoflash to display everything it does in detail.
Available commands:
download
upload
erase
device
/ devices
$ autoflash download [backup.afl] [--port=<auto>]
-
If no filename is specified, the file is downloaded to the current working directory with the name "backup.afl".
-
If no port is specified, autoflash decides which port to use
$ autoflash upload file.afl [--port=<auto>]
- If no port is specified, autoflash decides which port to use
$ autoflash erase [--port=<auto>]
- If no port is specified, autoflash decides which port to use
For the above commands, a port can be specified using the optional --port
flag. If no port is specified, autoflash detects an active port and uses it.
The port automatically selected port can be viewed with
$ autoflash device
To get a list of available ports, use
$ autoflash devices
If you want to contribute but don't know where to start, these are a few things that would be cool to have:
- Complain when specified port doesn't exist
- Complain on error with esptool.py
- JS API so that it can be integrated as a dependency in other programs
- Progress bar
- Download
- Upload
- Erase
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.