Reputation: 191
I have been trying to use the Arduino extension for VS Code in Ubuntu 18, but when I execute the initialize command, I get the error "Cannot find the Arduino IDE. Please specify the arduino.path in the user settings". So I wrote every path that comes out when executing the command "whereis arduino", I've also tried leaving the box empty (in theory that makes VS Code search for the IDE) and reinstalling both the Arduino IDE and VS Code several times, without any result. Does somebody knows a possible fix for this issue?
Upvotes: 4
Views: 21812
Reputation: 442
Here's what fix my issue!
1st - Make sure you have the right path ("The path to the folder which contains the 'arduino.exe'", and not the path with the 'arduino.exe') copied to your Arduino Settings in VS Code.
2nd (The Actual Fix for me) - After installing the Arduino IDE and the VS Code extension RESTART you entire computer!! This somehow updates the Registry.
After which you can just Initialize your project, F1 - Arduino Initialize. That's it enjoy and start up your Golden IoT project.
Edit: Your main sketch filename must be exact name to your root directory name.
Folder (arduino-vs-test) Sketch (arduino-vs-test.ino)
Upvotes: -1
Reputation: 11
I use Windows and I solved it as follows.
The problem is because you are using the new version Arduino IDE 2.x.x and it has another way to code its sketches and more (I don't know how to say it, I'm a beginner in this) or you haven't activated to use Arduino Cli at least, so -- ->
Upvotes: 1
Reputation: 135
I found that running whereis arduino
or which arduino
gave me /usr/local/bin/arduino
. However, this didn't make Visual Studio Code happy. After some more digging, it turns out that that path is just a symlink to /opt/arduino-1.8.13
. (Use ls -la /usr/local/bin/arduino
to see where the symlink points to on your system.)
Also of note: be sure to give the path to the directory, not to the actual executable. For instance, in my case, the proper path was /opt/arduino-1.8.13
NOT /opt/arduino-1.8.13/arduino
!
Use /opt/arduino-1.8.13
, but be sure to update the version number to whatever is installed on your system.
Upvotes: 3
Reputation: 1048
Even when its on mac, someone can find this helpful as I had the same problem and found this thread. On MAC I have solved this one with arduino-cli and following:
brew install arduino-cli
/opt/homebrew/bin/arduino-cli
... Which means, if you run the command arduino-cli, it will execute this script... You can find the location with:
which arduino-cli
(I have zsh, I am not aware if it will be the same for older bash, probably it will, I am not so skilled in this one, but you can try to use find
instead of which
. But which
is working for me/opt/homebrew/bin/arduino-cli
"arduino.useArduinoCli": true,
"arduino.path": "/opt/homebrew/bin/",
"arduino.commandPath": "arduino-cli"
Note, even when the path to arduino-cli is /opt/homebrew/bin/arduino-cli
, we are removing the script name from the path... But we are adding this to the commandPath
Upvotes: 8
Reputation: 31
In my case whereis arduino
gave me /usr/bin/arduino
and /usr/share/arduino
, however putting either of them in the arduino.path
didn't work.
Entering /usr/bin
did the trick though. hope it helps!
(Ubuntu 20.04)
Upvotes: 0
Reputation: 51
Go to "User Settings" > "Extensions" > "arduino.commandPath" > change it to "arduino_debug.exe"
Upvotes: 0
Reputation: 76
This might not work for everyone, but the problem for me was using Visual Studio Code for flatpak. There was probably a better way to fix this, but the easiest way to do it (for me) was to install the binary from their website.
Upvotes: 0
Reputation: 161
sudo ./install
. In my case, I have downloaded Arduino 1.8.6 Linux 64 Bit .arduino.path
to the path location of extracted Arduino file. In my case it is /home/user/Downloads/arduino-1.8.6
and arduino.commandPath
to arduino
.{
"arduino.path": "/home/user/Downloads/arduino-1.8.6",
"arduino.commandPath": "arduino",
}
arduino.commandPath
if not already exist and should point to Arduino executable present in the arduino.path
.Upvotes: 8