I hiahia ahau ki te whakaatu i tetahi papatohu me te aroturuki i runga i nga mata maha o te tari. He maha nga Raspberry Pi Tauira B + tawhito me te hypervisor me nga rauemi tata kore mutunga.
Ko te ahua o te Raspberry Pi Model B+ kaore i te nui te matapōkere kia haere tonu te kaitirotiro me te whakaputa i te maha o nga whakairoiro kei roto, na te mea ka puta he hapa te wharangi, he maha nga tukinga.
He otinga tino ngawari me te huatau, e hiahia ana ahau ki te whakapuaki ki a koe.
Kei te mohio koe, ko nga Raspberry katoa he kaitukatuka ataata tino kaha, he pai mo te wetewete ataata taputapu. Na ka puta te whakaaro ki te whakarewa i tetahi kaitirotiro me te papatohu ki tetahi atu waahi, me te whakawhiti i tetahi awa kua oti te hanga me te pikitia kua tukuna ki te rōpere.
Hei taapiri, me ngawari ake te whakahaere, na te mea i tenei keehi ka mahia nga whirihoranga katoa i runga i tetahi miihini mariko, he maamaa ake te whakahou me te taapiri.
Kare i roa te korero.
Wāhanga Tūmau
Ka whakamahia e matou kua rite
Ka tohatohahia e matou he miihini mariko hou, ka whakauruhia ki runga
apt-get update
apt-get install -y xserver-xorg nodm fluxbox
sed -i 's/^NODM_USER=.*/NODM_USER=ubuntu/' /etc/default/nodm
Ka whakamahia ano e matou te whirihora mo Xorg, ma te atawhai
cat > /etc/X11/xorg.conf <<EOT
Section "Device"
Identifier "device"
Driver "vesa"
EndSection
Section "Screen"
Identifier "screen"
Device "device"
Monitor "monitor"
DefaultDepth 16
SubSection "Display"
Modes "1920x1080" "1280x1024" "1024x768" "800x600"
EndSubSection
EndSection
Section "Monitor"
Identifier "monitor"
HorizSync 20.0 - 50.0
VertRefresh 40.0 - 80.0
Option "DPMS"
EndSection
Section "ServerLayout"
Identifier "layout"
Screen "screen"
EndSection
EOT
systemctl restart nodm
Inaianei ka whakauruhia e matou a Firefox, ka whakahaerehia e matou hei ratonga punaha, na mo tetahi mea ka tuhia e matou he konae wae mo taua mea:
apt-get install -y firefox xdotool
cat > /etc/systemd/system/firefox.service <<EOT
[Unit]
Description=Firefox
After=network.target
[Service]
Restart=always
User=ubuntu
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/ubuntu/.Xauthority"
ExecStart=/usr/bin/firefox -url 'http://example.org/mydashboard'
ExecStartPost=/usr/bin/xdotool search --sync --onlyvisible --class "Firefox" windowactivate key F11
[Install]
WantedBy=graphical.target
EOT
systemctl enable firefox
systemctl start firefox
Kei te hiahia matou ki a Xdotool hei whakahaere i te firefox i te aratau mata katoa.
Te whakamahi i te tawhā -url
ka taea e koe te tautuhi i tetahi wharangi kia tuwhera aunoa ina timata te kaitirotiro.
I tenei wa, kua reri to maatau kiosk, engari inaianei me kaweake te ahua ki runga i te whatunga ki etahi atu kaitirotiro me nga taputapu. Ki te mahi i tenei, ka whakamahia e matou nga mea ka taea
Mo tenei ka hiahia tatou e rua nga mea:
apt-get install -y make gcc ffmpeg
cd /tmp/
wget https://github.com/ccrisan/streameye/archive/master.tar.gz
tar xvf master.tar.gz
cd streameye-master/
make
make install
cat > /etc/systemd/system/streameye.service <<EOT
[Unit]
Description=streamEye
After=network.target
[Service]
Restart=always
User=ubuntu
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/home/ubuntu/.Xauthority"
ExecStart=/bin/sh -c 'ffmpeg -f x11grab -s 1920x1080 -i :0 -r 1 -f mjpeg -q:v 5 - 2>/dev/null | streameye'
[Install]
WantedBy=graphical.target
EOT
systemctl enable streameye
systemctl start streameye
I te mea kaore e hiahiatia he whakahou tere i to maatau pikitia, i tohua e au te reeti whakamau: 1 anga mo ia hekona (tawhā -r 1
) me te kounga kōpeketanga: 5 (tawhā -q:v 5
)
Inaianei me ngana ki te haere ki
Te taha kiritaki
He maamaa ake i konei, penei i taku korero, ka whakamahia e matou te Raspberry Pi Model B +.
Tuatahi, me whakauru ki runga
Ka hiahia hoki matou ki te toha atu mahara mo to tatou maramara ataata, mo tenei ka whakatikahia e matou /boot/config.txt
gpu_mem=128
Me whakaara i ta maatau punaha hou, kaua e wareware ki te arawhiti i te mowhiti pacman, whakauruhia
pacman -Sy omxplayer
He mea whakamiharo, ka taea e OMXPlayer te mahi me te kore x, na reira ko te tuhi i tetahi konae wae mo taua mea ka whakahaere:
cat > /etc/systemd/system/omxplayer.service <<EOT
[Unit]
Description=OMXPlayer
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/omxplayer -r --live -b http://your-vm:8080/ --aspect-mode full
[Install]
WantedBy=multi-user.target
EOT
systemctl enable omxplayer
systemctl start omxplayer
Hei tawhā -b http://your-vm:8080/
kei te tukuna e matou te url mai i to maatau tūmau.
Heoi ano, me puta tonu he pikitia mai i ta maatau tūmau i runga i te mata hono. Mena he raru, ka whakaara aunoa i te awa ka hono ano nga kaihoko ki a ia.
Hei painga, ka taea e koe te whakauru i te pikitia ka puta hei tiaki mata ki nga rorohiko katoa o te tari. Mo tenei ka hiahia koe
mode: one
selected: 0
programs:
"Monitoring Screen" mpv --really-quiet --no-audio --fs
--loop=inf --no-stop-screensaver
--wid=$XSCREENSAVER_WINDOW
http://your-vm:8080/ n
maze -root n
electricsheep --root 1 n
Inaianei ka tino harikoa o hoa mahi 🙂
Source: will.com