D1 mini pro - Flashing successful (console) but not working

Hi there,

I’m scratching my head on this one. I do have some D1 mini pro (clones) lying around. In the far past I realized a project on such board successfully (flashed spacehuhn/wifi_deauther). So I assume the hardware working.

Now I wanted to start a new project.

  • Installed Arduino IDE 2.3.7 on Ubuntu 24.04
  • Installed ESP8266 Lib 3.1.2
  • Selected Board esp8266/LOLIN(Wemos)D1 mini pro
  • Connected with USB cable
  • Tried a basic blink sketch
  • Arduino console claimed: compiled and uploaded successfully; also LED was flashing during the process
  • But neither resetting nor replugging led to a blinking LED
  • I read somewhere in here to erase the whole flash, as the SDK might be broken so I did
    esptool.py --chip esp8266 erase_flash
    and tried flashing again - console called it a success but no blinking
  • I read somewhere else to pull down D3 while programming - console called it a success but no blinking

So I’m about to throw that damn thing out of the window ….

What may I have missed?

Here is the Blinking sketch if anyone is curious:

#define PIN_LED D4

void setup(){
  pinMode(PIN_LED, OUTPUT);
}
void loop(){
  digitalWrite(PIN_LED, LOW);
  delay(500);
  digitalWrite(PIN_LED, HIGH);
  delay(500);
}

Substitute; int PIn_LED = 4;

instead of; #define PIN_LED D4

Good luck…………

Clones might have LED on another gpio or no LED at all...

@notrauma @kmin : thanks for your input.

Substituting the define with a variable did not solve the issue.

I verified the LED-Pinout under the microscope.

However “clone” was the key.
I selected the “esp8266/LOLIN(Wemos)D1 mini pro” because of its 16 MB flash. And it has 16MB installed (25Q128A IC). However there seems to be something off by the way the original is programmed.
After changing the board to “esp8266/LOLIN(Wemos)D1 mini (clone)” the flashing worked instantly. However on this board I’m only able to assign 4 MB. Would love to see the clone board with a 16 MB variant as well.

Hi @timog.

In cases where there isn't an appropriate model-specific board definition for your hardware, you can use the "Generic ESP8266 Module" board definition (Tools > Board > esp8266 > Generic ESP8266 Module). This board definition is intended to provide general purpose support for boards that have an ESP8266 microcontroller. The way it works is you select the appropriate configuration options for your specific hardware from the other "custom board option" menus that are added under Arduino IDE's "Tools" menu when this board is selected from the Tools > Board menu. You can select the flash memory and partition configuration from the Tools > Flash Size menu.


I did a diff between the two board definitions.

There is of course the difference you already noted of the properties being configured for different flash sizes:

LOLIN(WEMOS) D1 mini Pro

build.flash_size=16M
build.flash_ld=eagle.flash.16m14m.ld
build.spiffs_pagesize=256
build.rfcal_addr=0xFFC000
build.spiffs_start=0x200000
build.spiffs_end=0xFFA000
build.spiffs_blocksize=8192

LOLIN(WEMOS) D1 mini (clone)

build.flash_size=4M
build.flash_ld=eagle.flash.4m2m.ld
build.spiffs_pagesize=256
build.rfcal_addr=0x3FC000
build.spiffs_start=0x200000
build.spiffs_end=0x3FA000
build.spiffs_blocksize=8192

However, there is one other difference of interest:

LOLIN(WEMOS) D1 mini Pro

build.flash_mode=dio
build.flash_flags=-DFLASHMODE_DIO

LOLIN(WEMOS) D1 mini (clone)

build.flash_mode=dout
build.flash_flags=-DFLASHMODE_DOUT

This can be configured via Arduino IDE's Tools > Flash Mode menu when the "Generic ESP8266 Module" board is selected. The default Tools > Flash Mode > DOUT (compatible) setting is the configuration of the working "LOLIN(WEMOS) D1 mini (clone)" board definition.

Wow, thanks for the extensive work you’ve put into my issue. I was already thinking about extending the D1 (clone) board definition to match my flash size. But the hint to the Generic ESP8266 Module seems like the more appropriate and update-resistant approach.