PlatformIO Core 5.0 šŸš€

Could you reproduce this issue on other clientā€™s machines? What is your OS? Do you use 3rd party antivirus tools? How is your internet connection? Do you use VPN? (PlatformIO needs an Internet connection to download dependent toolchains, etc)

If the only value which PlatformIO brings to you is ā€œintellisenseā€, please take a look at Arduino - Visual Studio Marketplace or Arduino IDE 2.0 Beta.

PlatformIO was not invented to add ā€œintellisenseā€ for Arduino IDE or other frameworks. The mission is to allow any developer to work with different hardware and software frameworks without having an electronic degree. Also, give developers a choice to build their own development environment. We donā€™t force people to VSCode or Windows. Our goal is to support the most popular IDEs/code editors and operating systems.

Being fully independent of IDE/OS, developers can move their projects between the host machines, and PlatormIO guarantees full reproducibility. Also, team members can collaborate on the same project using the different combinations of IDE + OS, or CLI. All of them use one place to provide configuration - platformio.ini.

1 Like

Yes. I can. Thatā€™s why I have to anydesk in to a clientā€™s machine to do firmware updates. because platform i/o works badly. On both remote machines at his desk.

Just like it does on my old windows install. And my new windows install. And windows in a VM. And Linux as a host OS. And linux in VM.

YES I CAN REPRODUCE. Pick a configuration, and over a long enough timeline (not very long) I can reproduce stability issues with your product.

If it wasnā€™t regularly having issues, I wouldnā€™t be writing it right now.

You want to know how to reproduce one right now?

Take an ESP-IDF project from one machine, place in on a target machine that has never had ESP-IDF installed before.

Open folder in VS Code on the new machine (with platform IO installed)

itā€™s not going to build.

The workaround is to create a new project with the same board/platform/framework settings as your desired project on the target machine, forcing it to download the necessary bits. Then you can open the original project.

I know dozens of work arounds like this for as many problems. That is the problem.

It needs to be tested. And it needs to actually be used for more than toy development in the wild or all it will ever be is a toy for making toys.

PlatformIO was not invented to add ā€œintellisenseā€ for Arduino IDE or other frameworks. The mission is to allow any developer to work with different hardware and software frameworks without having an electronic degree.

Funny, because as I said, I have a literal electrical engineer who makes me anydesk to run platform io on his end because heā€™s had too many issues with it.

So maybe you should make it work for the people with the electronics degrees first at least? And then everybody else?

And if intellisense for IoT development wasnā€™t platform IOā€™s mission thatā€™s really too bad, because itā€™s the best part of platform IO

Our goal is to support the most popular IDEs/code editors and operating systems.

In practice, itā€™s used with VS Code. It doesnā€™t matter that it was intended for other editors if thatā€™s not how people use it. Wake me when it works with Visual Studio.

Iā€™m not going to look at the arduino offering. Iā€™m already done with them. Iā€™ll take a look at the other, but right now Iā€™m happy with VisualGDB. If I had known about it before I would have skipped PIO and the Arduino IDE entirely.

Hello,
Pardon me for jumping inā€¦

Iā€™ve just done my once every decade task of completely wiping my laptop, reinstalling only the stuff I need, and getting rid of the cruft Iā€™ve installed over the years.

I copied back all my Arduino and plain AVR projects, with VSCode and PlarformIO installed, but no frameworks yet.

Compiling the first Arduino project correctly downloaded and installed the necessary framework and tools. No problems at all.

This is on Linux (Mint 20.1) and the latest VSCode. I have a Windoes 10 box lying around unloved that I can try this on.

Is there a test ESP-IDF that you know gives problems, that I can borrow to test please? Iā€™ve never had ESP-IDF installed on either Linux or the Win 10 box, so would be an interesting test.

Stupid question, maybe, when you copy the project which subsequently fails, do you copy just the sources or all of it, including the compiled binaries and any used libraries?

Cheers,
Norm.

1 Like

