Ke ne ke hloka ho bonts'a dashboard e nang le leihlo likrineng tse 'maloa ka ofising. Ho na le Raspberry Pi Model B + ea khale le hypervisor e nang le lisebelisoa tse batlang li se na moeli.
Kamoo ho bonahalang kateng, Raspberry Pi Model B + ha e na mokhoa o lekaneng oa ho boloka sebatli se ntse se sebetsa le ho fana ka litšoantšo tse ngata ho eona, ka lebaka leo ho etsahalang hore leqephe le na le karolo e itseng 'me hangata le senyeha.
Ho ne ho e-na le tharollo e bonolo le e ntle, eo ke batlang ho e arolelana le uena.
Joalo ka ha u tseba, li-Raspberries kaofela li na le processor ea video e matla, e ntle bakeng sa ho hlophisa video ea hardware. Kahoo ho ile ha hlaha mohopolo oa ho qala sebatli se nang le dashboard sebakeng se seng, le ho fetisetsa molatsoana o lokiselitsoeng o nang le setšoantšo se hlahisitsoeng ho raspberry.
Ho feta moo, sena se lokela ho ba le taolo e nolofalitsoeng, kaha tabeng ena tlhophiso eohle e tla etsoa mochine o le mong oa sebele, oo ho leng bonolo ho o ntlafatsa le ho boloka.
Ka pele ka potlako.
Karolo ea seva
Re sebelisa ho itokisetsa
Re kenya mochine o mocha oa sebele 'me pele ho tsohle re o kenya ho oona
apt-get update
apt-get install -y xserver-xorg nodm fluxbox
sed -i 's/^NODM_USER=.*/NODM_USER=ubuntu/' /etc/default/nodm
Re tla sebelisa config bakeng sa Xorg, ka mosa
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
Joale re tla kenya Firefox, re tla e tsamaisa joalo ka ts'ebeletso ea sistimi, ka hona re tla e ngolla faele ea yuniti bakeng sa eona:
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
Re hloka Xdotool e le hore re tsamaise firefox hang-hang ka mokhoa o felletseng oa skrineng.
Ho sebelisa parameter -url
o ka hlakisa leqephe lefe kapa lefe hore le bulehe ka bohona ha sebatli se qala.
Mothating ona, kiosk ea rona e se e loketse, empa joale re hloka ho romella setšoantšo ka marang-rang ho li-monitor le lisebelisoa tse ling. Ho etsa sena, re tla sebelisa menyetla
Bakeng sa sena re hloka lintho tse peli:
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
Kaha setšoantšo sa rona ha se hloke ntlafatso e potlakileng, ke hlalositse sekhahla sa ho khatholla: 1 foreimi motsotsoana (parameter -r 1
) le boleng ba compression: 5 (parameter -q:v 5
)
Joale ha re lekeng ho ea ho
Lehlakore la moreki
Ho ntse ho le bonolo mona, joalo ka ha ke boletse, re tla sebelisa Raspberry Pi Model B +.
Pele ho tsohle, a re e kenye
Hape re tla hloka ho fana ka memori e eketsehileng bakeng sa chip ea rona ea video, bakeng sa sena re tla e hlophisa /boot/config.txt
gpu_mem=128
Ha re qaleng sistimi ea rona e ncha 'me u seke oa lebala ho qala senotlolo sa pacman, kenya
pacman -Sy omxplayer
Ho makatsang ke hore OMXPlayer e ka sebetsa ntle le x, kahoo seo re se hlokang feela ke ho e ngolla faele ea yuniti le ho e tsamaisa:
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
Joalo ka paramente -b http://your-vm:8080/
re fetisa url ho tsoa ho seva sa rona.
Ke phetho, setšoantšo se tsoang ho seva sa rona se lokela ho hlaha hang-hang skrineng se hokahaneng. Haeba ho na le mathata, molapo o tla qala hape ka bohona mme bareki ba tla hokela ho ona hape.
Joalo ka bonase, o ka kenya setšoantšo se hlahisoang joalo ka skrini ho likhomphutha tsohle tse ofising. Bakeng sa sena u tla hloka
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
Hona joale basebetsi-'moho le uena ba tla thaba haholo 🙂
Source: www.habr.com