HowTo: ESP8266 – mit dem “Esptool” .bin-Dateien unter Windows flashen

Das eigentliche flashen von Firmware-Datein wie .bin-Datein (auch “binarys” genannt) auf den Wemos D1 Mini, das NodeMcu Dev-Board oder jegliches anderes Board, dass auf dem ESP8266 basiert, geschieht in der Arduino IDE komplett im Hintergrund.

Dahinter verbirgt sich nämlich eigentlich das von Espressif – dem Hersteller des ESP8266 – angebotene “esptool”. Mit den richtigen Parameter aufgerufen könnt Ihr damit auch ganz leicht fertige .bin-Dateien auf den ESP8266 übertragen.

An easier and a slightly more challenging way is described in this article.


Safety instructions

I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/

Affiliate links/advertising links

The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂 


Requirements

Required tool:
-no-

Required material:
-no-


The esptool

Die aktuelle Version des angesprochenen “esptool” findet Ihr immer im GitHub des Herstellers unter:

https://github.com/espressif/esptool

“Problem” dabei ist, dass dieses Tool eine Python Skript/Anwendung ist und somit nicht direkt/einfach unter Windows ausgeführt werden kann.

Praktischerweise lassen sich Python-Skripte aber auch zu einer kompakten .exe-Datei “zusammenpacken”. Dadurch wird auch die Handhabung unter Windows leichter.
How to do this is described in the article Python - Translate Esptool.py to Esptool.exe described.
Alternatively, you can also access (somewhat older) prepared releases at

https://github.com/igrr/esptool-ck/releases

fall back.

For the further course of this article you don't have to organize the esptool yourself but you can simply use the esptool.exe file in the following Git.


Transfer an existing .bin file with the esptool and the ESPEasy Flasher

Wenn man lediglich mit dem esptool “bewaffnet” eine .bin-File auf den ESP8266 übertragen will hat dies normalerweise zur Folge, dass man das esptool über die Kommandozeile und mit den entsprechenden Parametern aufrufen muss.

This is often difficult especially for not so advanced users and apart from that simply impractical.

This has also been noticed by others and therefore they have worked on how to make the flash process of the ESP8266 as simple as possible.

One of these results can be found in the following Git repository at

https://github.com/BattloXX/ESPEasyFlasher

as always there is also a backup on the nerdiy git:

https://github.com/Nerdiyde/ESPEasyFlasher

In this Git repository there is a FlashESP8266.exe in addition to the mentioned esptool.exe. The latter works like a graphical user interface, which translates the mouse input into prameters and a command line call. What this means is explained in the next paragraph. The easy way starts right here 🙂

In the mentioned Git repository you can see the files that are contained in the Git repository.
Um den Download der Dateien zu starten klickt Ihr auf den “Clone or Download”-Button und…
… dann auf “Download ZIP”. Weitere Infos zum Download von Dateien aus einem Git-Repository findet Ihr auch im Artikel GitHub - How do I copy files from a Git repository to my computer?
If you have downloaded the ZIP file, you have to unpack it first. You can find more information about this in the article WinRar? WinZip? WinWhat? - Honey I shrunk the files. In the unzipped folder you should then be able to see the folder contents shown.
Nun habt Ihr alle benötigten Programmdatein zum flashen vorbereitet. Was Euch noch fehlt ist die .bin-Datei die Ihr auf Euren ESP übertragen wollt. Diese bekommt Ihr – Im Bild abgebildet – zum Beispiel aus dem Ordner “bin” des ESPEasy-Gits. Sowohl dort als auch im Tasmota-Git werden fertig kompilierte “binarys” (so nennt man die .bin-Dateien) vorbereitet und angeboten. Da diese binarys aber immer speziell für einen Controllertyp mit entsprechender Speichergröße und Konfiguration kompiliert wurden ist es hier wichtig die korrekte Datei auszuwählen. Für einen Wemos D1-Mini könnt Ihr zum Beispiel die Datei “ESP_Easy_mega-20190803_custom_ESP8266_4M.bin” auswählen. Lasst euch dabei nicht davon irritieren, dass sich die Zahlenfolge zwischen “ESP_Easy_mega-” und “_custom_ESP8266_4M.bin” bei neueren Versionen ändert. Dieser Teil entspricht dem Datum an dem die binary erstellt wurde. Kopiert Euch nun die ausgewählte binary und fügt sie im…
...the same directory where the .exe file of the ESPEasy Flasher is located. This is the directory in which you have previously unpacked the program files of the esptools and Co.
Now you can start the ESPEasy Flasher by executing the FlashESP8266.exe file.
The now opened program is very simple. There is the possibility to select the COM port to which you have connected your ESP. Furthermore ...
…könnt Ihr in dem Auswahl-Menü darunter die binary-Datei auswählen die Ihr auf Euren ESP übertragen wollt. Hier werden alle binarys aufgelistet, die sich in dem gleichen Ordner wie das Programm FlashESP8266.exe befinden. Deswegen findet Ihr hier auch die binary die Ihr zuvor aus dem “bin”-Ordner in den entpackten Programmordner kopiert habt.

