Running a script using the exec node to reboot chromium!!

Using the exec node I'm able to run commands just fine, but when I try to run a script that loads chromium in kiosk mode using the matchbox window manager I get unable to open display errors.

When I run the same script in an SSH session it loads fine and chromium shows up on the Pi's local video output.

I'm just loading the script by running /home/pi/script.sh which contains the commands and parameters for the kiosk mode.

Is it possible to do this? I am doing this to get around chromium crashing to have it reboot the UI a few times a day, I would do a cron job but it has to reset at a specific time which is set inside node-red so I thought I could just have the exec node do it.

The Linux environment for local user, the user that is running Node-RED, and ssh may all be different.

You will probably need to set the DISPLAY environment correctly. Google is your friend.