Code for Wemos D1 mini won't compile

Three years ago I made a device that uses a mini D1 R2, an RTC, an SD card, and U8G2 graphics. It was working. Two days ago I installed esp8266, ver.3.0.2. Noe I get compiler errors. Thinking it might have to do with the SD card or graphics, I wrote a very simple sketch that just reads the RTC and prints the result to the serial monitor. I get the same errors. I tried other versions of wemos cards with same result.

Non verbose (down load) error file is listed below. I don't know what it tells me, so any help would be greatly appreciated.

Arduino: 1.8.9 (Windows 10), Board: "LOLIN(WEMOS) D1 R2 & mini, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"

Traceback (most recent call last):

File "C:\Users\Richard\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/", line 211, in


File "C:\Users\Richard\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/", line 192, in main


File "C:\Users\Richard\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/", line 187, in wrapper

write_bin(out=out, args=args, **kwargs)

File "C:\Users\Richard\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/", line 75, in write_bin

[size, addr] = get_segment_size_addr(elf, segment, args.path)

File "C:\Users\Richard\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/", line 47, in get_segment_size_addr

p = subprocess.Popen([path + '/xtensa-lx106-elf-objdump', '-h', '-j', segment,  elf], stdout=subprocess.PIPE, universal_newlines=True )

File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\", line 775, in init

File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\", line 1178, in _execute_child

FileNotFoundError: [WinError 2] The system cannot find the file specified

exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Simple WeMos sketch that generates above error mesages.

// Uses WeMos D1 mini on COM8

#include <Wire.h>

#include <RTClib.h>

RTC_DS3231 rtc;

int oldMinute;
int oldHour;
int oldDay;
int oldMonth;

int nowHour;
int nowMinute;
int nowDay;
int nowMonth;
int nowSecond;

int I;

void setup() // ****************start of setup *****************

while (!Serial) {
// wait for serial port to connect.

if (! rtc.begin())
Serial.println("Couldn't find RTC");
while (1);

// This line sets the RTC with an explicit date & time, for example to set
// April 31, 2019 at 10:10 am you would call:
// (year, month, day-of-month, hour, minute, second)

rtc.adjust(DateTime(2021, 11, 1, 10, 5, 0));
DateTime now =;

// set initial hour
oldMinute = now.minute();
oldHour = now.hour();
oldDay =;
oldMonth = now.month();

Serial.print("initial value of month, day, and hour = ");
Serial.print(", ");
Serial.print(", ");
Serial.print(", ");

} //*************** end of setup()********************

void loop() // **START OF LOOP

  DateTime now =;
  nowHour = now.hour();
  nowMinute = now.minute();
  nowDay =;
  nowMonth = now.month();
  nowSecond = now.second();

  if(nowMinute != oldMinute)
  Serial.print("current month, day, hour, minute and second: ");
  Serial.print("  ");
  Serial.print("  ");
  Serial.print("  ");
   Serial.print("  ");

 oldMinute = nowMinute;


Please post that sketch

what is "D:\obj\Windows-Release?

please RE-edit your first posting with the sketch by using this method:

click on the pencil-icon below your first posting to activate edit-mode.
mark all the code and delete it

Then You should post code by using code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

best regards Stefan

the code doesn't matter. the toolchain is broken

Is there a way I can fix it?


setting up a complete new installation of the arduino-IDE actual version 1.8.16
and re-install all additional libraries

second version:
unzipping a portable installation of the Arduino-IDE
and copying your folder "library" from your original installation into the subfolder "portable\sketchbook"

and adding the additional board-url.
best regards Stefan

I asked

It's having problems in a Python (.py) program in the Arduino esp8266 3.0.2 installation. If reinstalling the ESP8266 support doesn't help, I would try reinstalling Python.


That’s what I figured when I looked at the error log. The previous version of ESP8266 I was using (Jan 2019 according to the dates on some sketches) worked just fine. I tried reinstalling ESP8266 to an earlier version. But I seemed to get ver. 3.0.2 again. I’ll try that approach again, and reinstall Python..

Thanks for your suggestion.


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