ESPTOOL infos, to upload on wemos d1

Hello
i tried to upload a project via platformIO

unfortunately it doesn't work
so i try to upload the finish bin file via esptool

i write this code for my Wemos D1 mini

esptool.py --chip esp8266 --port COM5 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 /.pio/build/d1/firmware.bin

know i have some questions:
my first big question:
what means 0x0 ???
what number should i use?????
what means the numer???

The chip... Is it correct to use ESP8266? i found ESP8266EX
what should i use?

Hi @jumbo125. In case it will be useful, this is the command Arduino IDE uses to successfully upload to my WEMOS D1 Mini:

"C:\Users\per\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\per\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/upload.py" --chip esp8266 --port "COM4" --baud "921600" ""  --before default_reset --after hard_reset write_flash 0x0 "C:\Users\per\AppData\Local\Temp\arduino\sketches\8938B595355AFC5191AE4BB9B38FC51F/sketch_sep15b.ino.bin"

upload.py is a wrapper of esptool. You can see the contents of the upload.py script here:

https://github.com/esp8266/Arduino/blob/3.1.2/tools/upload.py

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the related topic here:

Thank you
What means

0x0

In the command line??

Is it important, that no sensor is on the wemos? Do I need to disconnect all before?

As is the case with most command line tools, you can learn about the command line interface by invoking esptool with the --help flag:

$ python esptool.py write_flash --help

usage: esptool write_flash [-h] [--erase-all] [--flash_freq {keep,80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}] [--flash_mode {keep,qio,qout,dio,dout}]
                           [--flash_size {detect,keep,256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}] [--spi-connection SPI_CONNECTION] [--no-progress] [--verify] [--encrypt]
                           [--encrypt-files <address> <filename> [<address> <filename> ...]] [--ignore-flash-encryption-efuse-setting] [--force] [--compress | --no-compress]
                           <address> <filename> [<address> <filename> ...]

positional arguments:
  <address> <filename>  Address followed by binary filename, separated by space

Documentation is also available here:

https://docs.espressif.com/projects/esptool/en/latest/esp32/esptool/basic-commands.html#write-binary-data-to-flash-write-flash

The next arguments to write_flash are one or more pairs of offset (address) and file name. Consult your SDK documentation to determine the files to flash at which offsets.

Numeric values passed to write_flash (and other commands) can be specified either in hex (ie 0x1000), or in decimal (ie 4096).

So the 0x0 argument in the command is the address at which to flash the .bin file specified by the following argument.


Even though it is interesting to learn how to use esptool directly, there is a good chance the same underlying problem that is causing the uploads via PlatformIO to fail will also cause the uploads when using esptool directly to fail.

So if you are spending a lot of energy to try to figure out how to use esptool solely in hopes it will fix your upload problem, I think that energy would be better spent in finding and fixing the actual cause of the failed uploads.

I saw from your other topic that you also use Arduino IDE. Does the upload also fail if you attempt to upload a sketch to your WEMOS D1 Mini using Arduino IDE?

No. This works

really confused... i use the powersehll in the platform io and this worked....(esptool.py)

OK, then my hypothesis that there is some underlying problem was wrong.

You can get Arduino IDE to generate the working command for you:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Use Arduino IDE to upload any sketch to your WEMOS D1 Mini as you did before.
  6. Wait for the upload to finish.

Now examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. There you will see a command that looks something like the one I shared in post #3. You can copy that command and run it from the command line, as well as making adjustments to the command as you like.

That is interesting. Unfortunately I don't have any experience with PlatformIO so I can't be of much help here. But other forum helpers here use it so they can probably provide you with assistance for any PlatformIO-specific problems you might have.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.