VS Code cannot find Arduino IDE path - visual-studio-code

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?

Download and extract the appropriate Arduino version according to your need from here, and install it using command sudo ./install. In my case, I have downloaded Arduino 1.8.6 Linux 64 Bit .
Goto Files -> Preferences -> Settings, Open Settings(JSON) as shown below.
Change 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.
OR
For those who installed Arduino through snap platform refer this post.
Your Settings JSON file should look like this.
{
"arduino.path": "/home/user/Downloads/arduino-1.8.6",
"arduino.commandPath": "arduino",
}
Save and restart.
It's Done!!
Good Luck
P.S.:Add arduino.commandPath if not already exist and should point to Arduino executable present in the arduino.path.

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:
install homebrew (if you have, proceed to step 2)
install arduino-cli with brew install arduino-cli
find where the arduino-cli is installed. Usually (on mac) it will be /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
lets assume you have the path, for me it was /opt/homebrew/bin/arduino-cli
proceed to VScode, go to settings (well, lets assume we will be working with the json settings
in my case, the input is following:
"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

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!
tl;dr
Use /opt/arduino-1.8.13, but be sure to update the version number to whatever is installed on your system.

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.

Go to "User Settings" > "Extensions" > "arduino.commandPath" > change it to "arduino_debug.exe"

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)

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 -- ->
Intall Arduino 1.8.x. You can donwload it here: Arduino Software
Open your vscode, go to Files>preferences>settings and find your Arduino extension under "Extensions". and put the standard path for Arduino 1.8.x like: C:\Program Files (x86)\Arduino (Remember this is where you installed the Arduino 1.8.x path) in "Arduino Path".
Next, you need to click on "Arduino: Use ArduinoCli" to link the Arduino extension to the correct version (Arduino Legacy is not allowed).
Arduino CLI option in vscode settings

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.

Related

How to get the executable from Github

How to get the exe from https://github.com/tsenart/vegeta/releases in order to test in windows?
This says I could find the .exe in this link but I don't.
I am trying to load test the apis in windows, as a start.
I do no know Golang and this project is developed using Go.
I would appreciate any directions on how to go about this. Thank you
For this version they didn't provide an executable for windows. If you check one minor version lower you find a .zip with an executable in it. If you need v12.8.4 you could write the people of the repository or just compile the code by yourself.
It looks like they only have executables ready to download for MacOS and linux on the newest version.
Version 12.8.3 however has a windows download.

gtk+ without msys2 mingw

