@GBoulvin has given you the solution; you need to be in the dialout group to access the serial port.
Hello @VonOx
Do I need to type this command? Even if Node-RED is installed and running, it wonât cause any problems?
Sorry for my ignorance, but Iâve been trying to find solutions to no avail. ![]()
Thanks for your help
I have to adapt it to my case of course, the line that interests us is this one:
-u node-red:dialout
But I donât know how to send it to the Raspberry Pi, I typed this:
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
-u root \
--network=host \
--name node_red \
-v /var/lib/node-red:/data \
-u node-red:dialout \
nodered/node-red
but apparently thatâs wrong
I ran this command
ls -l /dev/ttyUSB1
and in response I get this message :
crw-rw---- 1 root dialout 188, 1 Jul 17 21:08 /dev/ttyUSB1
Does this mean that we are indeed in the dialout group?
@Psoy
hello,
I donât have all the details, but in your docker run command you have at least one problem: you apply the -u (user) option twice, once as root and once as node-red:dialout, so there must be a conflict
And you need to delete your existing container before recreating it.
[quote=« Einstein8854, post:24, topic:7430 »]
you apply the
docker run -d \
--log-opt max-size=10m \
--restart=always \
--privileged \
--network=host \
--name node_red \
-v /dev:/dev \
-v /var/lib/node-red:/data \
nodered/node-red
That should be sufficient; you run it in privileged mode so normally thereâs no need for user or groupadd
You just need to map /dev otherwise your container wonât see it
[quote=« Psoy, post:26, topic:7430 »]
you were talking about Dialout, I ran this command
ls -l /dev/ttyUSB1
and in return I get this message:
``
thanks again @VonOx for your answers.
but Iâm still getting the same error
"[serialconfig:5fefad5a76dd3e43] serial port /dev/ttyUSB0 error: Error: Error: Permission denied, cannot open /dev/ttyUSB0"
I uninstalled the Node-RED container, then I deleted the node-red folders in \var\lib.
I reran your command but it kept rebooting like at the start, so I ran the command
docker run -d \
--log-opt max-size=10m \
--restart=always \
--network=host \
--name node_red \
-u node-red:dialout \
--device=/dev/ttyUSB0 \
--device=/dev/ttyUSB1 \
-v /var/lib/node-red:/data \
nodered/node-red
Try this
So after double-checking, it seems that it has changed. It looks like weâre in the config for the version change of the Serial Port palette 1.01 versus 0.15 :
.
je changerai la version toute Ă lâheure je vous tiens au courant
Thanks again, Vonox
Good evening,
Many thanks @VonOx. That was it; I was able to restart the RFlink but I still need to apply @Bjmâs procedure, namely downgrading the Serialport version back to v0.15
Iâll make a tutorial
Thanks again
Tutorial to reinstall NODE-RED in V3
A big thank you to @VonOx, for patiently guiding me.
The installation command in that video no longer works following the move to Node-RED V3. It must be replaced by the following commands:
: Intégrer Node-RED avec Gladys Assistant en MQTT | Gladys Assistant
Uninstall the old node red
1 - stop the docker container
docker stop node_red
2 - remove the node red container
docker rm node_red
3 - delete the node-red folder in \var\lib
cd /var/lib
4 - we entered the lib folder, list the folder contents
ls
5 - look for the node-red folder (note: hyphen from the 6 key) and delete it:
sudo rm -r node-red
6 - letâs verify that the node-red folder is gone
ls
7 - back to the prompt pi@gladys:~ $
cd /
8 - I reboot the rpi (I donât know if itâs necessary but it reassures me)
sudo reboot
9 - Verify that the node red container is gone
docker ps
installation of node red
1 - type @VonOxâs command
"you will need a system connected to the USB0 and USB1 ports; for my part I have an RFlink on port ttyUSB0 and the Sonoff Zigbee key on port ttyUSB1. So you may need to adapt in the lines " --device=/dev/ttyUSB0 \ " the name of the port used, for example ââdevice=/dev/ttyACM0.â
docker run -d \
--log-opt max-size=10m \
--restart=always \
--network=host \
--name node_red \
-u node-red:dialout \
--device=/dev/ttyUSB0 \
--device=/dev/ttyUSB1 \
-v /var/lib/node-red:/data \
nodered/node-red
2 - then this one
sudo chown -R 1000:1000 /var/lib/node-red
3 - Generate a hash: For more details watch Pierre-Gillesâ video: IntĂ©grer Node-RED avec Gladys Assistant en MQTT | Gladys Assistant
Generate a hash
docker exec -it node_red node-red admin hash-pw
example of a hash : $2b$08$tfrMEc4pnblhhSDFFBUjeOtGU.Ixh5d19P31NWCf2JZKmwZF888mK
4 - Edit the file with nano: Donât forget Sudo (for me it is required)
sudo nano /var/lib/node-red/settings.js
Remove the double // between âadminAuth:â and the corresponding closing brace } for adminAuth: {
5 - Paste the generated hash
6 - Then restart node red
docker restart node_red
Downgrading the Serialport version
we will use version 0.15.0 instead of version 1.0.1
thanks to @Bjm
So you must keep the node-red-node-serialport version 0.15.0. To get this version, follow @Bjmâs tutorial, which I paste below
I installed node-red-node-serialport version 0.15.0 which worked on my 32 bits
https://www.npmjs.com/package/node-red-node-serialport/v/0.15.0
1 - In the terminal open a Shell in docker
docker exec -it node_red /bin/bash
this returns to me
bash-5.0#
2 - I append the following command
npm i node-red-node-serialport@0.15.0
It churns and at the end returns this to me
notice created a lockfile as package-lock.json. You should commit this file.
+ node-red-node-serialport@0.15.0
added 48 packages from 37 contributors and audited 338 packages in 60.866s
45 packages are looking for funding
run `npm fund` for details
found 4 critical severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
3 - As there are 4 critical vulnerabilities I run
npm audit fix
As suggested
4 - Then
exit
5 â restart node red
docker restart node_red
Installation of the « palette : node-red-node-serialport »
Open Node-RED to install the « node-red-node-serialport » palette
Click at the top right on the 3 horizontal bars to open the above menu.
image262Ă506 4.11 KB
I donât know why the images are not displayed, but clicking on them opens them; these images are taken from the RFlink, NodeRed and Gladys tutorial
Click on « manage palette » 11th line. The window below opens, click on the âinstallâ tab, then type âserialâ in âsearch modulesâ to search for palettes (libraries). Libraries appear. Choose the library (or palette) ânode-red-node-serialportâ, click the small âinstallâ on the right.
Once done, click on the Nodes tab.
Verify that the palette is present. Then check in the âfilter nodesâ column on the left of the screen that you have the following nodes:
That should get you back to low-code development.
@Psoy, be careful â youâre saying to delete the persistence folder, but I think thatâs only valid in your case. I encountered the permission issue too and I didnât have to do all that.
@VonOx do I need to update the command on the blog or not?
As for me on the Docker side, I did absolutely nothing ![]()
Good evening @VonOx
Is the persistence folder node-red, in /var/lib?
You shouldnât do that, I thought wiping everything would be better!
Should I remove that passage?
Iâve had the pleasure of using this tutorial several times unfortunately, but it has always worked ![]()
Good evening Pierre-Gilles
I mention it at the beginning of the tutorial, saying that the command in your video no longer works with Node-RED v3. Maybe specify that there is this problem because the first thing people will do to install
Can the line --device=/dev/ttyUSB0 \\ be replaced by --device=/dev/ttyACM0 \\ if we have a device that uses it. @tiboys has his Arduino board declared on that ttyACM0 port
thanks
Have a good evening
Yes, it needs to be adapted according to the device, thatâs also why we generally create a udev rule, it allows having a permanent « path »
I forgot that, Iâll specify it.
Iâll add this before :
" you will need to have a system connected to the USB0 and USB1 ports, for my part I have an RFlink on port ttyUSB0 and the Sonoff Zigbee key on port ttyUSB1. So you may need to adapt in the lines " --device=/dev/ttyUSB0 \ " the name of the port used, for example "âdevice=/dev/ttyACM0."
Is that ok? (Iâm asking you first! ![]()