Hi All, I have a WP400 web panel connected to my PFC controller which is running a webvisu. When the system starts up, it seems that the web panel is up faster than the codesys webserver and therefore the display shown a 503 connection issue, then quickly moves to the reconnect countdown screen. From a customer experience, it looks rather bad. Is there a way to keep the web panel blank or display another screen, or delay the power-up so that the webvisu comes up and the app loads without displaying the connection issues? I tried adjusting the autostart to 0 and to 90 in WBM but it doesnt seem to change anything. The reconnect interval appears to be a setting that cannot be changed, at least I keep getting an error when attempting to change that (Errors occurred while writing some parameters. Changes may still have been made to other parameters.). Any advice? Ideally I would like the web panel to show the “Loading” page and then jump straight to the codesys visualization when it is up.
I had to solve this issue by putting a power switch on the HMI, so an operator could power cycle the HMI after a startup 503 error. I don’t like it but it works fine.
Not familiar with Wago HMI, but probably it’s running Linux.
You may use your HMI as front-end, run a local lighttpd server and use it as default page to load at HMI start. With help of web server modules, e.g. mod_rewrite, mod_proxy, you may pass requests to PLC as back-end and make an override to local html5 page with refresh timer in case of error 503 to back-end.
Hope you find it useful.
I solved this for a customer by modifying the script in the webpanel that opens the web browser.
This modification will make the panel stay black until the URL you configure as “startpage” is up (gives the browser in the panel HTTP status 200). As soon as webvisu (or any URL you have configured in the panel as “startpage”) is ready the browser open the URL without any timeout errors.
SSH to the webpanel and log in as root.
Edit the webbrowser startup script
nano /etc/script/start_webbrowser.sh
Add this before “Showurl” at the end of the script:
## Wait until configured start URL returns 200
while :; do
curl -s --fail -HEAD -o /dev/null $URL && break
sleep 3
done
## 200 Received
The end of your script should look like this now:
Save the script with
ctrl + X and Y to save
As long as you have marked the URL as startpage the panel will “pause” until it responds.
Swipe down from the panel to access WBM etc still works while the panel stays black.
You are right, it seems autostart is legacy artifact from TP600 HMI, only used to delay the start of CODESYS runtime, which is not part of WP400.
Here is a workaround.
You can use the same settings and add a delay within the start script.
Edit the /etc/script/start_panel.sh file
cp /etc/script/start_panel.sh /etc/script/start_panel.bak
nano /etc/script/start_panel.sh
Replace its content by this
#!/bin/sh
#-----------------------------------------------------------------------------#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2019-2022 WAGO GmbH & Co. KG
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# Script: start_panel.sh
#
# Brief: starting up panel / Xorg
#
# Author: Ralf Gliese: elrest Automationssysteme GmbH
#
#-----------------------------------------------------------------------------#
eeprom_device="/sys/bus/i2c/devices/1-0054/eeprom"
# allow user www to read brightness
brightness_file=/sys/class/backlight/backlight/brightness
if [ -e "$brightness_file" ]; then
chmod 666 "$brightness_file"
fi
# allow user www to set / read display orientation
chmod 666 $eeprom_device
# decide start mode Xorg or framebuffer
MICROBROWSER="0"
URL=""
PLCSELECTED=`/etc/config-tools/get_plcselect plc_selected`
URL=`/etc/config-tools/get_plcselect $PLCSELECTED url`
MICROBROWSER=`/etc/config-tools/get_plcselect $PLCSELECTED mic`
# Added to get the autostart value
COUNTDOWN=`getconfvalue /etc/specific/bootsettings.conf countdown`
if [ "$MICROBROWSER" == "1" ]; then
# without Xorg except EDGE-BOX
/etc/script/start_framebuffer.sh "$URL" &
else
if [ -z $COUNTDOWN ]; then
COUNTDOWN=3
fi
if [ $COUNTDOWN -gt 0 ]; then
waithittouch "Wait sequence before connect" $COUNTDOWN
fi
# start X
export DISPLAY=:0
echo "STARTING Xorg"
# look for usb mouse pugged in
grep -w "EV=17" /proc/bus/input/devices
if [ "$?" == "0" ]; then
/usr/bin/startx &
Save the file (Ctrl + O then Ctrl + X with nano)
You can change the text which will be displayed “Wait sequence before connect”
Restart, you will see a screen with a countdown appearing before trying to load the page.
Thanks for the tip @WagoThomas. I have my webvisu set up as startpage and similar settings to what you have shown in your screenshot (only the name and URL are different for me which shold make no difference. I appended the code that you shared in the bottom of the start_webbrowser script just like your screenshot but unfortunately the web panel now stays black when I start the system. The swipe down functionality you mentioned works and that is the only way I can open the codesys visualization now. I will try quenorha’s suggestion next. Any ideas what could be causing this to hang for me? It seems like it is not receiving the 200 status. Even after a few minutes of waiting nothing changes.
Thanks for the tip @quenorha, I tried it out and it worked once, but then when I powered down and rebooted a second time after changing the wait sequence text to display, it is stuck on the black “Loading, Please wait…” screen. I really like the idea of just a black screen with the Loading, Please Wait text but it seems that that didnt work out either yet. Something is hanging or creating some conflict. Another option (though I dont know how to implement this) would be to set an image to be displayed as a startscreen for 5 seconds on startup and then switch to the webvisu after those 5 seconds.
I guess it is linked to the change in text.
It works fine on my side, even after several reboot
As an update, I found another way around this which is easier and actually achieves another one of my goals quite nicely:
I created an HTML file (Redirect.html) that has an automatic redirect to the url of the webvisu after 10s:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redirect...</title>
<style>
body {
background-color: black;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-size: 24px;
}
</style>
<meta http-equiv="refresh" content="10;url=http://192.168.1.17/webvisu">
</head>
<body>
Loading, please wait...
</body>
</html>
This HTML file I placed on the WP400 in the directory /var/www/wbm. From the WBM of the WP400 I added a browser favorite pointing to the file: https://localhost/wbm/Redirect.html and made this the startpage for the device. Now when the PFC300 powers up, I see the Loading. Please wait screen, then it goes to my Redirect.html page and after 10s it loads the visualization. No more countdown visible and no more 503 timeout visible. The best part is that I can edit the html page to show our logo or a short animation prior to the redirect!

