I’m a complete newbie to programming and all the VSCode + PlatformIO jazz. I need to modify and compile Marlin firmware for my Ender 3 Pro (recently upgraded the mainboard to a SKR Mini E3 V2.0). I really need to activate some features in the board which following some tutorials should be extremely simple, but I can’t even open PlatformIO IDE inside VSCode neither Atom, which has been a very frustrating experience.
VSCode installation runs smoothly, as well as installing the PlatformIO IDE extension. However, after installation, whenever I try to open PIO Home or any of the extension tabs I get an endless “Loading” screen, which then after 30 or so seconds evolves to the following error message:
HTTPSConnectionPool(host=‘api.registry.ns1.platformio.org’, port=443): Max retries exceeded with url: /v3/packages/platformio/tool/contrib-pysite (Caused by SSLError(SSLError(1, u’[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),)) at /Users/FlavioMark/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:5625 at ChildProcess.c (/Users/FlavioMark/.vscode/extensions/platformio.platformio-ide-2.2.1/node_modules/platformio-node-helpers/dist/index.js:1:879169) at ChildProcess.emit (events.js:223:5) at maybeClose (internal/child_process.js:1021:16) at Socket. (internal/child_process.js:…
Also, I’ve noticed that I do get the “alien” head icon in my extensions bar (left side of the screen), and I can open and read “platformio.ini”, but I can’t do anything in terms of compiling since none of the tools on the blue bar (bottom left corner) are loaded, as if the extension is not activated. I have tried uninstalling and installing both VSCode and PIO several times now, with no success.
I’m using a mid 2015 MacBook Pro, which is running macOS Sierra (version 10.12.6). It has been a while since I lastly updated the system and I have no clue if this might be getting in my way to solve this issue. I’ve seen people with similar problems using Windows which eventually were solved after they deleted something related to a “/penv folder”, but I don’t know where to find such a folder inside macOS. Some other people reported that the issue could be related to anti-virus. I had Avast installed in my computer and uninstalled it, again with no success.
I feel like it’s a simple issue that is holding me back, and any input from the community will help a lot. Thanks in advance for helping a noob in need!
That is the “Not After 2/12/2021, 6:27:49 PM (Central European Standard Time)” date and is the same as mine.
So all certificates are okay and you can do a normal HTTPS handshake against the website, no idea why PlatformIO is complaining.
I can recommend two things: Open a PlatformIO CLI and execute pio upgrade --dev to upgrade to the latest development core. Then restart VSCode.
If the problem still appears, again open a CLI terminal and type pio home --port 8009. It should start a local PIO home server on port 8009 localhost and directly open a browser to it. Is the page working there / are there errors? (some buttons like project explorer only work within VSCode though)
Oh wait actually I do see a problem. It’s trying to install the pysite package for Python 2.7. Mac OS is special in that regard because it has Python 2.7 as system-wide Python installation, but the PlatformIO extension brings its own Python 3 interpreter and must absolutely run within that Python3 interpreter. Now if you opened a PIO terminal and types pio upgrade --dev and it wanted to upgrade Python 2.7 that’s a bad indication that PIO is running under 2.7.
If you execute pio system info it will also show you the interpreter it’s running on, so you can double check that.
Have you ever installed PlatformIO using the pip (2) of the system? You may have multiple PlatformIO cores. I suggest you try a clean uninstall and reinstall. pip uninstall platformio in a system shell if it was ever installed there, then remove the VSCode PIO extension, delete the PlatformIO folder (rm -rf /Users/<user>/.platformio/), restart VSCode and reinstall the VSCode PIO extension. Maybe that helps.
Hey Max! I have never tried installing and uninstalling using the Pip of the system, but I’m willing to try the uninstall and folder deletion. Do I do this trough Mac’s terminal? (Sorry for a probably very noob question, hahaha)
So here’s the PIO System Info. It tells me that I’m running a Python 2.7.10-final.0
I have clicked on /Users/FlavioMark/.platformio/penv/bin/platformio to open it in the file Editor, and it prompted these two windows about Python, I believe it can be useful.
Then I might be wrong about it absolutely needing Python 3 and maybe Mac OS is another exception here. Maybe @ivankravets can help you furhter here – after a clean uninstall of all possible multiple cores, a reinstall, checking the certificates and disabling the firewall I don’t know what more to do.
Thank you very much for your time and help, Max! Does it mean I might need to update python to version 3? Anyway, I’ll wait for Ivan’s reply and see if he has any different recomendations. Once again, really appreciate your time and availability.
Mac OS is inherently using Python 2, updating its system Python should not be done. That’s why PlatformIO has its Python virtual environment in its penv folder which can use an arbitrary Python installation, and all nicely separated from the system – at least that’s how it’s supposed to be.