I’m assuming you’re using the AVR-Arduino framework here, if not correct me.
Is there a folder ~/.platformio/packages/framework-arduino-avr? Does it contain the cores/arduino/Arduino.h file? Is the path to the core folder present in the .vscode/c_cpp_properities.json?
Have you install VSCode in a caged environment like a Flatpak or snap instead of the .deb version?
There is no such folder, nor .json file is present. This is what I have:
~ 130 ❯ ls -l .platformio/packages/
total 32
drwx------ 4 ike ike 4096 jūn 22 20:36 contrib-piohome
drwx------ 51 ike ike 4096 jūn 22 20:36 contrib-pysite
drwx------ 8 ike ike 4096 jūn 22 20:37 framework-arduinoespressif8266
drwx------ 8 ike ike 4096 jūn 22 20:37 toolchain-xtensa
drwx------ 2 ike ike 4096 jūn 22 20:37 tool-esptool
drwx------ 6 ike ike 4096 jūn 22 20:37 tool-esptoolpy
drwx------ 4 ike ike 4096 jūn 22 20:37 tool-scons
drwx------ 2 ike ike 4096 jūn 22 20:37 tool-unity
Sorry that is supposed to be in the hidden folder in the root of your project, not in ~/.platformio. Is ~/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h present?
~ ❯ head ~/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h
/*
Arduino.h - Main include file for the Arduino SDK
Copyright (c) 2005-2013 Arduino Team. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
.vscode file doesn’t mention this path, although there are many others.
~/Documents/PlatformIO/Projects/espk ❯ pio run -v
Traceback (most recent call last):
File "/usr/local/bin/pio", line 5, in <module>
from platformio.__main__ import main
File "/usr/local/lib/python2.7/dist-packages/platformio/__main__.py", line 21, in <module>
from platformio import __version__, exception, maintenance, util
File "/usr/local/lib/python2.7/dist-packages/platformio/maintenance.py", line 22, in <module>
from platformio import __version__, app, exception, fs, telemetry, util
File "/usr/local/lib/python2.7/dist-packages/platformio/app.py", line 23, in <module>
import requests
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 44, in <module>
import chardet
ImportError: No module named chardet
Can you Rebuild the IntelliSense and post the content of the .vscode/c_cpp_properties.json (pastebin if necessary)?
Have you installed PlatformIO twice? Once in the normal shell via some pip2 install platformio command and once when you installed the VSCode plugin? Two core are bad.
It’s best to execute the PlatformIO command in the PIO Terminal to get the same output as what would happen if VSCode executed it itself
It is especially bad that it says /usr/local/lib/python2.7/dist-packages/platformio/. PlatformIO should target Python3, Python2 was deprecated. If you have two cores then Use the built-in core of the system that you may have installed via pip. Though I definitely recommend to do a pip uninstall platformio and a pip3 install platformio. You should also match the python3 version as the default interpreter in VSCode.