[Solved] Fail to flash to WeMos D1 Mini with PlatformIO

I am getting the espconn error when trying to upload a sketch to a WeMos D1 Mini.

Are there some settings I need to change to tell PlatformIO that the serial port is connected to a WeMos as I don’t recollect telling the IDE which board is connected?

Presumably without this information it doesn’t know how to complete the upload.

I’m also unable to install any libraries. The last few lines of the error message are:

 File "c:\users\maja\.atom\packages\platformio-ide\penv\lib\site-packages\requests\sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "c:\users\maja\.atom\packages\platformio-ide\penv\lib\site-packages\requests\adapters.py", line 497, in send
    raise SSLError(e, request=request)
SSLError: hostname 'dl.platformio.org' doesn't match 'pioplus.com'

What do I need to do to be able to add your registered libraries like SimpleTimer and Blynk etc?

Also do you have an ETA for library installation via GUI rather than CLI?

Edit: Just to add I am trying to start with one of your existing projects esp8266-wifiscan which appears to have all the required libraries as the sketch compiles ok. I notice there is a file shown in the project called esp01, would I only be able to upload to an ESP01 until I change this to the correct ESP and if so where do I make the changes?

OK so I fixed the upload issue by editing the platformio.ini to include the following:

[env:d1_mini]
platform = espressif8266
framework = arduino
board = d1_mini
upload_speed = 115200

It also works with the more generic details of:

[env:esp12e]
platform=espressif8266
framework=arduino
board=esp12e

I don’t know how I got the libraries working for my Blynk sketch but that now compiles and uploads.

Fixed in development version

PlatformIO automatically detects upload port. If you want to control it manually, see upload_port option.

You can use temporary our Web Regsitry and specify lib_deps in the project. PlatformIO will find appropriate libraries automatically.

You can have multiple build environments in platformio.ini. It means, that you can simultaneously compile single source code for multiple targets. If you need to build specific target (board), see PlatformIO IDE: Quick Start and #6 step.