raspberry pi kiosk page not refreshing fast enough

989 views Asked by At

I am using my raspberry pi with raspbian as a kiosk that show a webpage that i created. It is all working fine but when my web need to change a png it react slowly. If i run the same webpage on my desktop the reaction is much faster.

I use the command chromium --kiosk http://myurl.com

My page include angular so some other browser that i tried not supporting (midori for example) other browser like epiphany web (default browser at raspbian) working fine but not supporting kiosk mode.

Any ideas how can improve it?

Code: View

@using Unitronics.Apms.ApmsWebClient.Resources.Views.Display
@model Unitronics.Apms.ApmsWebClient.Models.Display
<div>
       <div class="image" id="image1">
    </div>
    <div class="image" id="image2">
    </div>
    <div class="warningImage" id="warningImage">
    </div>
</div>
@section scripts {
    <!--Script references. -->
    <!--The jQuery library is required and is referenced by default in _Layout.cshtml. -->
    <!--Reference the SignalR library. -->
    <script src="~/Scripts/jquery.signalR-1.1.3.js"></script>
    <!--Reference the auto generated SignalR hub script. -->
    <script src="~/signalr/hubs"></script>
    <!--SignalR script to update the chat page and send messages.-->
    <!--Roy Foscam test-->   
    <script>
        $(function() {


            hideAll();
            $("#image1").show();

            // Reference the auto-generated proxy for the hub.              
            var bayHub = $.connection.bayHub;
            bayHub.client.notifyRejects = function(rejects) {
                hideAll();

                if (rejects.image2)
                    $("#image2").show();

                if (rejects.warning)
                    $("#warningImage").show();

            };

            function hideAll() {

                 $("#image2").hide();

                $("#warningImage")..hide();
            }

            // Start the connection.
            $.connection.hub.start().done(function() {
                // Register
                bayHub.server.register(@Model.DisplayId);
            });
        });
    </script>
}

This is more or less my code. I was just editing it a little bit to make it shorter here but it react to some outputs that it receive from another device and it should change the image according to the inputs it get.

2

There are 2 answers

1
fleed On

I imagine you're using the Raspberry Pi A/B/B+ and not the Raspberry Pi 2. The Raspberry Pi 2 is a lot faster than the previous models (6x faster, specially for web browsing). So the simplest solution is for you to use a newer Pi. The physical layout is exactly the same as the B+ so it should be a pretty good fit.

Otherwise, if you can't change the hardware for whatever reason, then the best you can do is re-code your site to be simpler so it fits with the hardware limitations you're facing. Angular is pretty good but also pretty heavy. If you could make the site work with something lighter it would be the best.

It's difficult to give a more explicit answer without seeing the code for your page.

0
Andreas Kohlbecker On

You can of course use epiphany to speed up your page. The epiphany browser does not support the kiosk mode out of the box but it can indeed be run in kiosk mode if you are using openbox as window manager. openbox allows configuring an application to start in fullscreen mode (see for reference: http://openbox.org/wiki/Help:Applications) and epiphany has an application mode in which the menu bar is hidden. These two features in combination make epiphany to run in kiosk mode.

Once you have installed openbox and epiphany you need to find the name and class of epiphany:

Start epiphany

export FRAMEBUFFER=/dev/fb1
export DISPLAY=0:
startx &
epiphany &
obxprop | grep "^_OB_APP"

from the output:

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "volumio.local"
_OB_APP_CLASS(UTF8_STRING) = "Epiphany-browser"
_OB_APP_NAME(UTF8_STRING) = "epiphany-browser"
_OB_APP_ROLE(UTF8_STRING) = "epiphany-window-5eff44ce"

the _OB_APP_NAME and _OB_APP_CLASS are needed

now create the openbox config file: cat /etc/xdg/openbox/rc.xml > ~pi/.config/openbox/rc.xml

edit the file and add a application entry near the end of the file

 <application name="epiphany-browser" class="Epiphany-browser">
    <fullscreen>yes</fullscreen>
</application>

start epiphany in application mode (-a) , so it has only a tile bar, which is hidden in fullscreen mode

epiphany -a --profile=/home/pi/.epiphany/myapp http://myurl.com &

And voila you have epiphany running in kiosk mode!