【问题标题】:raspberry pi kiosk page not refreshing fast enough树莓派信息亭页面刷新速度不够快
【发布时间】:2015-08-25 08:35:44
【问题描述】:

我将我的树莓派与 raspbian 一起用作显示我创建的网页的信息亭。 一切正常,但是当我的网站需要更改 png 时,它的反应很慢。 如果我在我的桌面上运行相同的网页,反应会更快。

我使用命令 chromium --kiosk http://myurl.com

我的页面包含 angular,因此我尝试不支持的其他浏览器(例如 midori)其他浏览器,如顿悟网络(raspbian 的默认浏览器)工作正常但不支持 kiosk 模式。

任何想法如何改进它?

代码: 查看

@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>
}

这或多或少是我的代码。 我只是稍微编辑它以使其更短,但它会对它从另一个设备接收的一些输出做出反应,并且它应该根据它获得的输入来更改图像。

【问题讨论】:

    标签: asp.net-mvc-5 raspberry-pi raspbian kiosk-mode


    【解决方案1】:

    我想您使用的是 Raspberry Pi A/B/B+ 而不是 Raspberry Pi 2。Raspberry Pi 2 比以前的型号快很多(6x 更快,专门用于网页浏览)。因此,最简单的解决方案是让您使用更新的 Pi。物理布局和B+完全一样,应该很合适。

    否则,如果您出于某种原因无法更改硬件,那么您能做的最好的事情就是重新编码您的网站,使其更简单,使其符合您所面临的硬件限制。 Angular 很不错,但也很重。如果您可以使网站使用更轻的东西,那将是最好的。

    如果不查看页面代码,很难给出更明确的答案。

    【讨论】:

    • 谢谢你的回答,我担心这会是答案,我会尝试添加我的一小部分代码作为示例。
    【解决方案2】:

    您当然可以使用顿悟来加速您的页面。顿悟浏览器不支持开箱即用的 kiosk 模式,但如果您使用 openbox 作为窗口管理器,它确实可以在 kiosk 模式下运行。 openbox 允许将应用程序配置为以全屏模式启动(请参阅:http://openbox.org/wiki/Help:Applications),并且 Epiphany 具有隐藏菜单栏的应用程序模式。这两个功能结合起来,让顿悟在 kiosk 模式下运行。

    安装 openbox 和 Epiphany 后,您需要找到 Epiphany 的名称和类:

    开始顿悟

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

    来自输出:

    _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"
    

    需要_OB_APP_NAME_OB_APP_CLASS

    现在创建 openbox 配置文件: 猫 /etc/xdg/openbox/rc.xml > ~pi/.config/openbox/rc.xml

    编辑文件并在文件末尾附近添加一个应用程序条目

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

    在应用模式下启动顿悟(-a),所以它只有一个磁贴栏,在全屏模式下隐藏

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

    瞧,您在信息亭模式下运行顿悟!

    【讨论】:

      猜你喜欢
      • 2014-05-08
      • 1970-01-01
      • 1970-01-01
      • 2022-09-08
      • 2015-11-30
      • 1970-01-01
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多