I forgot to mention in that, donā€™t copy the .pio folder (since itā€™s part of .gitignore) - itā€™s build cache stuff, itā€™s not the project bones. I can prepare a test. This particular problem Iā€™ve tested on windows - two different windows installs. This should do it. GitHub - codewitch-honey-crisis/perftest

Itā€™s just some virtual filesystem code iā€™m fleshing out. You may have to modify platformio.ini as most people donā€™t have a WROVER ESP dev kit nor have to worry about itā€™s dual COM ports, but I like the upload speeds i get.

Thanks.

If I get a chance tomorrow, Iā€™ll see if I can crash out PlatformIO on my Linux box, and if not, on Windows 10.

I have my first covid vaccination tomorrow, so I might be waiting in line for a while!

Cheers,
Norm.

Good luck with that! Above is the most recent project where Iā€™ve had it happen on two different windows installs (both windows 10 home). I havenā€™t tried it on linux since all my linux boxen need to be rebuilt. (moving away from ubuntu 18.04 because it started having major issues and i canā€™t trust it any longer but i havenā€™t had the time)

a quick git clone, cd wherever, code . and click the PlatformIO compile button gives an error:

ā€œcommand ā€˜platformio-ide.buildā€™ not foundā€ in vscode.

I did not change anything and I do not have the hardware, so no software installed yet. I did not use PlatformIO Home or anything, just opened in VSCode, and clicked compile.

I do have the PlatformIO commands on my $PATH, so I can use them from a terminal session.

On the command line, pio run works perfectly. It downloaded a pile of stuff (technical term) and compiled just fine:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   5.0% (used 16448 bytes from 327680 bytes)
Flash: [====      ]  40.6% (used 426064 bytes from 1048576 bytes)
esptool.py v3.0
======================== [SUCCESS] Took 127.82 seconds

On Linux. I have not tried Windows as it seems I have recreated your problem, or one similar.

Is this the same as what you are seeing?

Cheers,
Norm.

Here are some better details, Iā€™m back from my vaccination, and had a bit more time to recreate your scenario, or at least, something that resembles it.

Steps to recreate:

  • Delete all the tools in $HOME/.platformio/packages.

  • In command line:

    mkdir xxx
    cd xxx
    git clone https://github.com/codewitch-honey-crisis/perftest.git .
    code .
    

    VSCode opens with the xxx folder open.

  • Click on toolbar build icon/button. Fails almost immediatley with ā€œcommand ā€˜platformio-ide.buildā€™ not foundā€ error message at lower right.

In $HOME/.platformio/packages, I now have the following new directories:

  • framework-espidf
  • toolchain-esp32ulp
  • toolchain-xtensa32
  • tool-cmake
  • tool-ninja

However, I didnā€™t look inside to see if there were any files.

  • Click build toolbar button again and this time it successfully builds after downloading and installing/extracting various packages. Unfortunately, the names and details have scrolled off the top of the VSCode terminal session for the build.

The same problem does not appear if I start again, and without opening VSCode, I simply run the command line options to compile the project:

pio run

It downloads and extracts the tools etc, then builds a lot of stuff, but it works fine with no errors. Finishes with ā€œSUCCESSā€ message after 271.17 seconds. (My laptop is only a dual core jobby with 8GB RAM (maxed out), and is over 10 years old!)

I do not have the PlatformIO-core installed, only PlatformIO-ide within VSCode, but I have added my $HOME/.platformio/penv/bin directory to my $PATH, so the commands are available.

Python3 is the only version of Python installed. Itā€™s actually version 3.8.5 and when PlatformIO is installed, it doesnā€™t install itā€™s own version of Python (into $HOME/.platformio/penv/bin) but links to the systemwide installed version:

norman@hubble:~/.platformio/penv/bin$ ls -l python*
lrwxrwxrwx 1 norman norman 16 Feb 26 11:16 python -> /usr/bin/python3
lrwxrwxrwx 1 norman norman  6 Feb 26 11:16 python3 -> python
lrwxrwxrwx 1 norman norman  6 Feb 26 11:16 python3.8 -> python

