# Raspberry on the road

**URL:** <https://discourse.nodered.org/t/raspberry-on-the-road/31096>\
**Category:** General\
**Created:** [3 August 2020 21:33 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096 "2020-08-03T21:33:18Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [3 August 2020 21:33 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/1 "2020-08-03T21:33:19Z")

</div>

I am trying to simplify the connection of my raspberry to the different wifi networks that I meet in my travels.  
I created an ui page in which I can launch my functions (radio, tv and sites consultation). I also created a form that allows me to enter the ssid, the password and the security type to feed a flow that produces a wpa\_supplicant.conf file to overwrite the existing one.

My problem is that this flow generates the following error: "EACCES: permission denied; open '/ etc / wpa\_supplicant ..."  
Of course, I could modify the permissions of the file but I am surprised that node-red which a proiori runs as root, does not have the necessary permissions.  
Could someone confirm that for me?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 August 2020 21:56 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/2 "2020-08-03T21:56:59Z")

</div>

By default if using the service, Node-RED runs as the pi user not root.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 August 2020 08:11 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/3 "2020-08-04T08:11:57Z")

</div>

If you add a new group (possibly wificonf for example) and add the user the that group, then change the permissions on the file to root:wificonf and allow group members to write to the file then you will be able to edit it from node-red (note, edit not replace). So you would need to modify the script to write to it rather than replace it.  
Alternatively you could use an existing group such as `adm` that the user may already be a member of.

In case you did not realise, if you add the new network to the file rather than completely replacing it then it will automatically connect when you are at that location again.

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 12:57 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/4 "2020-08-04T12:57:05Z")

</div>

Thank you for this explanation.  
But then, how to do so that all users of the raspberry can access  
to the node-red ui of pi (without accessing the flow editor if possible) and execute the commands assigned to the buttons installed in this ui?

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 12:57 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/5 "2020-08-04T12:57:22Z")

</div>

Thank you for your explanation.

I will create a group open to "everyone" in writing and in execution (not in reading).  
Then I will put the existing users there (me = pi and my daughter = jeanne).

But is there a way so that all the users who will be created later (my son, my wife, guests ...) can be automatically attached to this group during creation?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 August 2020 13:13 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/6 "2020-08-04T13:13:20Z")

</div>

It is not the user accessing the node-red gui that is important but the user configured to run node red itself. By default that will be which ever user ran the [pi install script](https://nodered.org/docs/getting-started/raspberrypi) when node red was installed. That is the user that is running node red, whoever happens to be accessing it via a browser.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 August 2020 13:21 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/7 "2020-08-04T13:21:02Z")

</div>

Backup a moment. When you are traveling, are you connecting your Pi to a public access point like at a campground, hotel, or store? If so, remember that anyone else on the network could access the pi.

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 14:14 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/8 "2020-08-04T14:14:14Z")

</div>

Thank you for this alert.  
Indeed in a hotel this poses a problem but I intend to use it most often at the homes of members of my family or my friends (I hope my daughter will do the same!).

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 14:15 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/9 "2020-08-04T14:15:33Z")

</div>

Thank you for your response.  
However, when I connect to my localhost: 1880 from the account I recently created for my daughter, I do not access the flows created with the user pi. Is it because I created this user recently while using the node-red preinstalled in the Raspberry Pi Imager package?

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 14:28 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/10 "2020-08-04T14:28:37Z")

</div>

In fact, things seem to be even more complicated: I created the user for my daughter, I tried to connect to localhost: 1880 (none of my flows present), then to localhost: 1880 / ui (" cannot get ui ").  
I then returned to the user pi and there, all my feeds disappeared!

It's as if by creating a second user I deleted all my feeds!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 August 2020 14:31 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/11 "2020-08-04T14:31:59Z")

</div>

I can't comment on the node red installed in the pi Imager package as I don't even know what that is, but if you use the [recommended install script](https://nodered.org/docs/getting-started/raspberrypi) then it will install node red so you can set it to autorun from boot by using  
`sudo systemctl enable nodered`  
then it will be the same flows whoever is logged onto the pi.

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [4 August 2020 15:11 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/12 "2020-08-04T15:11:38Z")

</div>

False alert !!!  
the magic of Reboot made it all right!  
And the flows are well presented in the editor regardless of the user.  
Thank you for all your advices !

NB: I actually use "sudo systemctl enable nodered"

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [5 August 2020 16:28 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/13 "2020-08-05T16:28:48Z")

</div>

Thanks for all your advice.  
Finally, I created the wificonf group, to which I attached root, pi and the user for my daughter.  
I also modified the group and the rights of the file wpa\_supplicant.  
Everything works fine but as soon as I reboot the wpa\_supplicant file regains its original group and rights.  
Do you have any idea to deal with this problem?  
Laurent

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [5 August 2020 19:44 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/14 "2020-08-05T19:44:34Z")

</div>

> [@Laurent](#):
>
> I created the wificonf group, to which I attached root, pi and the user for my daughter

As I said previously, it is only the user running the node-red server that needs to be in the group (that is pi, probably). It doesn't matter who is running the browser. It is the server that writes to the file, not the browser.

> [@Laurent](#):
>
> as soon as I reboot the wpa\_supplicant file regains its original group and rights.  
> Do you have any idea to deal with this problem?

Try adding a chown command to change the ownership, into the file `/etc/rc.local`, before the `exit 0` line at the end. That will get run on boot, but you might find it is too early and that the system is changing it after that file is run.

---

<div class="post-metadata">

**Author:** ![Laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@Laurent](https://discourse.nodered.org/u/Laurent)\
**Post date:** [6 August 2020 12:31 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/15 "2020-08-06T12:31:50Z")

</div>

Thanks again.  
I will modify the attachments to the wificonf group  
As for the rebbot problem, I'll solve it by running the chown from the nodered flow, just when it's needed.  
Thanks again for your help.  
Subject solved thanks to you !!!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 August 2020 12:31 UTC](https://discourse.nodered.org/t/raspberry-on-the-road/31096/16 "2020-08-20T12:31:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
