Page 1 of 1

how to add to PATH

Posted: Wed Sep 30, 2020 4:46 pm
by Rcayot
Hello,

I recently tried to add a board to my Arduino IDE, it apparently needed an NRFutil program which I installed, and got the following message:
"The script adafruit-nrfutil is installed in '/home/pi/.local/bin' which is not on PATH."

Also when I tried to install the board, the Arduino IDE gave the following message:

nrfutil not available on this operating system.

So, the board installation page has this advice:

"Add pip3 installation dir to your PATH if it is not added already. Make sure adafruit-nrfutil can be executed in terminal by running"

anyway, how do I add this to PATH?

Roger

Re: how to add to PATH

Posted: Wed Sep 30, 2020 4:50 pm
by jahboater
Rcayot wrote:
Wed Sep 30, 2020 4:46 pm
anyway, how do I add this to PATH?
If you want it first on the search path:

Code: Select all

PATH=/home/pi/.local/bin:$PATH
or last on the search path:

Code: Select all

PATH=$PATH:/home/pi/.local/bin

Re: how to add to PATH

Posted: Wed Sep 30, 2020 5:23 pm
by Rcayot
Thanks, that partially worked!

When I run from terminal

:pi@raspberrypi:~ $ adafruit-nrfutil version
adafruit-nrfutil version 0.5.3.post12
pi@raspberrypi:~ $


nrfutil file is found, but when I try to install the board on the Arduino IDE, I get the following message:

"Tool nrfprog is not available for your operating system"

Still stuck, will go back to Adafruit customer support... but anything anyone here can help with would be great!

Roger

Re: how to add to PATH

Posted: Wed Sep 30, 2020 5:30 pm
by dbrion06
Did you have a look at:
https://github.com/adafruit/Adafruit_nR ... issues/225
(that is not a very good new: Nordic seems to ship nfrprog for x86....https://infocenter.nordicsemi.com/pdf/n ... s_v1.0.pdf p7)

Re: how to add to PATH

Posted: Wed Sep 30, 2020 5:31 pm
by GlowInTheDark
Note that there are at least 3 different questions being asked here:

1) How do I add something (temporarily) to my $PATH variable in the shell?

2) How do I do the above in a way that is permanent (i.e., will persist across different invocations of the shell and/or reboots) ?

3) What is wrong with my Arduino IDE installation? Why doesn't it "just work" like it should?

#1 has been answered above.

I suspect #3 is the one the OP is actually interested in.

Re: how to add to PATH

Posted: Wed Sep 30, 2020 5:46 pm
by Rcayot
well yes, #1 has been answered.

I suspect that I need to have #2 answered. Then I can see if that will help with #3 as the guide on Adafruit for the board says that testing the path by running a simple 'version' argument will result in an an error free version, and it does, but still does not get me past the board install.

Thanks,

Roger

Re: how to add to PATH

Posted: Wed Sep 30, 2020 6:11 pm
by jahboater
Rcayot wrote:
Wed Sep 30, 2020 5:46 pm
well yes, #1 has been answered.

I suspect that I need to have #2 answered.
That's easy.
There is a file in your home directory called ".bashrc"
You may edit it with "nano ~/.bashrc" and add the PATH= stuff there.
It will then always be available.

Re: how to add to PATH

Posted: Wed Sep 30, 2020 6:57 pm
by GlowInTheDark
Actually, it is better to set PATH in .profile than .bashrc (or other places).

By the way, I often see references to .local/bin or maybe .config/bin or whatever. Where do these comes from? I always just use ~/bin (which is what the code in the .profile supports).

Re: how to add to PATH

Posted: Wed Sep 30, 2020 8:06 pm
by jahboater
GlowInTheDark wrote:
Wed Sep 30, 2020 6:57 pm
By the way, I often see references to .local/bin or maybe .config/bin or whatever. Where do these comes from? I always just use ~/bin (which is what the code in the .profile supports).
See .profile as you suggested above ...

Code: Select all

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi