PlatformIO Community

Bricked Wemos d1 mini,visual studio code


#7

i see. with this folder there are not options in the toolbar . In tasmota folder exists.


#8

I think it would be easier if you just created a new project (see here) with the WeMos D1 mini Lite as board and copied the WiFiScan.ino into the new project’s src/ directory.


#9

okkkkk
platformio.ini

; PlatformIO Project Configuration File

;

; Build options: build flags, source filter

; Upload options: custom upload port, speed and extra flags

; Library options: dependencies, extra library storages

; Advanced options: extra scripting

;

; Please visit documentation for the other options and examples

; https://docs.platformio.org/page/projectconf.html

[env:d1_mini_lite]

platform = espressif8266

board = d1_mini_lite

framework = arduino

[env:wemos]

platform = espressif8266

framework = arduino

board = d1_mini_lite

monitor_speed = 115200

TERMINAL:
Processing wemos (platform: espressif8266; board: d1_mini_lite; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_lite.html
PLATFORM: Espressif 8266 > WeMos D1 mini Lite
HARDWARE: ESP8266 80MHz 80KB RAM (1MB Flash)
Converting WiFiScan.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 26 compatible libraries
Scanning dependencies…
Dependency Graph
|-- 1.0
Compiling .pioenvs\wemos\src\WiFiScan.ino.cpp.o
Compiling .pioenvs\wemos\src\main.cpp.o
Generating LD script .pioenvs\wemos\ld\eagle.app.v6.common.ld
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\BearSSLHelpers.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\CertStoreBearSSL.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFi.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFiAP.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFiMulti.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFiSTA.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\ESP8266WiFiScan.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiClient.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiClientSecureAxTLS.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiClientSecureBearSSL.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiServer.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiServerSecureAxTLS.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiServerSecureBearSSL.cpp.o
Compiling .pioenvs\wemos\libbde\ESP8266WiFi\WiFiUdp.cpp.o
Archiving .pioenvs\wemos\libFrameworkArduinoVariant.a
Compiling .pioenvs\wemos\FrameworkArduino\Esp-version.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Esp.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\FS.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\FunctionalInterrupt.cpp.o
Archiving .pioenvs\wemos\libbde\libESP8266WiFi.a
Compiling .pioenvs\wemos\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\IPAddress.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\MD5Builder.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Print.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Schedule.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\ScheduledFunctions.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Stream.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\StreamString.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Tone.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\Updater.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\WMath.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\WString.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\abi.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\base64.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\cbuf.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\cont.S.o
Compiling .pioenvs\wemos\FrameworkArduino\cont_util.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_eboot_command.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_flash_utils.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_i2s.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_main.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_noniso.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_phy.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_postmortem.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_si2c.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_sigma_delta.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_timer.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_waveform.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring_analog.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring_digital.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring_pulse.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring_pwm.c.o
Compiling .pioenvs\wemos\FrameworkArduino\core_esp8266_wiring_shift.c.o
Compiling .pioenvs\wemos\FrameworkArduino\debug.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\gdb_hooks.c.o
Compiling .pioenvs\wemos\FrameworkArduino\heap.c.o
Compiling .pioenvs\wemos\FrameworkArduino\libb64\cdecode.c.o
Compiling .pioenvs\wemos\FrameworkArduino\libb64\cencode.c.o
Compiling .pioenvs\wemos\FrameworkArduino\libc_replacements.c.o
Compiling .pioenvs\wemos\FrameworkArduino\pgmspace.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\sntp-lwip2.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs\spiffs_cache.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs\spiffs_check.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs\spiffs_gc.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs\spiffs_hydrogen.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs\spiffs_nucleus.c.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs_api.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\spiffs_hal.cpp.o
Compiling .pioenvs\wemos\FrameworkArduino\time.c.o
Compiling .pioenvs\wemos\FrameworkArduino\uart.c.o
Compiling .pioenvs\wemos\FrameworkArduino\umm_malloc\umm_malloc.c.o
Archiving .pioenvs\wemos\libFrameworkArduino.a
Linking .pioenvs\wemos\firmware.elf
.pioenvs\wemos\src\main.cpp.o: In function setup': main.cpp:(.text.setup+0x0): multiple definition ofsetup’
.pioenvs\wemos\src\WiFiScan.ino.cpp.o:WiFiScan.ino.cpp:(.text.setup+0x24): first defined here
.pioenvs\wemos\src\main.cpp.o: In function loop': main.cpp:(.text.loop+0x0): multiple definition ofloop’
.pioenvs\wemos\src\WiFiScan.ino.cpp.o:WiFiScan.ino.cpp:(.text.loop+0x84): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\wemos\firmware.elf] Error 1
======================================================================================================== [ERROR] Took 7.89 seconds ========================================================================================================

================================================================================================================ [SUMMARY] ================================================================================================================
Environment d1_mini_lite        [ERROR]
Environment wemos               [ERROR]
======================================================================================================== [ERROR] Took 15.69 seconds ========================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

#10

You now have a main.cpp as well as WiFiScan.ino. Delete the main.cpp. Is this really a new, clean project?


#11

ok now we made proress

