I am running PlatformIO in VScode on Windows; all works well.
Now I have this idea of migrating to Linux, installed VScode and PlatformIO and was wondering, whether I can code my projects in the same project folder, I worked on in Windows?
I have a SSD I share between the two operating systems.
As one can guess the paths to files are different.
In my case Windows D:\Data\... is in Linux /media/maxg/Data SSD/Data/...
Indicating to me that libraries and compil paths are different between the systems.
Has anyone found a solution to this problem?
Or is there a way of achieving this?
Do you use dual boot or these are different physical machines?
It’s possible to run Visual Studio Code remotely, so that you connect from one machine to another. All projects and libraries are stored remotely, the project is built on the remote machine too. See Visual Studio Code Remote Development
I dual boot between Windows and Linux, and share two hard drives between both of them, one which has my PlatformIO/Arduino/etc project on it. I don’t have any path issues, as I don’t hard-code any paths into the platformio.ini or any extra_scripts that I might need. The only issue you might encounter is options like upload_port requiring a different reference, so in that case I usually have both listed, and comment out that invalid one.
Yes, same here…
I did not hard-code any paths, however, I see things like this:
… despite having installed PubSubClient and Ethernet libraries.
My install went as follows:
selected PIO extension
installed PubSubClient, Ethernet…
opened the project folder on the shared drive
loaded the WaterLevel main.cpp
And this is where I am now.
I would expect that when I have a clean install and open a .cpp file that at elast the installed libraries would not be indicated as ‘cannot open source’.
I sometimes have the same problem, but it usually goes away after I close the folder, and re-add it to VSCode. This is after I have run through a build, so that all the necessary toolchains and framework files are installed, as until that’s done… those warnings from IntelliSense are indeed correct because any missing tools/framework files will be installed when you try to build / upload.
Also, when you look at your .vscode\c_cpp_properties.json file, you may notice it has Win32 and linux paths in it, or just the paths that relate to the last OS you were on. Deleting that file, and re-adding the folder to VSCode may also fix up IntelliSense as it will force a full update. Once it’s working, it usually behaves from then onwards… only occasionally do I have to poke something to make it work properly