Was that terminal the one inside VSCode, or outside it? Inside gives access to the pio command, outside needs either the PlatformIO-core installing, or, you need to install the commands from within VSCode itself, where there is an option to do so.
Please try the pio commands from the terminal inside VSCode. Terminal->New Terminal from the menubar, or, CTRL+SHIFT+# in the editor itself. Thanks.
You’re not imagining things - or if you are, we bother are! OneDrive is a pain in the at times - and not just because it is hard to remove cleanly.
@djnitrof I would try changing the default shell in VSCode back to the command prompt (as it is currently powershell) and see if that makes any difference to the pio commands being recognised.
If it was inside VSCode, then you should have the pio command available. It sounds to me like your reinstall failed somewhere. Let’s see if we can install the shell commands:
Please follow those instructions and add the PlatformIO folder to your path, then start a new commandline (windows key, R, type cmd, click ok) then cd to your source folder and try pio run again.
This is outside the editor this time please. If you still get unrecognised command errors then PlatformIO is most likely a failed install - as far as I can see.
been able to run PIO, but it fail to compile, seem that it cannot see correctly the include path again. even if I change it to add onedrive in platformio.ini file.
I’m surprised that it compiles with the Arduino to be honest. That error message implies that the code has a variable named select compiled in the same unit/file/header with a different data type. If I do this:
void setup() {
int fred;
char *fred;
}
The compiler complains. Not quite in the same manner though, so maybe there’s something else afoot!
Would you mind zipping up your latest PlatformIO version of the sketch and sending it to me directly please? Assuming there’s nothing confidential in it of course. I’d need the whole lot please.
One thing about lib_extra_dirs, the docs state that this This is a not direct path to a library with source code. It should be a path to storage that contains libraries grouped by folders. For example, D:\PlatformIO\extra\libraries but not D:\PlatformIO\extra\libraries\FooLibrary .
So if your version of FooLibrary has it’s source code in the folder ~/OneDrive/Documents/Arduino/libraries then that’s fine, but if the code for the library is in the ~/OneDrive/Documents/Arduino/libraries folder itself, the it’s not going to work.
Actually, does Windows recognise the use of ~ as the current user’s home directory these days? And does it recognise forward slashes in the Linux manner as directory separators? Perhaps you need to set this instead:
not so sensible program, but large one… with 5 of my libraries…
But investigating a little more, starting with a new compiling sketch, I tried to add one by one libraries, by now it seem to be ADC_Sampler that is not compiling.
I got only warning, but it still fail…
\OneDrive\Documents\Arduino\libraries\ADC_Sampler\src/ADC_Sampler.h:60:13: warning: 'void enableChX(uint8_t)' defined but not used [-Wunused-function]
static void enableChX(uint8_t pin){
^~~~~~~~~
Linking .pio\build\due\firmware.elf
.pio\build\due\libbba\libADC_Sampler.a(ADC_Sampler.cpp.o): In function `_GLOBAL__sub_I__ZN17ADC_Sampler_class11numChannelsE':
ADC_Sampler.cpp:(.text.startup._GLOBAL__sub_I__ZN17ADC_Sampler_class11numChannelsE+0x18): undefined reference to `ADC_sequencer_size'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\due\firmware.elf] Error 1
oups… did see that… to small text. I forgot an extern declaration…
I think I will try to add in the new project section per section the old code to see if I can find witch par is buggy…
[UPDATE] It seems that PIO compiler is very much more sensible that arduino one…
Going step by step, there was the select variable that put as redefine in another symbole, that was part of the SAM core, is was not causing problem before, but changin name fix that.
Also, PIO is very much more sensible to declaration order, I add to change order of many declaration and add some prototype to make it compile.
I’m afraid you have exhausted my knowlege of Windows and PlatformIO if so. Sorry. I do not understand how or why it works in command line mode but not from the editor itself. Weird.
Hi,
I also have had a similair problem. Re install did not solve it.
When compiling the simple Arduino blink example I got
" The terminal process failed to launch: Path to shell executable “c:\Users\name\Documents\PlatformIO\Projects\test6\pio.exe” does not exist. "
Very easy to solve however. In directory “C:\Users\name.platformio\penv\Scripts” I copied
“platformio.exe” to a new file “pio.exe”.
Realy very odd. On two other win10 computers platformio worked fine after installation without problems…
win 10 home (2020-04-23)
ver 1909
OS version 18363.1256
vs Code 1.52.1
PlatformIO core 5.0.4 home 3.3.1
Does your Windows username have spaces? Accented characters? Punctuation?
I notice your profile here is “Göran Nybom” – I suspect your username may have the accented ‘ö’ character. That causes problems sometimes. I’m not sure if it’s Windows, PlatformIO or python that suffers.
Can you create a new user without accents, spaces and punctuation, install VSCode and PlatformIO again and try another build. That should work.
Thank you for your very fast reply.
Understand me right, it works fine with the small workaround,
But it took some hours to find out that solution.
I´m well aware about the accents. I never use them as “users”.
In this case the user “name” was actual “gnyb”.
Just would like to contribute if somebody else get stuck in the same problem.
I installed the new cross-platform PowerShell as VSCode suggested and that fixed the issue for me. I tried reinstalling PlatformIO first but that didn’t solve it. I closed VSCode, installed the Win64 MSI from Releases · PowerShell/PowerShell · GitHub (VSCode sent me to 7.2.6), re-opened VSCode, and after about a minute, VSCode’s “Output” tab said it was installing PlatformIO Core, and after that, compiling worked again like it did about last year when I used it last. I no longer have the platformio.exe not found error.