Cant read file on same Pi

I'm using Node-Red on a Raspberry Pi and I'm trying to read a file on the same Pi. I keep getting the error 'Error: ENOENT: no such file or directory, open 'home/pi/test.txt'' but the strange thing is I can write to the file. I'm baffled.

[{"id":"a939ce7aa81a0053","type":"file in","z":"0871f80587d070df","name":"","filename":"home/pi/test.txt","filenameType":"str","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":1300,"y":1980,"wires":[["c695503e82074b33"]]},{"id":"bbb4d8985f32278b","type":"inject","z":"0871f80587d070df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1140,"y":1980,"wires":[["a939ce7aa81a0053"]]},{"id":"1ad9744b6062d426","type":"inject","z":"0871f80587d070df","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1140,"y":1920,"wires":[["21e14d3b113d921d"]]},{"id":"21e14d3b113d921d","type":"file","z":"0871f80587d070df","name":"","filename":"home/pi/test.txt","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":1300,"y":1920,"wires":[[]]}]

'home/pi/test.txt''
Should be '/home/pi/test.txt''.

I tried that first, and // after reading various posts, but still didn't work.

[{"id":"a939ce7aa81a0053","type":"file in","z":"0871f80587d070df","name":"","filename":"/home/pi/test.txt","filenameType":"str","format":"lines","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":1310,"y":1980,"wires":[["c695503e82074b33"]]}]

and you are running node-red natively (ie. installed via script and not docker) ?

Yes, it is.

I'm not sure what I've done but it's starting working now. Thanks. All I did was write to the file and then I was able to read it without an error.

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