Nun müsst Ihr nur noch auf den “Flash”-Button klicken und schon wird die ausgewählte binary auf Euren ESP übertragen.

One more important note: The list of available COM ports is only updated by restarting the application. So if you have connected your ESP when the program was already started, you have to close it again and open it again.


Call Esptool via the command line

As mentioned before, you can also use the esptool directly to transfer an existing binary to your ESP.

To do this, use the command line to call the esptool with specified parameters as follows:

esptool.exe -vv -cd nodemcu -cb 921600 -cp COM32 -ca 0x00000 -cf C:ESPEasy.ino.bin
  • Dabei entspricht die Zahl “921600” der Baudrate mit der Euer ESP programmiert wird. Dies kann von Modell zu Modell variieren. Typische Baudraten sind “9600”, “115200” oder “921600”. Falls eine Baudrate nicht funktioniert könnt Ihr es auch einfach mit einer anderen probieren.
  • Der Teil “COM32” enspricht dem COM-Port unter dem Euer angeschlossener ESP erreichbar ist.
  • “0x00000” entspricht dem Speicherbereich ab dem die binary in den Speicher des ESP geschrieben werden soll. Für gewöhnlich solltet Ihr diesen Wert nicht verändern.
  • Wichtig ist nun noch der Teil “C:ESPEasy.ino.bin” Hier muss der Pfad zu Eurer binary angegeben sein. Habt Ihr Eure binary auf Euer Laufwerk C: kopiert und “ESPEasy.ino.bin” genannt, kann dieser Wert auch so bestehen bleiben.

Further information:

https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool


Have fun with the project

I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂

PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂

Buy Me a Coffee at ko-fi.com       

10 comments

  1. Hello,
    everything great, but unfortunately the COM port is not recognized. Can you help me please.
    Achim

    1. Hello Hans-Joachim,
      can you give me some more info 🙂 Can you check for example if the driver for the USB-Serial converter is installed? Which board do you have?
      The CH340G is installed on many boards. Unfortunately, there is no pre-installed standard driver for this under Windows. If you have a device in the device manager that cannot be assigned a driver, try using the driver for the CH340G. 🙂

  2. Hello all,
    very good tutorial, just rebuild the slotclock,
    Find only, as described here, the "ESP_Easy_mega-20190803_custom_ESP8266_4M.bin" unfortunately nowhere.
    Downloaded the ESPEasy git, but can't find this .bin file.
    Can anyone help me here ?

    Thanks in advance

  3. Hello,

    wie ist da WLAN Kennwort für dieses image “ESP8266_4M_17.02.2021.bin”

    Thanks a lot

  4. However, the tool is now no longer in the package as .exe, but as .sln.
    Unfortunately, it is not that easy to start now.

  5. Hello Fab,

    cool site and even cooler projects! Am here for the first time... 🙂

    Arbeite schön länger mit ESPeasy, kenne also die Standartplugins. Nun würde ich gern dein “HowTo: pxlBlck – pxlBlck_8x8” umsetzen.
    Allerdings kam beim Firmwareupdate OTA mit “ESP8266_ESPEasy_incl_pxlBlck_4M.bin” sowas wie “Magic Bit is missing” und wenn ich es per USB mit dem mit dem offiziellen ESPeasy Flasher mache, strahlt es anschließend keinen WLAN-AP aus. Kannst du mir sagen wo der Fehler liegt?

    Greetings Franz

    open-boat-projects. org

    1. Hi Franz,
      thank you and welcome 🙂
      Das Firmwareupdate via OTA klappt sehr wahrscheinlich nicht, weil die bin-Datei mit dem pxlBlck-Plugin zu groß für die meisten “Standard-Partitionen” ist. Ich muss zugeben, dass ich die Installation per OTA noch nicht ausprobiert habe bzw. nutze und deswegen gar nicht soviel dazu sagen kann, sorry. :/ Müsste ich mir mal genauer angucken.
      Does ESPEasy start correctly when you install it with the ESPEasy Flasher? So you see an output in the serial console?
      If yes, you could try to configure the wifi access data via the serial interface. I have described this (somewhat compactly) here: https://nerdiy.de/howto-espeasy-firmware-flashen/#WLAN-Zugangsdaten_ueber_die_serielle_Schnittstelle_konfigurieren
      If not, please let me know and I'll try to recreate it 🙂 .
      Best regards
      Fabian

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert


The reCAPTCHA verification period has expired. Please reload the page.