Processing d1_mini_lite (platform: espressif8266; board: d1_mini_lite; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_lite.html
PLATFORM: Espressif 8266 > WeMos D1 mini Lite
HARDWARE: ESP8266 80MHz 80KB RAM (1MB Flash)
Converting WiFiScan.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 26 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
Compiling .pioenvs\d1_mini_lite\src\WiFiScan.ino.cpp.o
Retrieving maximum program size .pioenvs\d1_mini_lite\firmware.elf
Checking size .pioenvs\d1_mini_lite\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [===       ]  34.0% (used 27872 bytes from 81920 bytes)
PROGRAM: [===       ]  26.3% (used 252384 bytes from 958448 bytes)
Configuring upload protocol...
Looking for upload port...
Auto-detected: COM6
Uploading .pioenvs\d1_mini_lite\firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
*** [upload] Error 2
======================================================================================================== [ERROR] Took 11.62 seconds ========================================================================================================

Processing wemos (platform: espressif8266; board: d1_mini_lite; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_lite.html
PLATFORM: Espressif 8266 > WeMos D1 mini Lite
HARDWARE: ESP8266 80MHz 80KB RAM (1MB Flash)
Converting WiFiScan.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 26 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
Compiling .pioenvs\wemos\src\WiFiScan.ino.cpp.o
Retrieving maximum program size .pioenvs\wemos\firmware.elf
Checking size .pioenvs\wemos\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [===       ]  34.0% (used 27872 bytes from 81920 bytes)
PROGRAM: [===       ]  26.3% (used 252384 bytes from 958448 bytes)
Configuring upload protocol...
Looking for upload port...
Auto-detected: COM6
Uploading .pioenvs\wemos\firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
*** [upload] Error 2
======================================================================================================== [ERROR] Took 11.57 seconds ========================================================================================================

================================================================================================================ [SUMMARY] ================================================================================================================
Environment d1_mini_lite        [ERROR]
Environment wemos               [ERROR]
======================================================================================================== [ERROR] Took 23.20 seconds ========================================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

#12

Ok then first of all remove the d1_mini_lite environment, the env:wemos already has everything.

I.e. your platformio.ini should be

[env:wemos]
platform = espressif8266
framework = arduino
board = d1_mini_lite
monitor_speed = 115200

#13

ok the same failure.
Configuring upload protocol…
Looking for upload port…
Auto-detected: COM6
Uploading .pioenvs\wemos\firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
*** [upload] Error 2


#14

Then put your Wemos into bootloader mode as described in https://www.esp8266.com/viewtopic.php?p=67614. (power Wemos, bridge D3 and GND, press reset button, remove bridge, re-upload)


#15

i did it all. All the ways . Nothing


#16

Then try first bridging D3 and GND, then powering it via USB and then uploading (while the bridge is still there).


#17

i did it. pressing the reset btn and without pressing. with short press and long. I smell dead end!!!


#18

without the bridge it fails in 2sec and with the brigde in11s


#19

I’m pretty sure it has something to do with the reset method of the board via the DTR / RTS pins (here, here).

You need to do the following things:

  1. ensure the Wemos is in bootloader mode. If you open a serial monitor at 74880 baud, and reset the board while D3 is connected the GND, the serial monitor should show a message like ets Jan 8 2013,rst cause:2, boot mode:(1,7). If this message is there, your ESP8266 is not dead. On Windows you can e.g. use hterm.exe as the serial monitor
  2. see if esptool.py can connect to it. Install it from Espressifs instructions as instructed here. Then see if the command esptool.py -p COM6 chip_id reads out some information. On my NodeMCUv2 it e.g. outputs
esptool.py v2.6
Serial port COM6
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 2c:3a:e8:06:XX:XX
Uploading stub...
Running stub...
Stub running...
Chip ID: 0x000617b1
Hard resetting via RTS pin...

Options for reset methods for esptool.py are also listed here. If you get one of these to work, we know where the problem is.


#20

they are DEAD.
At 74880

0000, depc=0x00000000
Fatal exception (0):
epc1=0x40100003, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0):
epc1=0x40100003, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

and with reset nothing …

and esptool.py -p COM6 chip_id
error.
thnx


#21

Seems like you give up too early. Read https://www.esp8266.com/viewtopic.php?f=6&t=15276. Also you should try to erase the flash using esptool.py -p <comport> erase_flash. What is the error message when you run that command?


#22

i read this topic and tried with bridge and resistros. how much resist it needs>??

C:\Users\hwa_r>esptool.py --port COM6 --baud 115200 erase_flash
esptool.py v2.6
Serial port COM6
Connecting……_____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header


#23

Pull-ups/downs are usually 10K in this case. You need to get your ESP8266 into serial bootloader mode somehow. (https://github.com/espressif/esptool/wiki/ESP8266-Boot-Mode-Selection)


#24

it doesnt work. i think that is a a strange case


#25

I found this because I was having trouble uploading to my wemos d1_mini. Connecting D3 to GND, pressing reset, removing D3 from GND then uploading again worked great! Thank you for the info on forcing the bootloader to work :+1:


#26

Okay… So I might have been a bit hasty in my comment. The trick did something. It seemed I could upload finally but I did not get the desired results. Trying an official example project did not work either. The boot loader trick stopped pushing the code through, if it even ever actually worked properly to begin with.

I tried a different wemos d1_mini board just in case… Same issue. I loaded it up in the arduino IDE and it did not work for the first time… Loosing a fair bit of hair at this point. I tried the other usb port option in the arduino ide and it uploaded without any issues.

adding upload_port = /dev/cu.wchusbserial1430 to my original project in platformio.ini produced ZERO ISSUES

Without forcing the upload_port it tries /dev/cu.usbserial-1430 which is wrong, as it does not work.

mac osx mojave 10.14.3
atom 1.35.1
platformio 3.6.5