gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Sun Oct 19, 2014 3:29 am

I suppose you are using an older version (< 1.5) which means you have to configure kwebhelper_settings.py manually. There's an option not to use the terminal (xterm) for playing video with omxplayer. You'll loose keyboard control for omxplayer then, but that doesn't matter in your case.

Catching the end of a video is more tricky. If the duration is known, you could use Javascript's timing functions (setTimeout()).

A more general solution would be to use xdotool for sending keyboard commands, and a script to run a video and jquery to catch the keyboard event. After the video has finished, the script sends a keyboard event to kweb (the front window) which is caught by jquery. You have to use a keyboard command that is not used by kweb itself.
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

mrKrecik
Posts: 11
Joined: Sun Oct 12, 2014 5:33 pm

Re: Minimal Kiosk Browser

Sun Oct 19, 2014 1:01 pm

Thanks for reply.

Strange... I'm using the newest version 1.5.6-1, but I do have this option in kwebhelper_settings.py. I switched it to False, but now video isn't displaying at all (checked this twice - with True video is playing, with False isn't).

Now my code looks like this (to simplify my case):

Code: Select all

<html style="width: 100%; height: 100%; background: #000;">
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  </head>
  <body style="margin: 0; bottom: 0;">
<iframe style="width: 100px; height: 100px; overflow: hidden;" src="/home/pi/12.avi"></iframe>
</body>
</html>

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Sun Oct 19, 2014 1:28 pm

The option has been there for a while, but from version 1.5 onwards you can use the web interface to edit the settings. Select the "nogui" preset at first, then set
omxplayer_in_terminal_for_video to False
and click the save button. I've just tested it on a number of small videos.
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

mrKrecik
Posts: 11
Joined: Sun Oct 12, 2014 5:33 pm

Re: Minimal Kiosk Browser

Sun Oct 19, 2014 1:49 pm

I've checked that again (nogui and terminal option) with the same results.

True - video is playing.
False - nothing happening.

I'm using kiosk mode xinit ./kiosk where kiosk:

Code: Select all

#!/bin/sh
matchbox-window-manager &
kweb -JKHCU+-zbhrqfpoklgtjneduwxy file:///home/pi/homepage.html
Is there any log where I can debug my problem?

I've fresh copy od raspbian wrom 09.09.2014

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Sun Oct 19, 2014 2:00 pm

Remove the "K" option from the options string to run a full browser (for testing).
After starting the browser (don't include the video right now) type "#lxterminal" in the URL entry line to start a terminal. In the terminal enter:
omxplayergui.py av /home/pi/12.avi
(it takes the same settings you've set in the browser).
Does it throw a Python error or does it play as it should?
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

eltrasimaco
Posts: 20
Joined: Fri Apr 25, 2014 10:50 am

Re: Minimal Kiosk Browser

Thu Oct 30, 2014 12:51 pm

Hi, is there any option to remove scrollbars?
i'm starting kweb in kiosk mode like this:
kweb -KAHZJEobhrp+-zgtjnediwxyqcf "http://mywebpage"
some web pages show scrollbars (they are too wide or too large to fit in browser)
Thanks

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Thu Oct 30, 2014 2:10 pm

eltrasimaco wrote:Hi, is there any option to remove scrollbars?
i'm starting kweb in kiosk mode like this:
kweb -KAHZJEobhrp+-zgtjnediwxyqcf "http://mywebpage"
some web pages show scrollbars (they are too wide or too large to fit in browser)
Thanks
No, they come directly from the engine and I've no idea at the moment how to prevent them.

But there are workarounds from HTML: create a local HTML file containing nothing but an iframe that fills the whole screen and points to the website and forbid scrolling for the iframe. Load the local file instead if your website when starting the browser.
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

emmar
Posts: 12
Joined: Tue Oct 07, 2014 7:54 pm

Re: Minimal Kiosk Browser

Thu Oct 30, 2014 6:18 pm

So I've been trying to get kweb to work. I've read the manual and tried a lot of things and am not having success. What I'm trying to do is make a certain website come up in kiosk mode when the pi turns on. I don't want any user interaction, so no buttons or things like that, but it does need javascript enabled. Also, I am trying to write a script to run all of the commands to install/set up the pi, so, if possible the kweb install should all be via the commandline.

I've got it all working in Chromium right now, and it has been pretty easy - just sudo apt-get install chromium and @chromium --incognito --kiosk http://localhost/index.php in /etc/xdg/lxsession/LXDE/autostart.

This is the procedure that I've gotten from reading this thread (~the first 5 pages) and the manual, but, when I restart the pi, I don't see anything. Kweb doesn't even seem to open:
  1. make sure we're up to date

    Code: Select all

    sudo apt-get update
  2. install kweb

    Code: Select all

    wget http://steinerdatenbank.de/software/kweb-1.5.6.tar.gz
    tar -xzf kweb-1.5.6.tar.gz
    cd kweb-1.5.6
    ./debinstall
  3. there will be some issues, so run this

    Code: Select all

    sudo apt-get -f install
  4. install youtube??? hopefully not necessary

    Code: Select all

    sudo apt-get install youtube-dl
  5. install matchbox-window-manager - probably necessary

    Code: Select all

    sudo apt-get install matchbox-window-manager
  6. create file "kiosk" in /home/pi

    Code: Select all

    #!/bin/sh
    matchbox-­window­-manager &
    kweb -­KHCUA+-­zbhrqfpoklgtjneduwxy www.google.com
    not sure which options to use (or even how the options work. what is that + for? uppercase or lowercase?)...
    kweb -­KHCUA+-­zbhrqfpoklgtjneduwxy localhost
    kweb -­KHCUAj localhost
    kweb -­KHCUA+-j localhost
    kweb -KCJ localhost
  7. Booting into your application:
    If you want your system to boot into your kweb application, you have to edit two files (as root, e. g.
    with “sudo nano”):
    • /etc/inittab
      Look for a line like that:
      1:2345:respawn:/sbin/getty --noclear 38400 tty1
      Put a “#” in front and add the following line after it:
      1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
    • /etc/rc.local
      Add the following line just in front of the line with “exit 0”
      su -l pi -c "xinit ./kiosk"
Can you help me figure out how to do this?

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Thu Oct 30, 2014 6:38 pm

Does kweb start from the desktop (just for testing)? The latest foundation Raspbian image misses some libraries that have been there from the beginning. If you have the latest Raspbian image you must install some dependencies first (you should have seen some errors during ./debinstall in this case).

In the kiosk script you must set a fully qualified URL, either starting with file:// or http://

youtube-dl may not needed in your case (pure kiosk app).

Option string:
capital letters are for browser options (include "J" to enable Javascript). Lower case characters (and a few special ones) are for enabling keyboard shortcuts, numbers are for default window sizes. If you open the configuration page (ALT+c, or ":c" in the URL entry field), you'll get a list of all options including the matching chracters..

Before trying Kiosk mode I would suggest starting a full browser (without the "K" option) just for debugging your application. Then add the 'K' option for kiosk mode.
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

emmar
Posts: 12
Joined: Tue Oct 07, 2014 7:54 pm

Re: Minimal Kiosk Browser

Thu Oct 30, 2014 9:20 pm

gkreidl wrote:Does kweb start from the desktop (just for testing)? The latest foundation Raspbian image misses some libraries that have been there from the beginning. If you have the latest Raspbian image you must install some dependencies first (you should have seen some errors during ./debinstall in this case).

In the kiosk script you must set a fully qualified URL, either starting with file:// or http://

youtube-dl may not needed in your case (pure kiosk app).

Option string:
capital letters are for browser options (include "J" to enable Javascript). Lower case characters (and a few special ones) are for enabling keyboard shortcuts, numbers are for default window sizes. If you open the configuration page (ALT+c, or ":c" in the URL entry field), you'll get a list of all options including the matching chracters..

Before trying Kiosk mode I would suggest starting a full browser (without the "K" option) just for debugging your application. Then add the 'K' option for kiosk mode.
First of all, you are amazing! I didn't think that you would answer ALL of my questions/confusions/musings!

I was able to start kweb from the desktop. I did see the missing dependencies when I ran ./debinstall, so that's why I ran sudo apt-get -f install. I just re-ran ./debinstall, and this was the output:

Code: Select all

[email protected] ~/kweb-1.5.6 $ ./debinstall
(Reading database ... 70257 files and directories currently installed.)
Preparing to replace kweb 1.5.6-1 (using kweb_1.5.6-1_armhf.deb) ...
Unpacking replacement kweb ...
Setting up kweb (1.5.6-1) ...
Processing triggers for desktop-file-utils ...
Processing triggers for menu ...
Processing triggers for man-db ...
Preparing kweb environment ...

... looking for programs needed by Minimal Kiosk Browser
found: lxterminal
found: xpdf for better PDF support (recommended: evince!)
found: omxplayer
for use with omxplayerGUI you should always get the latest version
from http://omxplayer.sconde.net/
youtube-dl not found. It is needed for web video support.
Raspbian version is broken, therefore install it with the following commands:
sudo wget https://yt-dl.org/latest/youtube-dl -O /usr/bin/youtube-dl
sudo chmod a+x /usr/bin/youtube-dl
For an alternate method which enhances response time by 40% see:
http://www.raspberrypi.org/forums/viewtopic.php?f=38&t=83763

uget download manager not found. It is highly recommended for downloads.
Install it with:
sudo apt-get install uget

if you want to use Minimal Kiosk Browser without starting the desktop,
you need the light weight task bar tint2. Install it with:
sudo apt-get install tint2

vlc not found. It can be optionally used for audio playlists (disabled by default).
If you want to make use of this option, you must install it with:
sudo apt-get install vlc

xterm not found. It can be optionally used for playing video full screen without GUI.
If you want to make use of this option, you must install it with:
sudo apt-get install xterm

Some programs needed to use all features of Minimal Kiosk Browser are not installed.
Follow the install recommendations above.
Also, I changed /home/pi/kiosk to the following and am still not getting kweb to open on startup.

Code: Select all

#!/bin/sh
matchbox-window-manager &
kweb -KCJ http://www.google.com

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 6:25 am

So what does happen when you boot? Do you boot to the command line (and see any error messages perhaps)?
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

eltrasimaco
Posts: 20
Joined: Fri Apr 25, 2014 10:50 am

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 8:00 am

thanks a lot; my startup script is this, it works well (called from /etc/rc.local, local user "kiosk"):

matchbox-window-manager -use_titlebar no -use_cursor no &
xset -dpms
xset s off
kweb -KAHZJEobhrp+-zgtjnediwxyqcf "http://mywebserver/index.html"

Ivan Tham
Posts: 75
Joined: Mon Jun 24, 2013 7:06 am

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 8:10 am

Can I use socks5:// HTTP proxy on kweb?

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 8:33 am

eltrasimaco wrote:thanks a lot; my startup script is this, it works well (called from /etc/rc.local, local user "kiosk"):

matchbox-window-manager -use_titlebar no -use_cursor no &
xset -dpms
xset s off
kweb -KAHZJEobhrp+-zgtjnediwxyqcf "http://mywebserver/index.html"
Glad that it's working now. BTW, the "-use_titlebar no" option is not needed, as kweb goes to full screen mode by itself when run in kiosk mode.
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

emmar
Posts: 12
Joined: Tue Oct 07, 2014 7:54 pm

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 3:35 pm

gkreidl wrote:So what does happen when you boot? Do you boot to the command line (and see any error messages perhaps)?
I've been booting directly into the desktop, so any errors fly by. Would it help if I started over and posted all of the commands and their outputs?

edit: or is there an error log that might give some insight?

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 3:48 pm

emmar wrote:
gkreidl wrote:So what does happen when you boot? Do you boot to the command line (and see any error messages perhaps)?
I've been booting directly into the desktop, so any errors fly by. Would it help if I started over and posted all of the commands and their outputs?

edit: or is there an error log that might give some insight?
That solves the puzzle. You've set up two conflicting boot options.

Use raspi-config and select "boot to command line". From the command line you can always use "startx" to get to the desktop. Now the booting into the kiosk mode using "xinit ./kiosk" should work. If you close kweb, you'll return to the command line.
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

emmar
Posts: 12
Joined: Tue Oct 07, 2014 7:54 pm

Re: Minimal Kiosk Browser

Fri Oct 31, 2014 8:23 pm

gkreidl wrote:
emmar wrote:
gkreidl wrote:So what does happen when you boot? Do you boot to the command line (and see any error messages perhaps)?
I've been booting directly into the desktop, so any errors fly by. Would it help if I started over and posted all of the commands and their outputs?

edit: or is there an error log that might give some insight?
That solves the puzzle. You've set up two conflicting boot options.

Use raspi-config and select "boot to command line". From the command line you can always use "startx" to get to the desktop. Now the booting into the kiosk mode using "xinit ./kiosk" should work. If you close kweb, you'll return to the command line.
Yep, that was it. Thank you so much for your help!

emmar
Posts: 12
Joined: Tue Oct 07, 2014 7:54 pm

Re: Minimal Kiosk Browser

Mon Nov 03, 2014 4:37 pm

Sorry to bother you again, gkreidl, but now that I've got kweb running, it's missing a feature that I hoped it would have, so I guess this is a feature request to include the css3 viewport units (vw, vh, vmax, vmin).

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Mon Nov 03, 2014 5:06 pm

This is completely outside of my control. It depends on the webkit libraries being used. You may try kweb3, as it uses a much newer version (2.4.0?) of the webkit libs, but you have to live with some bugs for the moment (hopefully we'll get some bug fix updates in the near future).
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

HSternIsBatman
Posts: 7
Joined: Tue Sep 16, 2014 6:18 pm

Re: Minimal Kiosk Browser

Tue Nov 04, 2014 5:22 pm

Hello

I'm missing something obvious here....how do you open a webpage in fullscreen mode? I looked at the pdf manual but I couldn't figure it out.

from a terminal window

kweb -f http://www.google.com

I thought that might work....

How do you exit kioskmode once it is running :-)

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Tue Nov 04, 2014 5:42 pm

HSternIsBatman wrote:Hello

I'm missing something obvious here....how do you open a webpage in fullscreen mode? I looked at the pdf manual but I couldn't figure it out.

from a terminal window

kweb -f http://www.google.com

I thought that might work....

How do you exit kioskmode once it is running :-)
Kiosk mode is primarily a front end for embedded applications. You should enable keyboard commands if you run it in kiosk mode. (ALT+)q to quit the browser, for example. Or (ALT+)f to toggle between window and full screen mode (so you can click on the close symbol of the window.

At the moment switching between kiosk mode and full mode is not possible once the browser is running, but that will change in version 1.5.7. I just rewrote the kiosk code completely. Watch for announcements here (coming soon).
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

HSternIsBatman
Posts: 7
Joined: Tue Sep 16, 2014 6:18 pm

Re: Minimal Kiosk Browser

Tue Nov 04, 2014 7:52 pm

Most excellent. Thanks for the reply. Looking forward to seeing it.

Will there be a way to cycle thru multiple 'tabs' by chance? OOh I just saw your post

10 pages (html files) with predefined names can be called via keyboard commands ALT+0, ALT+1 (in kiosk mode also without ALT). You can use xdotool to emulate such keyboard commands at specific times from a simple script.

How do I assign a web page to a keyboard command?

thanks!

MuenchenMichi
Posts: 1
Joined: Tue Nov 04, 2014 11:10 pm

Re: Minimal Kiosk Browser

Tue Nov 04, 2014 11:48 pm

Hallo,

I want to do a litte HTML-diashow with fading images in kiosk-mode.
Everything seems to work fine, but after about 30 minutes kweb just shuts down.
The CPU-load is neary zero, except when fading, than it's about 30-40%. Memory usage is constant about 12mb.

Does anyone have an idea, why this happens? I just have 5 looping images 1280x1024px, coming from another RasPi running an apache webserver.
I tried running KWeb in the normal LXDE as well as with matchbox-window-manager.

Is there a logfile where I can find more informations?

Thank you,

Michael

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Wed Nov 05, 2014 5:57 am

MuenchenMichi wrote:Hallo,

I want to do a litte HTML-diashow with fading images in kiosk-mode.
Everything seems to work fine, but after about 30 minutes kweb just shuts down.
The CPU-load is neary zero, except when fading, than it's about 30-40%. Memory usage is constant about 12mb.

Does anyone have an idea, why this happens? I just have 5 looping images 1280x1024px, coming from another RasPi running an apache webserver.
I tried running KWeb in the normal LXDE as well as with matchbox-window-manager.

Is there a logfile where I can find more informations?

Thank you,

Michael
Can you contact me via PM and send me the examples (HTML, Javascipt, images) you are using via email so I can set up a testing environment? kweb does not write any logfiles. Does dmsg report anything after the crash?
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

gkreidl
Posts: 6048
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Minimal Kiosk Browser

Wed Nov 05, 2014 6:34 am

HSternIsBatman wrote: 10 pages (html files) with predefined names can be called via keyboard commands ALT+0, ALT+1 (in kiosk mode also without ALT). You can use xdotool to emulate such keyboard commands at specific times from a simple script.

How do I assign a web page to a keyboard command?

thanks!
See the changelog for version 1.5.1 (it's not in the manual, yet, which will be updated for version 1.6 maybe).

Version 1.5.7 will be able to receive not only keyboard commands but complete URLs via xdotool. This will be great for HTML slideshows and digital signage projects. The normal user can switch to full screen and kiosk mode (and back) with two keyboard commands.
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

Return to “Raspbian”