Can't open image fullscreen from node-red


I have Node-RED running on ubuntu dekstop locally and i want show a picture in fullscreen from a node-RED trigger, i thought that would be possible from the exec node but got these error

`Command failed:  bash /home/mediacenter/.node-red/scripts/
Unable to init server: Could not connect: Connection refused

(eog:4320): Gtk-WARNING **: 19:32:36.916: cannot open display: `

when i run the command in the terminal is works as expected. Why does i not work from Node-RED?

This is my flow


and this in the file


eog --fullscreen /home/mediacenter/media/instructions/1.gif

Welcome to the forum @coen17st.

Does it help if you use something like
bash -c "DISPLAY=:0 /home/mediacenter/.node-red/scripts/"

If that does work there may well be a better way of writing it.

Thanks so much @Colin that works.
I'm going to look up exactly what -c "DISPLAY=:0 means and why it's needed in Node-RED and not locally in ubuntu

It is needed because you are running node red in a session that does not have a display associated with it. You would have the same issue if you tried to run the command from any application running in the background. For example if you used ssh to open a terminal on the node-red machine from another PC and ran the command from there.

1 Like

Thanks a lot, i understand now

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