Well, another delay…

This time, it’s WiFi range; I was trying to get voltage measurements from roof-mounted solar cells via a test rig in my shed.   No signal. 🙁  So, yet another delay…but I’m getting closer.  I want to use a Wemos D1Mini Pro because of the available external antenna connector since I need more range for my remote weather station project.  When I TRY to upload, the on-board LED flashes like it’s trying to load but I was eventually getting an upload error, as you can see below.   

The console looks like 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 posted my predicament to the platformIO community and it was very helpful!  After working with a couple of PlatformIO guys with experience with ESP8266 boards on the forum, I finally got it to upload OK.  This particular D1 Mini Pro board with a CH9102 USB-Serial converter was unlike any other ESP8266 board I have used.  Usually, PlatformIO and esptool.py would automagically set the board to upload mode and voila! program loaded.  Not so with this one.  It was advised to set the monitor speed to 9600 in the platformio.ini, which I did.  With GPIO0 grounded to upload, once it loaded, I got garbage on output:

[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
monitor_speed = 9600

Executing task in folder Web-Server-LED-Control-AJAX: C:\Users\bruce.platformio\penv\Scripts\platformio.exe device monitor

— Terminal on COM4 | 9600 8-N-1
— Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting…
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
�Htx6

Working with user sivar2311, he directed me to set the monitor_speed to 7488, which appararently allows the bootloader to put the boot log to serial.  So, armed with this info, I got this on booting:

Executing task in folder Web-Server-LED-Control-AJAX: C:\Users\bruce.platformio\penv\Scripts\platformio.exe device monitor
— Terminal on COM4 | 76800 8-N-1
— Available filters and text transformations: colorize, debug, default, direct, esp8266_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting…
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ets Jan 8 2013,rst cause:2, boot mode:(1,7)

From the Bootloader info page about esptool.py:

The ESP8266 boot rom writes a log to the UART when booting. The timing is a little bit unusual: 74880 baud (see Serial Port Settings).

Baud rate 74880 is what the ESP8266 bootloader uses. The apps on top of the Espressif SDK (e.g. Arduino sketch) talk at 115200 if not specified otherwise.

It was suggested to try different combinations of DTR and RTS and after some back-and-forth on the forum, this was the answer:

The garbage is due to the fact that your sketch works with a baud rate of 9600, but the monitor is currently set to 76800.

Stay with the first one (monitor_dtr = 0 / monitor_rts = 0) and change the baud rate back to 9600:

[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
monitor_speed = 9600
monitor_rts = 0
monitor_dtr = 0

Why this was necessary and to ground GPIO0 (D3) to get this board working is beyond me.  All of my other ESP8266 boards (except the barebones ESP01) work fine with PlatformIO to upload and none of this is needed.  Well, now I know what to do when a board refuses to boot, thanks to the PlatformIO community forum. 🙂 

Leave a Reply

Your email address will not be published. Required fields are marked *