Hey guys, the title says it all, I tried to install arduino_cli on my raspberry, but several things are going wrong.
First of all, when I do:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
I get this:
Downloading https://downloads.arduino.cc/arduino-cli/arduino-cli_0.20.2_Linux_ARMv7.tar.gz Mv7.tar.gz
An existing arduino-cli was found at . Please prepend "/home/pi/bin" to your $PATH or remove the existing one. TH or remove the existing one.
arduino-cli Version: 0.20.2 Commit: 13783819 Date: 2021-12-09T13:32:05Z installed successfully in /home/pi/bin
That line in the middle there is weird, becouse this is an entirely clean and new install of ubuntu for raspberry, and also its found at... nothing? but in the end it says it installed succesfully, so I thought what the h. but when I tried to simply do
arduino_cli --version
it said:
-bash: arduino-cli: command not found
so I decided to do what it suggested by adding to the path like so:
EXECUTABLE_PATH="$(command -v $PROJECT_NAME)"
if [ "$?" = "1" ]; then
The exit status of command when the command was not found turns out to be shell dependent. On Bash it is 1, but in POSIX sh, it is instead 127. So this conditional is not evaluating as true in the case where the arduino-cli command was not found.
I'll get this bug fixed ASAP.
For now, please just ignore this message. It is only a convenience feature. If you got to this point in the installation then it was successful and you now have Arduino CLI on your machine.
That is because it is not in your path. If you specify the path to the executable:
/home/pi/bin/arduino-cli --version
then you will not get that "command not found" error.
You messed up the path by adding that ~ prefix.
Arduino CLI was installed at /home/pi/bin. ~ is an alias for /home/pi when you are logged in as the pi user, so the path you specified was /home/pi/home/pi/bin, which does not contain arduino-cli (and likely doesn't even exist).
The Snap package is not officially maintained by Arduino, but you are welcome to share details about that failure if you want assistance with it.
Thanks for the reply, you where correct, it was the ~ that was the mistake, always the small mistakes that trip us up.
But glad I was able to bring attention to an actual bug to.