ASK for help: cannot upload my program to my board

Basic information: Win10x64, VScode,


, Arduino Uno.
When I try to upload my program to my Arduino Uno(it’s fine when compiling). It failed and give :

Tool Manager: Installing platformio/tool-avrdude @ ~1.60300.0
Error: Traceback (most recent call last):
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\commands\", line 44, in invoke     
    return super(PlatformioCLI, self).invoke(ctx)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\click\", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\commands\run\", line 133, in cli    
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\commands\run\", line 175, in process_env
    result = {"env": name, "duration": time(), "succeeded": ep.process()}
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\commands\run\", line 79, in process
    result =, build_targets, self.silent, self.verbose,
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\platform\", line 60, in run
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\platform\", line 74, in autoinstall_runtime_packages
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\package\manager\", line 48, in install
    pkg = self._install(
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\package\manager\", line 99, in _install
    pkg = self.install_from_registry(spec, search_filters, silent=silent)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\package\manager\", line 83, in install_from_registry
    package = self.fetch_registry_package(spec)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\package\manager\", line 144, in fetch_registry_package
    result = regclient.get_package(self.pkg_type, spec.owner,
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\clients\", line 136, in get_package
    return self.fetch_json_data(
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\clients\", line 144, in fetch_json_data
    response = self.send_request(method, path, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\", line 73, in wrapper
    return func(*args, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\clients\", line 123, in send_request   
    return getattr(self._session, method)(path, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\requests\", line 555, in get
    return self.request('GET', url, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\platformio\clients\", line 61, in request
    return super(EndpointSession, self).request(
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\requests\", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\requests\", line 655, in send
    r = adapter.send(request, **kwargs)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\requests\", line 439, in send
    resp = conn.urlopen(
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\", line 696, in urlopen
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\", line 964, in _prepare_proxy  
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\", line 359, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\", line 500, in _connect_tls_proxy  
    return ssl_wrap_socket(
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\util\", line 432, in ssl_wrap_socket      
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
  File "c:\users\labourerlu\.platformio\penv\lib\site-packages\urllib3\util\", line 474, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\Users\LabourerLu\.platformio\python3\lib\", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\LabourerLu\.platformio\python3\lib\", line 997, in _create
    raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname


An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section

* Report this problem to the developers


终端进程“C:\Users\LabourerLu\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'”已终止,退出代码: 1。


> Executing task in folder TEST: C:\Users\LabourerLu\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing uno (platform: atmelavr; board: uno; framework: arduino)

What can I do to upload my program successfully?

Seems like either a bug in PlatformIO or the urllib3 library, maybe in conjunction with a set Proxy URL in the system settings. Also reported in here.

Can you do the following: Open a CLI and execute

C:\Users\LabourerLu\.platformio\python3\python.exe -m pip install urllib3==1.25.11

then retry building. Does it work now?

Edit: Also see Change between 1.25.11 and 1.26.2 cause SSL issues for Proxy POST · Issue #2075 · urllib3/urllib3 · GitHub, might have something to do with proxy HTTP and HTTPS configuration.

1 Like

Please check this docs PlatformIO IDE for VSCode — PlatformIO latest documentation

After excuting

C:\Users\LabourerLu\.platformio\python3\python.exe -m pip install urllib3==1.25.11

my CLI returns that :

Could not fetch URL There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /simple/urllib3/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1123)'))) - skipping
ERROR: Could not find a version that satisfies the requirement urllib3==1.25.11
ERROR: No matching distribution found for urllib3==1.25.11
Could not fetch URL There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1123)'))) - skipping

And when I try to upload, it still doesn’t work.

Then it’s very likely the SSL proxy settings that’s the problem.Follow Ivan’s link above.

I set my proxy setings like this:

    "C_Cpp.updateChannel": "Insiders",
    "explorer.confirmDelete": false,
    "http.proxySupport": "on",
    "window.zoomLevel": 1,
    "http.proxy": "http://user:pass@",
    "http.proxyStrictSSL": false,
    "http.proxyAuthorization": null

but it still doesn’t work.(can not upload)

I wonder if I reinstall my VS code and platformIO works.

You copied this directly from the documentation? You need to supply the correct user, password, IP and port of the proxy of your network here for it to work. You are in a network that has a proxy, yes?

While the funny thing is that after I reinstalling my VS code, it works.