初始化树莓派
设置ssh,方便远程,默认账户pi ssh pi@<ip>
默认密码raspberry
,或者在桌面UI设置
设置默认用户pi自动登录到桌面 检查 sudo raspi-config
Boot Options,或者在桌面UI设置
设置screen blanking 为 false,防止息屏,检查 sudo raspi-config
,或者在桌面UI设置
设置鼠标1秒静止就隐藏,重启生效
1 2 3
| sudo apt-get install unclutter -yf
echo “@unclutter -idle 1 -root” >> /etc/xdg/lxsession/LXDE/autostart
|
推荐使用火狐浏览器;也可使用自带浏览器实现
使用firefox实现 推荐
测试firefox-esr可以存localstorage,kiosk模式下也可打开控制台。安装firefox,修改启动浏览器为firefox。
1
| sudo apt update && sudo apt install firefox-esr
|
修改启动文件
1
| mkdir -p ~/.config/autostart && nano ~/.config/autostart/my.desktop
|
~/.config/autostart/my.desktop1 2 3 4
| [Desktop Entry] Type = Application #Exec = chromium-browser "http://192.168.30.69/dashboardprepage/#/" -kiosk --user-data-dir=/home/pi/userdatadir Exec = firefox-esr "http://192.168.30.69/dashboardprepage/#/" -kiosk
|
最后重启查看效果
使用自带的chromium实现
设置自启动文件 -kiosk开启全屏
1
| mkdir -p ~/.config/autostart && nano ~/.config/autostart/my.desktop
|
~/.config/autostart/my.desktop1 2 3
| [Desktop Entry] Type = Application Exec = chromium-browser "http://192.168.1.21/dashboardprepage/#/" -kiosk
|
重启查看效果就好了
其他
自动刷新网页
树莓派更换软件源
注意:chromium 的localstorage 有问题,它不存数据;kiosk模式开发控制台也打不开
注意:firefox要正常关闭(sudo reboot
)才可以修改localstorage,直接断电树莓派不可以修改localstorage
测试版本信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
pi@raspberrypi:~ $ dpkg -l firefox-esr Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-=========================-============-============================================================ ii firefox-esr 78.10.0esr-1~deb10u1+rpi1 armhf Mozilla Firefox web browser - Extended Support Release (ESR) pi@raspberrypi:~ $ dpkg -l chromium-browser Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-================-==================-============-=================================================== ii chromium-browser 88.0.4324.187-rpt1 armhf Chromium web browser, open-source version of Chrome
|
参考
树莓派开机自启动chrome浏览器并进入某网址
空闲隐藏树莓派鼠标指针
LocalStorage variable not persisting in Chromium Kiosk mode
Install Firefox on Raspberry Pi
树莓派软件源在线配置工具