0

I have an RPi3 running Debian Jessie and lighttpd web server with several web pages. I want to run a browser in Kiosk mode, but change the page that is displayed using logic in a python program running in the background (which is reading some sensors).

I would like it to be reasonably lightweight, but would rather work with existing software rather than write my own browser with webkit or some such (I dont have the skills).

I have managed to boot into Midori using "sudo xinit ./StartKioskMode" with the script in StartKioskMode coming from here. But with that approach I cant seem to change the webpage displayed using python once it is opened. The python webbrowser library doesnt seem to allow you to get() midori and then control it...it is not listed as a browser type here.

I tried using the python subprocess library instead. That worked, but it ended up opening multiple copies of midori as I couldnt work out how to just change the page in the current open browser window.

I dont mind running an X server in the background (in fact arent I doing that with xinit?). In fact I will probably need to as I eventually want to pop up a screen keyboard for the user to input details into a web page.

Can anyone suggest an approach to achieve the outcome described?

There are plenty of tutorials on opening a single page in kiosk mode (which I have already achieved) but what I want to do afterwards is change the page displayed using logic in python.

  • Have you thought about using either javascript or a meta tag to cycle through the pages, it is likely far easier. – Steve Robillard Sep 7 '16 at 13:04
  • Thanks Steve. I dont want cycling though. I need a specific page to display when specific events occur. After some more research i read that ffox windows can be closed by javascript. I need to test this...but one hack might be to just keep opening new windows but close them with a time out. Ffox is a bit more bloated than midori though...but it might have to do. – Lee Melbourne Sep 8 '16 at 22:22
1

So I have found a solution by using UZBL as the browser. Once the browser is opened you can control it by sending commands over a named pipe connection from Python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.