This has me completely vexed. I loaded a skeleton project with PlatformIO “New Project” and the platformio.ini file looks like this:
[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
The barebones project is this:
#include <Arduino.h>
// put function declarations here:
int myFunction(int, int);
void setup() {
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
void loop() {
// put your main code here, to run repeatedly:
}
// put function definitions here:
int myFunction(int x, int y) {
return x + y;
}
When I try to upload, I get this:
Processing d1_mini_pro (platform: espressif8266; board: d1_mini_pro; framework: arduino)
----------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 (3.2.0) > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES:
- framework-arduinoespressif8266 @ 3.30002.0 (3.0.2)
- tool-esptool @ 1.413.0 (4.13)
- tool-esptoolpy @ 1.30000.201119 (3.0.0)
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 1.200.0 (2.0)
- toolchain-xtensa @ 2.100300.210717 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\d1_mini_pro\firmware.elf
Checking size .pio\build\d1_mini_pro\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [=== ] 34.0% (used 27892 bytes from 81920 bytes)
Flash: [== ] 24.9% (used 260093 bytes from 1044464 bytes)
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM4
Uploading .pio\build\d1_mini_pro\firmware.bin
esptool.py v3.0
Serial port COM4
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
*** [upload] Error 2
============== [FAILED] Took 26.46 seconds ====================
I’ve tried grounding D0 and holding reset switch while uploading to no avail. I disabled the driver and re-enabled it. The on-board LED flashes so it seems to try to load but maybe the board is defective? I want to use the D1 Mini Pro because of the UFL external antenna connector since I need more range for my weather station project. Any help would really be appreciated while I still have hair left.