Node-Red via Docker on Phoenix PLC Next F 2152 need root rights

Hallo all,

node-Red runs in a Docker container on the Plc Next F 2152.

I am currently facing the problem that I would like to save CSV files on my PLC via Node-Red. Unfortunately, this controller currently refuses to execute Node-RED mkdir commands. Do you have any idea how I can give permission in Node-Red to create/modify/overwrite/delete files under a certain path at any time?

My Nodes ->

[{"id":"687306f9.a916a","type":"file","z":"f6f2187d.f17ca8","name":"","filename":"/opt/plcnext/logger.csv","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":960,"y":100,"wires":[]},{"id":"91881442.f40e2","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":100,"wires":[["6fae87cc.d45538"]]},{"id":"6fae87cc.d45538","type":"function","z":"f6f2187d.f17ca8","name":"","func":"var capa = flow.get("capa") || 0;\nflow.set ("ccapa_Ah",capa);\n\nreturn {payload:"Kapazität in Ah;Kapa"};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":100,"wires":[["6b721786.23fa1","687306f9.a916a"]]},{"id":"6b721786.23fa1","type":"debug","z":"f6f2187d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":40,"wires":}]

Instead of giving node red more permissions: it is better to assure that the node red user has the permissions to create directories in that folder.

If the folder is on a mounted volume then you can most likely give it those permissions by logging on to the docker host machine and using the standard unix commands to set permissions.

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