Raspi Midori Kioks
by MasseElch » Wed Sep 24, 2014 8:48 am
Hey there,
i tried to set up an pi to show a website where no interaction with the user is necessary. I just want to show it and refresh it once in a while.
I start this script to boot directly into fullscreen midori:
CODE: SELECT ALL
#!/bin/sh
xset -dpms
xset s off
unclutter &
matchbox-window-manager &
while true;do
midori -e Fullscreen -a www.some-website.com
done
The website contained some code to refresh every once in a while. Worked very well.
Problem: Router does a every night restart and if the website isnt available code wont load and i got a 404 error and have to refresh it manually.
Next idea:
CODE: SELECT ALL
#!/bin/sh
xset -dpms
xset s off
unclutter &
matchbox-window-manager &
while true;do
midori -i 60 -e Fullscreen -e Navigationbar -a www.some-website.com
done
So i tried to use the -i option for Midori. Refreshing works well too, but after every refresh the NavigationBar is shown. I found -e Navigationbar command at the manuals, but it does not seem to work for me.
I then changed the config for midori and added the following line:
CODE: SELECT ALL
show-navigationbar=false
Midori just ignores this and shows the NavigationBar.
Im now demotivated and do not know what to try next. Does anyone have suggestions?
Regards,
MasseElch
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
by gkreidl » Wed Sep 24, 2014 9:15 am
You could use Minimal Kiosk Browser (kweb) and force a page reload with xdotool (sending "ALT+r" or only "r" keyboard command). If running in Kiosk mode kweb will never show its interface elements.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Posts: 2278
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by MasseElch » Wed Sep 24, 2014 9:47 am
Yeah, i already thought about changing the browser.
But i need the browser to be capable of JavaScript.
Especiallay i need ajax support for post/get request.
Does your browser support that?
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
by gkreidl » Wed Sep 24, 2014 10:00 am
MasseElch wrote:
Yeah, i already thought about changing the browser.
But i need the browser to be capable of JavaScript.
Especiallay i need ajax support for post/get request.
Does your browser support that?
Of course, but you have to enable it (command line argument in your case). Kweb uses the same engine as Midori, kweb3 the same as epiphany (since the latest upgrades it includes two versions).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Posts: 2278
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by MasseElch » Wed Sep 24, 2014 10:46 am
So i ran ./prepare, i do not need to watch youtube videos etc so i do not need to install those packages, do I?
And i use matchbox window manager, i do not know if i need to install tint2?
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
by gkreidl » Wed Sep 24, 2014 11:45 am
MasseElch wrote:
So i ran ./prepare, i do not need to watch youtube videos etc so i do not need to install those packages, do I?
And i use matchbox window manager, i do not know if i need to install tint2?
If you don't use web video youtube-dl is not required.
And you don't need tint2 for your application (it doesn't work with matchbox window manager correctly anyway).
For your kind of application I'd also use matchbox window manager. Did you know that you can hide the mouse cursor with
matchbox-window-manager -use_cursor no ?
Might be useful for your app.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Posts: 2278
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by MasseElch » Wed Sep 24, 2014 12:02 pm
Yep knew that, but for testing i need the cursor sometimes, thats why i used unclutter.
If all is set up like i want it to go, i will hide it the way you suggested
by MasseElch » Wed Sep 24, 2014 12:25 pm
How can i tell kweb to refresh after a delay of x seconds?
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
by gkreidl » Wed Sep 24, 2014 12:49 pm
MasseElch wrote:
How can i tell kweb to refresh after a delay of x seconds?
install xdotool.
while true; do
sleep 3600
xdotool key "r"
done
(in kiosk mode without the "A" option set, otherwise use 'xdotool key "alt+r"')
I'd write a small script which checks, if the network is down and send the key only after a reconnection. Otherwise all the Javascript / Ajax stuff will have to be restarted each time you send a page reload command.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Posts: 2278
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany
by MasseElch » Wed Sep 24, 2014 12:58 pm
Yeah, you already said that, i remember now So the refresh will be on website and if connection got lost i do a refresh with xdotool.
Thank you for the help so far
Posts: 11
Joined: Sun Aug 31, 2014 10:43 am
by gkreidl » Wed Sep 24, 2014 2:03 pm
The following python script should do what you need. Put a call to it in your start script (kiosk file) before starting kweb:
CODE: SELECT ALL
#!/usr/bin/env python
import socket, time
url = "google.com"
connected = True
time.sleep(60)
while True:
if connected:
try:
dummy = socket.gethostbyname(url)
time.sleep(60)
except: connected = False time.sleep(10) else: try: dummy = socket.gethostbyname(url) connected = True os.system('xdotool key "r"') time.sleep(60) except: time.sleep(10)
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer
Posts: 2278
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany