Mo nilo lati ṣafihan dasibodu pẹlu ibojuwo lori ọpọlọpọ awọn iboju ni ọfiisi. A ni ọpọlọpọ atijọ Rasipibẹri Pi awoṣe B+ ati hypervisor pẹlu ohun elo ailopin ti o fẹrẹẹ.
Nkqwe Rasipibẹri Pi Awoṣe B + ko ni aileto ti o to lati jẹ ki ẹrọ aṣawakiri ṣiṣẹ nigbagbogbo ati mu iye nla ti awọn eya aworan wa ninu rẹ, eyiti o jẹ idi ti o ṣẹlẹ pe oju-iwe naa jẹ didan ni apakan ati nigbagbogbo ipadanu.
Mo rii ojutu ti o rọrun ati didara, eyiti Mo fẹ pin pẹlu rẹ.
Bi o ṣe mọ, gbogbo awọn Raspberries ni ero isise fidio ti o lagbara ti o lagbara, eyiti o dara julọ fun iyipada fidio ohun elo. Nitorinaa ero naa wa lati ṣe ifilọlẹ ẹrọ aṣawakiri kan pẹlu dasibodu kan ni ibomiiran, ati gbe ṣiṣan ti a ti ṣetan pẹlu aworan ti a ṣe si rasipibẹri naa.
Pẹlupẹlu, eyi yẹ ki o ni iṣakoso irọrun, nitori ninu ọran yii gbogbo iṣeto yoo ṣee ṣe lori ẹrọ foju kan, eyiti yoo rọrun lati ṣe imudojuiwọn ati afẹyinti.
Ki a to Wi ki a to so.
Abala olupin
A yoo lo awọn setan
A ran ẹrọ foju tuntun kan ati akọkọ ti gbogbo fi sii lori rẹ
apt-get update
apt-get install -y xserver-xorg nodm fluxbox
sed -i 's/^NODM_USER=.*/NODM_USER=ubuntu/' /etc/default/nodm
A yoo tun lo atunto fun Xorg, inu rere
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
Bayi a yoo fi Firefox sori ẹrọ, a yoo ṣiṣẹ bi iṣẹ eto, nitorinaa jẹ ki a kọ faili ẹyọkan fun ni ọna kan:
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
A nilo Xdotool lati le ṣe ifilọlẹ Firefox lẹsẹkẹsẹ ni ipo iboju kikun.
Lilo paramita -url
O le pato oju-iwe eyikeyi ki o ṣii laifọwọyi nigbati ẹrọ aṣawakiri ba bẹrẹ.
Ni ipele yii, kiosk wa ti ṣetan, ṣugbọn ni bayi a nilo lati okeere aworan lori nẹtiwọọki si awọn diigi ati awọn ẹrọ miiran. Lati ṣe eyi a yoo lo awọn anfani
Lati ṣe eyi a nilo awọn nkan meji:
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
Niwọn bi aworan wa ko nilo imudojuiwọn ni iyara, Mo ṣalaye oṣuwọn isọdọtun: 1 fireemu fun iṣẹju kan (paramita -r 1
) ati didara funmorawon: 5 (paramita -q:v 5
)
Bayi jẹ ki a gbiyanju lati lọ si
Apa onibara
Nibi ohun gbogbo paapaa rọrun, bi Mo ti sọ tẹlẹ, a yoo lo Rasipibẹri Pi Awoṣe B +.
Ni akọkọ, jẹ ki a fi sori ẹrọ lori rẹ
A yoo tun nilo lati pin iranti diẹ sii fun chirún fidio wa, fun eyi a yoo ṣatunkọ ni /boot/config.txt
gpu_mem=128
Jẹ ki a bata eto tuntun wa ati, ni iranti lati bẹrẹ bọtini pacman, fi sori ẹrọ
pacman -Sy omxplayer
Ohun ti o ṣe akiyesi ni pe OMXPlayer le ṣiṣẹ laisi X, nitorinaa gbogbo ohun ti a nilo ni lati kọ faili ẹyọkan fun rẹ ati ṣiṣe:
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
Bi paramita -b http://your-vm:8080/
a n kọja URL lati olupin wa.
Iyẹn ni gbogbo rẹ, aworan lati ọdọ olupin wa yẹ ki o han lẹsẹkẹsẹ loju iboju ti a ti sopọ. Ti awọn iṣoro eyikeyi ba waye, ṣiṣan naa yoo tun bẹrẹ laifọwọyi ati awọn alabara yoo tun sopọ mọ rẹ.
Gẹgẹbi ajeseku, o le fi aworan abajade sori ẹrọ bi iboju iboju lori gbogbo awọn kọnputa ni ọfiisi. Fun eyi iwọ yoo nilo
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
Bayi awọn ẹlẹgbẹ rẹ yoo dun pupọ :)
orisun: www.habr.com