Rcayot
Posts: 16
Joined: Sun Jan 26, 2020 8:24 pm

how to add to PATH

Wed Sep 30, 2020 4:46 pm

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

User avatar
jahboater
Posts: 6306
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: how to add to PATH

Wed Sep 30, 2020 4:50 pm

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
Pi4 8GB running PIOS64 Lite

Rcayot
Posts: 16
Joined: Sun Jan 26, 2020 8:24 pm

Re: how to add to PATH

Wed Sep 30, 2020 5:23 pm

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

dbrion06
Posts: 197
Joined: Tue May 28, 2019 11:57 am

Re: how to add to PATH

Wed Sep 30, 2020 5:30 pm

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)

GlowInTheDark
Posts: 1092
Joined: Sat Nov 09, 2019 12:14 pm

Re: how to add to PATH

Wed Sep 30, 2020 5:31 pm

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.
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

Loves Linux; loves to dance.

Rcayot
Posts: 16
Joined: Sun Jan 26, 2020 8:24 pm

Re: how to add to PATH

Wed Sep 30, 2020 5:46 pm

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

User avatar
jahboater
Posts: 6306
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: how to add to PATH

Wed Sep 30, 2020 6:11 pm

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.
Pi4 8GB running PIOS64 Lite

GlowInTheDark
Posts: 1092
Joined: Sat Nov 09, 2019 12:14 pm

Re: how to add to PATH

Wed Sep 30, 2020 6:57 pm

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).
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

Loves Linux; loves to dance.

User avatar
jahboater
Posts: 6306
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: how to add to PATH

Wed Sep 30, 2020 8:06 pm

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
Pi4 8GB running PIOS64 Lite

Return to “Beginners”