On Windows, trying something with gtk+. I have downloaded Msys2, along with gtk+3.0.
Successfully compiled all the gtk+3.0 examples in the msys2 mingw-w64 terminal.
Now I want to move a bit further to try work without the msys environment.
I opened up cmd and navigated to where the example executables are compiled. Then I fired them up by typing "example.exe".
libgio-2.0-0.dll missing, not surprised. I go back to check the PATH environment of the msys environment, PATH=/mingw64/bin/:/usr/local/bin:/usr/bin/:/bin:/c/Windows/System32:..blablabla
So in the cmd environment I did set PATH=%PATH%;pathto/mingw64/bin; and run example.exe again.
This time it gave a very strange error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)
So I checked, indeed there was no inflateValidate function in the dll. it seemed to me that something thought the function is in the dll and tried to call it but because it doesn't exist so it failed. What I don't understand is that why did it not fail in the msys environment but failed in the windows environment. And does that bring any impact to me if I am going to ship any gtk application? I thought simply distributing the relevant dll would be enough.
I have tried instead of adding the mingw64/bin path to the PATH variable, but copying the required dll the the execute location 1 by 1, but at the end it still gave the same error.
I have also tried to search for other libpng*.dll in my computer, none of them contained the inflateValidate function.
If anyone know whats going on please shed some light to the question.
I might be very late to the party but I ran into the same issue yesterday (missing the inflateValidate symbol) and after checking the contents of the zlib1.dll file could ascertain that the function is just not there.
I downloaded another version (specifically this one https://sourceforge.net/projects/uqm-mods/files/latest/download, though I am in no way affiliated to this project) and saw that the inflateValidate symbol was indeed declared, so I suppose that the zlib bundled with your files is not up to date with the libpng requirements.
This solved my problem. I hope it solves yours too.

CoreServices.h file not found in portaudio build on macOS 10.11 Xcode 8.0

This is called though cocoa.h and foundation.h, then NSURLError.h. Not sure why this compiler error just came up when I added portaudio and some other needed frameworks. The error first comes from some existing code. Indeed, there is no CoreServices/CoreServices.h anywhere on the whole system. Do I need to update Xcode?
I found an Apple help answer that said "Those are not makefile directives. How are you trying to build it? Most projects like this come with "configure" scripts that you just need to run from the command line. The only thing you need from Xcode are the Command Line Tools." I don't know what this means or how to do this.
I did run the port audio/configure terminal script, but saw nothing about CoreServices.h being generated. Where does this need to come from?
Thanks.
I further note that in the CoreServices frameworks directory associated with the Xcode project, there is a terminal file called "CoreServices" that when run, generates the error "CoreServices.framework/Versions/A/CoreServices: cannot execute binary file" . What could it be missing?
It's hard to answer your question in this specific case but:
I believe that CoreServices.h can be found at /System/Library/Frameworks/CoreServices.framework/Versions/A/Headers/CoreServices.h, is it not the case on your machine? If not, you might have to re-install Xcode
To install PortAudio, you can also use brew with the command brew install portaudio and then link your project with its headers and libs (/usr/local/Cellar/portaudio/19.6.0/include and /usr/local/Cellar/portaudio/19.6.0/lib) in your Xcode project (under the tab Build Phases > Link Binary with Libraries). That might be the easiest option.

Eclipse Arduino makefile,subdir.mk Error

I've intsalled Eclipse and added Arduino plugin after when ı created new arduino sketch I faced to these errors.How Can ı fix these errors.
The solution is "Cygwin"
To install Cygwin:
From https://cygwin.com/install.html click setup.exe according to your computer’s version(32/64
bit)When it downloaded,click setup.exe and follow the steps.
1)Click Next
2)Install from internet
3)Determine the root directory for Cygwin
4)Choose the Install for All Users(Recommended)
5)Choose the right internet settings for you->Direct Connection
6)Choose A Download Site
7)Select packages ->Download all things under Base Default ->Search gcc and make,download all you find.
Set path in Windows on Preference Eclipse.
Find where Cygwin placed and copy the address.Go to Windows Control Panel->System and Security->System->Advanced
System settings->Environment Variables->System Variables->Path add a semicolon(;) and paste the address to here.
After Cygwin’s path adjustment ended, Here are the path on my computer:
AVR-GCC: C:\Programs\arduino-1.6.5-r2\hardware\tools\avr\bin
GNU make: C:\cygwin64\bin
AVR Header Files: C:\Programs\arduino-1.6.5-r2\hardware\tools\avr\avr\include
AVRDude: C:\Programs\arduino-1.6.5-r2\hardware\tools\avr\bin
These steps will fix the problem.
This worked for me:
On the IDE go to Windows->Preferences, then expand the Arduino tab and select Platforms and Boards. Then select all the items in package_esp8266com_index.json and install all the missing packages.
After that it compiled with no issues.
Let me know if it helped you too.
I found that the make.exe installed with ac6 tools was the cause . Replaced with make.exe installed with gnu tools download problem fixed

Eclipse: Cannot run program "cs-make": Launching failed

For the past week, i have been hunting a free development environment for STM32F1xx, which is supported by FreeRTOS. And no success yet :( .
Now I've found this: http://www.stf12.org/developers/ODeV.html
It's an Eclipse configuration for STM32 compiling and debugging, and there is a FreeRTOS demo too. Perfect!
So I downloaded a preconfigered version of eclipse and tried to compile a demo project to get this error:
Cannot run program "cs-make": Launching failed.
Depressing. Please help, i am very bad at configuring IDE's, compilers and linkers so this has to be newbie-friendly :)
The Eclipse project is configured for CodeSourcery toolchain. You need to install CodeSourcery compiler toolchain from: http://www.mentor.com/embedded-software/codesourcery. Choose Lite Edition, ARM-NONE-EABI package. After the installation make sure you can start cs-make from command prompt (by typing it's name there). Generally, you want all toolchain programs to be accessible from command prompt, which implies that their installation path must be in system PATH variable.
P.S.
Make sure the path DOES NOT contain spaces like standard Windows programs directory "C:\Program Files", instead install the tools in a directory like "C:\arm-none-eabi", "C:\ARM_tools" or something like that.
Ah, thank you got it to work now!
And I ran into another problem too. When I tried to compile another error came up saying something like: "C:\Program is no file or directory". I Solved it by placing all compilers and OpenOCD in the root of my C-drive. I think it's because the make doesn't understand spaces in the make file, if anyone else get the same problem.