Nevertheless, I have VSCode configured to ā€œUse a portable Python3 installation, if availableā€ in the PlatformIo options.

So, long story short:

  • I can recreate something like your problem straight away if I open a folder with a project which I donā€™t have the tools for on my laptop.
  • I appear to be able to compile and build it on the second attempt from within VSCode.
  • I have absolutely no problems compiling from scratch, in the command line, using the exact commands/scripts that PlatformIo is calling from within VSCode.
  • I have only tested this on Linux.

One question, what version of Python are you using? Did you download an installer from python.org? Or did Microsoft install a version for you? I ask because recently it seems that the Microsoft version doesn;t work for a number of people whereas the python.org version does.

and, Python 3.9 has itā€™s own problems, or had until recently. Stick with 3.8 for now.

HTH

Cheers,
Norm.

Thanks for the detailed breakdown. Iā€™m sure that took some time and I appreciate it. Iā€™m pretty sure python was installed at the same time as PlatformIO (unless Git installs it) - at least the second time i got it to happen. The first time it happened, I had installed the ESP-IDF from Espressifā€™s site and was developing with that in the raw (using idf.py) before putting platform IO in.

I donā€™t know how to get the version of python used by the PlatformIO tool chain because the command prompt in VS Code under PlatformIO doesnā€™t have it in the path for some reason.

No worries. You are having a problem that Iā€™ve not seen before, I got interested. Mr Nosey, thatā€™s me, plus I actually work in IT Support in real life. Iā€™m an Oracle DBA,when Iā€™m working I am!

To see the Python version, which is installed with PlatformIO 5.x,if I remember correctly, just go to C:\Users\YOUR_NAME\.platformio\penv\Scripts in acommand-line session and run the python you see there.

If you add C:\Users\YOUR_NAME\.platformio\penv\Scripts to your %PATH% in Control Panel, youā€™ll get all the command-line stuff for PlatformIO. So, no more VSCode to create projects, just a quick:

mkdir xxx
cd xxx
pio init --board uno

Obviously, replace uno with your board name. Job done.

Iā€™m interested to know if you are able to copy down a project for which you donā€™t have the tools installed and build it with pio run in the same folder as the platformio.ini file.

It works fine here.

Oh, git doesnā€™t install python, as far as Iā€™m aware.

Cheers,
Norm.

1 Like

Thanks, Iā€™ll give it a shot when I get a chance later today. Iā€™ve got a fire to put out first. =)

1 Like

I tried cloning that project (GitHub - codewitch-honey-crisis/perftest), and running it on my Windows 10 system, with no issue. Note that I didnā€™t clear my ~3.6GB %userprofile%\.platformio\packages directory firstā€¦ not waiting for all that to download again! :laughing:

btw, probably not a good idea to blow it away completelyā€¦ contrib-piohome and contrib-pysite probably wonā€™t get re-installedā€¦ and thus you kill PIO Home in the process! :open_mouth: (Ok, PlatformIO will reinstall piohome if it is run. Iā€™m not sure what part of PIO depends on pysite, but it will hopefully reinstall if needed. Looks some some parts of PIO really are idiot-proof!! :laughing: ).

Even if I do move out the contents of %userprofile%\.platformio\packages, and re-open VSCode, after waiting for the ā€˜PlatformIO: Rebuilding IntelliSense Indexā€™ statusbar notification to go away (which is when itā€™s ensuring all the toolchain and libraries are downloaded / installed), it built fine.

There are some issues with PlatformIO and the VSCode extension (which is where most problems come fromā€¦ if you run the platformio cli instead, youā€™ll probably find all your problems go away completely). The 2.3.0 extension, released four days ago, now allows you to select which project and while environment is compiled when you click the statusbar build and upload iconsā€¦ hence it will compile the wrong one if the selector hasnā€™t been changed. :man_facepalming: :man_facepalming: