Refresh Chromium running in X and kiosk mode

I have Dietpi running and I have tried both Autostart options 11 and 17 and I cannot get my PI 5 to refresh the webpage that it is accessing. I do not own or control the website so I cannot add code to it.
I have tried a number of scripts along with xdotool and it either gives me an error such as wtype not found or fails to start script. I have chmod +x the script file.
I am running without a desktop so smaller size and less chance of people doing something unexpected.

I had it working in Wayland but the ability to pick just what I need with Dietpi.

I seem to be missing something but I am not sure what it is at this point.

Can you share your script for xdtool.
Otherwise you could try something like

chromium --kiosk "http://yourwebsite.com" --app="data:text/html,<html><head><meta http-equiv='refresh' content='300'></head></html>"

Which refreshes every 300 seconds.

I have tried scripts like:
sleep 10
while true; do
wtype -M ctrl -P F5
sleep 20
done

Which worked in Wayland 64bit Full PIOS.

while true ; do
sleep 20
xdotool key ctrl+r
done

Which gave me an error.

xdotool key F5

with cronjob * * * * * DISPLAY=:0 /home/dietpi/refresh.sh
which gave me a wtype error also.

The solution you gave probably will not work since I do not control the webpage and cannot add any code.

I am trying to setup a self checkout device for our library that will only have a bar code scanner connected. I also would like to be able to have it do any updates and upgrades automatically if possible.

I have it set up at this point with a desktop and auto logging in with Chromium and using an extension for the refresh cycle.
Just trying to improve what I have and make it more stable and more self sustaining.

Thanks for the guidance and time.

Maybe you can share the error messages. It’s also a good habit to use absolute paths in bash scripts. So instead of using just the command xdotool, use the full path to it. Bird let’s see first what the word are about.

Also about my other option, I guess chromium will inject the refresh script into the HTML, no matter what. I didn’t test this, but this is what I read about this app flag.

I decided to just use an extension for now to do the refresh but I still cannot get xdotool to function to Tab twice and press enter since the website I need to access has turned off autologin.
I got it working using wtype using a full PIOS and Wayland.
I am still interested in getting this working in Dietpi since all this device has attached is a barcode scanner no mouse or keyboard for people to mess around with.

I have tried full path, using DISPLAY=:0, and still get Failed xdo instance and can’t open display.
I am trying to run this out of a cronjob so it runs at @reboot sleep 50.

Any guidance or clue would be appreciated. I know I am making some kind of simple mistake or not understanding something I have read.

Maybe @MichaIng has an idea, or @Joulinar

nope sorry, I’m not using any desktop or browser (kiosk) and have not that much experience there.

Are you running Chromium as root or non-root, via xinit or startx? With startx there is this /etc/X11/xinit/xinitrc script invoked by default, to run commands within the X environment, before starting the actual client. And they can be also sent to background with &. With xint you can create ~/.xinitrc instead, or define one via command-line option.

Or is this what you tried? Else I guess the problem is that X does not make it easy to pass through key triggers from outside the X environment.