I have come back to working on a new ESP32 project after a break.
All was working well before, but now I am having trouble connecting my previously working ESP32 DOIT DEVKIT V1 board.
I am running Arduino rev 1.8.9
I have tried several boards with same result. An Arduino Uno works fine.
I am getting the following error on compilation:
Arduino: 1.8.9 (Mac OS X), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None" /Applications/Arduino 3.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino 3.app/Contents/Java/hardware -hardware /Users/davidh/Library/Arduino15/packages -hardware /Users/davidh/Documents/Arduino/hardware -tools /Applications/Arduino 3.app/Contents/Java/tools-builder -tools /Applications/Arduino 3.app/Contents/Java/hardware/tools/avr -tools /Users/davidh/Library/Arduino15/packages -built-in-libraries /Applications/Arduino 3.app/Contents/Java/libraries -libraries /Users/davidh/Documents/Arduino/libraries -fqbn=espressif:esp32:esp32doit-devkit-v1:FlashFreq=80,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10809 -build-path /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_build_356620 -warnings=none -build-cache /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_cache_928173 -prefs=build.warn_data_percentage=75 -verbose /Users/davidh/Documents/Arduino/Blink-pin1/Blink-pin1.ino /Applications/Arduino 3.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino 3.app/Contents/Java/hardware -hardware /Users/davidh/Library/Arduino15/packages -hardware /Users/davidh/Documents/Arduino/hardware -tools /Applications/Arduino 3.app/Contents/Java/tools-builder -tools /Applications/Arduino 3.app/Contents/Java/hardware/tools/avr -tools /Users/davidh/Library/Arduino15/packages -built-in-libraries /Applications/Arduino 3.app/Contents/Java/libraries -libraries /Users/davidh/Documents/Arduino/libraries -fqbn=espressif:esp32:esp32doit-devkit-v1:FlashFreq=80,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10809 -build-path /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_build_356620 -warnings=none -build-cache /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_cache_928173 -prefs=build.warn_data_percentage=75 -verbose /Users/davidh/Documents/Arduino/Blink-pin1/Blink-pin1.ino Using board 'esp32doit-devkit-v1' from platform in folder: /Users/davidh/Documents/Arduino/hardware/espressif/esp32 Using core 'esp32' from platform in folder: /Users/davidh/Documents/Arduino/hardware/espressif/esp32 Detecting libraries used... /Users/davidh/Documents/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lstdc++ collect2: error: ld returned 1 exit status exit status 1 Error compiling for board DOIT ESP32 DEVKIT V1.
After much fiddling about, it suddenly started working! I can not explain what made the difference. It is still a mystery.
I’m not sure either, I’ve actually never encountered that compilation error, but I’m glad it’s working now!
Well, the mystery compiler error has struck again. I am now unable to compile even the blink sketch. The port connection seems to be fine and it is set for the right board.
The only thing I changed was I switched to an Arduino Uno to do something with that and switched back again to the original ESP32 settings. Now it won’t compile at all.
Any suggestions as to how to get back to a working state?
These are the error messages:
Arduino: 1.8.9 (Mac OS X), Board: "DOIT ESP32 DEVKIT V1, 80MHz, 921600, None" /Applications/Arduino 3.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino 3.app/Contents/Java/hardware -hardware /Users/davidh/Library/Arduino15/packages -hardware /Users/davidh/Documents/Arduino/hardware -tools /Applications/Arduino 3.app/Contents/Java/tools-builder -tools /Applications/Arduino 3.app/Contents/Java/hardware/tools/avr -tools /Users/davidh/Library/Arduino15/packages -built-in-libraries /Applications/Arduino 3.app/Contents/Java/libraries -libraries /Users/davidh/Documents/Arduino/libraries -fqbn=espressif:esp32:esp32doit-devkit-v1:FlashFreq=80,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10809 -build-path /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_build_970499 -warnings=none -build-cache /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_cache_352190 -prefs=build.warn_data_percentage=75 -verbose /Users/davidh/Documents/Arduino/soilsense_oled/soilsense_oled.ino /Applications/Arduino 3.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino 3.app/Contents/Java/hardware -hardware /Users/davidh/Library/Arduino15/packages -hardware /Users/davidh/Documents/Arduino/hardware -tools /Applications/Arduino 3.app/Contents/Java/tools-builder -tools /Applications/Arduino 3.app/Contents/Java/hardware/tools/avr -tools /Users/davidh/Library/Arduino15/packages -built-in-libraries /Applications/Arduino 3.app/Contents/Java/libraries -libraries /Users/davidh/Documents/Arduino/libraries -fqbn=espressif:esp32:esp32doit-devkit-v1:FlashFreq=80,UploadSpeed=921600,DebugLevel=none -vid-pid=10C4_EA60 -ide-version=10809 -build-path /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_build_970499 -warnings=none -build-cache /var/folders/n1/59y24n0j2z128fchsgxh1f5w0000gn/T/arduino_cache_352190 -prefs=build.warn_data_percentage=75 -verbose /Users/davidh/Documents/Arduino/soilsense_oled/soilsense_oled.ino Using board 'esp32doit-devkit-v1' from platform in folder: /Users/davidh/Documents/Arduino/hardware/espressif/esp32 /Users/davidh/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lmbedtls /Users/davidh/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -llwip collect2: error: ld returned 1 exit status Using library Wire at version 1.0 in folder: /Users/davidh/Documents/Arduino/hardware/espressif/esp32/libraries/Wire Using library Time at version 1.5 in folder: /Users/davidh/Documents/Arduino/libraries/Time Using library ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display at version 4.0.0 in folder: /Users/davidh/Documents/Arduino/libraries/ESP8266_and_ESP32_Oled_Driver_for_SSD1306_display Using library WiFi at version 1.0 in folder: /Users/davidh/Documents/Arduino/hardware/espressif/esp32/libraries/WiFi exit status 1 Error compiling for board DOIT ESP32 DEVKIT V1.
Hello David, I think this is a conflict between older and newer versions of the ESP32 packages.
Can you remove the ESP32 board add-on from your Arduino IDE?
Then, open the folder explorer and enter: C:\Users\<YOUR_WINDOWS_USERNAME>\AppData\Local\Arduino15 and press enter key:
Then, delete packages folder inside the Arduino15 folder.
Then, Install the ESP32 Board in Arduino IDE again: https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/
Re-open your Arduino IDE. Does it compile now?
Ok I think I cracked it. If I remove the espressif folder, the IDE would not start up, but then I realised the board selection was still poiniting to the DOIT board. I switched it to an Arduino Uno and it booted ok with the espressif folder deleted. This appears to be a crucial step.
Then I reinstalled the ESP32 board and it now compiles ok.
It was all a bit strange but following this sequence seemed to work:
- reset the board to an arduino (V important!)
- remove the board
- delete the espressif folder
- reinstall the ESP32
- (the package reference in preferences was already there)
Then all works fine.
Thanks for your help Rui