Achọrọ m igosipụta dashboard nwere nleba anya n'ọtụtụ ihuenyo n'ọfịs. Anyị nwere ọtụtụ ochie Raspberry Pi Model B+ yana hypervisor nwere ihe fọrọ nke nta ka ọ bụrụ ego na-akparaghị ókè.
O doro anya na Raspberry Pi Model B+ enweghị usoro zuru oke iji mee ka ihe nchọgharị ahụ na-agba ọsọ mgbe niile ma na-enye nnukwu eserese na ya, nke mere na ọ na-eme na ibe ahụ na-egbuke egbuke ma na-adakarị.
Achọtara m ngwọta dị mfe ma mara mma, nke m chọrọ ịkọrọ gị.
Dị ka ị maara, Raspberries niile nwere ihe nrụpụta vidiyo siri ike, nke mara mma maka ngbanwe vidiyo ngwaike. Ya mere, echiche ahụ bịara ibido ihe nchọgharị nwere dashboard ebe ọzọ, wee bufee iyi emebere nke nwere ihe oyiyi egosipụtara na raspberry.
Na mgbakwunye, nke a kwesịrị ịnwe njikwa dị mfe, ebe ọ bụ na nke a ga-eme ntọala niile n'otu igwe mebere, nke ga-adị mfe imelite na nkwado ndabere.
Ekwughi ekwu bụ emeghị eme.
Akụkụ nkesa
Anyị ga-eji njikere
Anyị na-ebugharị igwe mebere ọhụrụ wee wụnye ya na ya
apt-get update
apt-get install -y xserver-xorg nodm fluxbox
sed -i 's/^NODM_USER=.*/NODM_USER=ubuntu/' /etc/default/nodm
Anyị ga-ejikwa config maka Xorg, obiọma
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
Ugbu a, anyị ga-etinye Firefox, anyị ga-agba ya dị ka ọrụ sistemụ, yabụ ka anyị dee otu faịlụ maka ya n'otu oge:
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
Anyị chọrọ Xdotool iji malite Firefox ozugbo na ọnọdụ ihuenyo zuru oke.
Iji paramita -url
Ị nwere ike ịkọwa ibe ọ bụla ka ọ mepee na-akpaghị aka mgbe ihe nchọgharị malitere.
N'oge a, kiosk anyị adịla njikere, mana ugbu a, anyị kwesịrị ibupụ ihe onyonyo a na netwọkụ na ngwaọrụ ndị ọzọ. Iji mee nke a, anyị ga-eji ohere ndị ahụ mee ihe
Iji mee nke a, anyị chọrọ ihe abụọ:
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
Ebe ọ bụ na onyonyo anyị achọghị imelite ngwa ngwa, akọwapụtara m ọnụego ume ọhụrụ: 1 etiti kwa sekọnd (parameter -r 1
) na àgwà mkpakọ: 5 (parameter -q:v 5
)
Ugbu a, ka anyị gbalịa ịga
Akụkụ ndị ahịa
N'ebe a, ihe niile dị mfe karị, dịka m kwurula, anyị ga-eji Raspberry Pi Model B +.
Mbụ niile, ka wụnye na ya
Anyị ga-achọkwa itinyekwu ebe nchekwa maka mgbawa vidiyo anyị, maka nke a anyị ga-edezi ya /boot/config.txt
gpu_mem=128
Ka anyị buo sistemụ ọhụrụ anyị, na icheta ibido igodo pacman, wụnye
pacman -Sy omxplayer
Ihe dị ịrịba ama bụ na OMXPlayer nwere ike ịrụ ọrụ na-enweghị X, yabụ naanị ihe anyị chọrọ bụ ide otu faịlụ maka ya wee gbaa ọsọ:
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
Dị ka paramita -b http://your-vm:8080/
anyị na-agafe URL site na sava anyị.
Nke ahụ bụ naanị, foto sitere na sava anyị kwesịrị ịpụta ozugbo na ihuenyo ejikọrọ. Ọ bụrụ na nsogbu ọ bụla bilitere, iyi ahụ ga-amalitegharị na-akpaghị aka na ndị ahịa ga-ejikọkwa ya na ya.
Dị ka ego, ị nwere ike ịwụnye ihe oyiyi dị ka ihe nchekwa na kọmputa niile dị n'ọfịs. Maka nke a ị ga-achọ
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
Ugbu a ndị ọrụ ibe gị ga-enwe obi ụtọ :)
isi: www.habr.com