Giter Club home page Giter Club logo

flasher's Introduction

Flasher

Windows script to facilitate flashing an ESP8266/NodeMCU without installing a full IDE.

Introduction

For novice users, flashing a firmware into an ESP8266/NodeMCU board is quite a hurdle. Either they have to download and install the Arduino IDE with ESP8266 plugin as described on the Arduino web. Or they have to learn the command line interface of the esptool.

This project delivers a Windows batch script (flash.cmd) that should deliver a "one-click" flash experience. It relies on the esptool from Christian Klippel and Ivan Grokhotkov to do the actual flashing.

Concepts

The flash.cmd script executes these steps

  • Find flash tool
  • Find firmware image
  • Find COM port of a connected ESP8266
  • Execute flashing

Find flash tool

By default the flash.cmd script looks for esptool.exe in the same directory as the script itself.

If the tool is not present in that directory it checks if Arduino with ESP8266 has been installed, and tries to pick up esptool.exe there.

So, if your PC has Arduino with ESP8266, there is no need to download a copy of the esptool.

As of 2020, I have added the esptool binary to this project, to make it even more "one-click".

Find firmware image

By default the flash.cmd script looks for a binary firmware file (a file ending in *.bin) in the same directory as the script itself.

If a firmware file is not present in that directory the script checks if there is an Arduino build-cache, and tries to pick up a firmware file there.

Note that Arduino clears its build cache upon exit.

Find COM port of a connected ESP8266

The flash.cmd script enumerates all known COM ports. If only one is found it is selected automatically. Otherwise a dialog pops up for the user to enter the COM port of choice.

Execute flashing

Just before executing the actual flash command, the flash.cmd script pops up a dialog with a summary of its findings. The user clicks Ok to flash or Cancel to abort.

After pressing Ok, the flash.cmd script starts the esptool, which takes tens of seconds to complete.

Note that while the flash.cmd script is running it prints all its findings to a windows console. It saves a copy to a the file flash.log in the same directory as the script.

Example

Create a directory (e.g. flash on the desktop) with the following content

flash.cmd
esptool.exe
mRPM.ino_v4.bin

The file flash.cmd and esptool.exe are delivered by this project. The bin file is some binary that needs to be flashed.

A double click on flash.cmd generates the following log file of its actions.

flash.cmd by Maarten Pennings 
  2017 Aug 28 ; 23:22; C:\Users\maarten\Desktop\flash 
 
Flash tool found - with this script 
  C:\Users\maarten\Desktop\flash\esptool.exe 
 
Firmware found - with this script 
  C:\Users\maarten\Desktop\flash\mRPM.ino_v4.bin 
 
COM ports found: COM3  
  Auto selected: COM3 
 
Command 
  C:\Users\maarten\Desktop\flash\esptool.exe  -cd nodemcu  -cb 512000  -cp COM3  -cf C:\Users\maarten\Desktop\flash\mRPM.ino_v4.bin 
 
========================================================================================= 
Uploading 235264 bytes from C:\Users\maarten\Desktop\flash\mRPM.ino_v4.bin to flash at 0x00000000
................................................................................ [ 34% ]
................................................................................ [ 69% ]
......................................................................           [ 100% ]
========================================================================================= 
 
Completed successfully 
  See C:\Users\maarten\Desktop\flash\flash.log for a copy of this output 

(end of doc)

flasher's People

Contributors

maarten-pennings avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

gnuscore juergs

flasher's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.