TOLDOTECHNIK / buildroot-webkit

Buildroot WebKit fullscreen browser for Raspberry Pi. Suitable for HTML 5 user interfaces or digital signage / kiosk installations. It also can be used as a fullscreen video loop player. Ready to use RPi Zero/W and RPi 3 B SD card images are available.
244 stars 53 forks source link

Wifi connection required for webserver #52

Closed jbrangwyn closed 2 years ago

jbrangwyn commented 2 years ago

Hi, I had a raspberry pi 2 running a locally served HTML page on the webserver. It does not have built in WiFi, so I was using a usb WiFi dongle.

When I remove the dongle, I only get a white splash screen. This was going to be used somewhere without a WiFi connection.

Is WiFi/network connection required to run the web server? Thanks.

TOLDOTECHNIK commented 2 years ago

Which application is serving your HTML page? Is it running on the board using our Node.js Express server (/var/node/server.js)?

jbrangwyn commented 2 years ago

Yes, using the node.js express server.

TOLDOTECHNIK commented 2 years ago

The virtual local loopback interface (lo) should handle all the localhost requests without any other network interfaces activated at all. So the web page should be displayed. Ok, we will try our buildroot-webkit on a RPi 2 without any network connections the next days...

TOLDOTECHNIK commented 2 years ago

Ok, found it. The browser gets started too early when no network is active. That means, the browser is running before the local webserver (Node.js) is started.

Try to add a slight delay in the /etc/init.d/S90wpe script. Something like this:

grafik
jbrangwyn commented 2 years ago

Thanks for that, I do not have access to the Pi at the moment so will close this issue and try your suggestion if I get my hands on it again.

denizyesilirmak commented 2 years ago

If you don't want to wait 5 secods, you can watch your server's port and then launch WPE.

start) /usr/bin/node /var/node/index.js > /dev/null 2>&1 &

Wait for server to open WPE

while ! `netstat -tln 2>/dev/null | grep -q  8080`;
do
  sleep 0.3;
done
echo -n "Starting WPE: "
/usr/bin/wpe --loop "http://localhost:8080" &> /dev/null &
;;

stop)