기본 콘텐츠로 건너뛰기

라즈베리파이 키오스크 모드(Kiosk mode)

부팅시 화면 회전
sudo vi /boot/config.txt
add display_rotate=3 ( 이와 같이 작성하면 화면이 시계 방향으로 90도 회전 )
터치스크린까지 바꿀려면..
add lcd_rotate=3

disable_overscan=1
overscan_left=-150
overscan_right=-150
부팅 로그 감추기
sudo vi /boot/cmdline.txt
부팅 이미지 표시하기
sudo apt-get install fbi
vi asplashscreen
아래 do_start 부분에서 이미지 경로를 원하는 이미지로 변경한다.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:     
# Default-Start:     S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description:       Show custom splashscreen
### END INIT INFO

do_start () {
    /usr/bin/fbi -T 1 -noverbose -a /etc/sample.png   
    exit 0
}

case "$1" in
  start|"")
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    # No-op
    ;;
  status)
    exit 0
    ;;
  *)
    echo "Usage: asplashscreen [start|stop]" >&2
    exit 3
    ;;
esac
:
sudo mv asplashscreen /etc/init.d/asplashscreen
sudo chmod a+x /etc/init.d/asplashscreen
sudo insserv /etc/init.d/asplashscreen
만약 바로 위 코드 실행시 current start runlevel(s) (2 3 4 5) of script `asplashscreen’ overrides LSB defaults (S). 라는 에러가 발생한다면, 다음 명령을 실행한다.

sudo insserv -d /etc/init.d/asplashscreen
라즈비안 GPU 메모리 올리기
sudo raspi-config
Advanced Options > Memory Split > 128
재시동
마지막으로 라즈비안을 재시동한다.

sudo reboot
라즈비안 자동 로그인 하기
systemd 사용 하는 경우

ln -fs /lib/systemd/system/getty@.service  /etc/systemd/system/getty.target.wants/getty@tty1.service
To switch back to automatic login, do:
ln -fs /etc/systemd/system/autologin@.service  /etc/systemd/system/getty.target.wants/getty@tty1.service
inittab 사용 하는 경우

 vi /etc/inittab
 1:2345:respawn:/sbin/getty --autologin {USERNAME} --noclear 38400 tty1
x window 설치하기
리눅스에서 디스플레이창을 표시하고 마우스와 키보드와 상호작용하는 GUI 환경을 위한 프레임웍이 x window 이다. 이를 설치해야만 크로미움이 화면에 표시될 수 있다.

sudo apt-get install matchbox-window-manager unclutter xinit xserver-xorg xserver-xorg-legacy x11-xserver-utils
크로미움 설치하기
wget http://launchpadlibrarian.net/237755896/libgcrypt11_1.5.3-2ubuntu4.3_armhf.deb
wget http://launchpadlibrarian.net/263322754/chromium-codecs-ffmpeg-extra_51.0.2704.79-0ubuntu0.14.04.1.1121_armhf.deb
wget http://launchpadlibrarian.net/263322752/chromium-browser_51.0.2704.79-0ubuntu0.14.04.1.1121_armhf.deb

sudo dpkg -i libgcrypt11_1.5.3-2ubuntu4.3_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_51.0.2704.79-0ubuntu0.14.04.1.1121_armhf.deb
sudo dpkg -i chromium-browser_51.0.2704.79-0ubuntu0.14.04.1.1121_armhf.deb
만약 마지막 chromium-browser_51.0.2704.79-0ubuntu0.14.04.1.1121_armhf.deb 설치시 의존성 에러가 발생하면 아래 명령어를 실행한다.

apt-get -f install 실행
크로미움 필요라이브러리 설치
sudo apt install libnss3
sudo apt install -f
한글 설치
sudo apt install ttf-unfonts-core
크로미움 자동 시작 스크립트 만들기
vi /home/pi/startkiosk.sh
#!/bin/bash

# disable DPMS (Energy Star) features.
xset -dpms

# disable screen saver
xset s off

# don't blank the video device
xset s noblank

# disable mouse pointer
unclutter -idle 0 -root &

# run window manager
matchbox-window-manager -use_cursor no -use_titlebar no  &

# run chromuim
#chromium-browser --noerrdialogs --kiosk --incognito https://www.google.co.kr/
if [ $# -ne 0 ];
then
        chromium-browser --noerrdialogs --kiosk --incognito $1
else
        chromium-browser --noerrdialogs --incognito https://www.google.co.kr/
fi
chmod +x /home/pi/startkiosk.sh
실행하기 위해서는 아래 처럼 한다.

vi /home/pi/.profile
if [ -z "${SSH_TTY}" ]; then
  xinit ~/startkiosk.sh
fi
재시동
마지막으로 라즈비안을 재시동한다.

sudo reboot

댓글

이 블로그의 인기 게시물

MTConnect 로 fanuc 의 facus 이용하기

참으로.. 국내 자료는 거의 없다.. 삽질에 삽질에 살집에... 거의 2주 넘게 삽질의 연속.. 먼저 1. cnc 에 facas 설정 2. cnc에 컴퓨터 하나 lan으로 연결해주고 mtconnect adapter 설치 3. 서버용으로 컴터 하나 맞춘후 mtconnect agent 설치 대략 30대 adapter 동시에 돌려보니 서버(agent)에 cpu 사용률 2% 안쪽.. 자세한 정보는 담지 않았지만 나중에 시간되면 자세하게 다루자.. 지원 가능 모델 0i, 32i, 21i 등등.. 거의 모든 i모델은 다되는듯.. cnc, mct 등..

라즈베리파이3B ffmpeg 하드웨어 가속

라즈베리파이3B ffmpeg 하드웨어 가속.. 일단.. 혹시 깔려 있을지 모르는 ffmpeg 를 제거 하자 sudo apt remove ffmpeg git 설치 sudo apt install git build-essential h264 라이브러리 설치 git clone git://git.videolan.org/x264 cd x264 ./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl make -j4 sudo make install ffmpeg 설치 sudo git clone https://github.com/FFmpeg/FFmpeg.git cd FFmpeg ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree --enable-mmal make -j4 sudo make install 시간이 엄청나게 걸린다.. 그리고 cpu 온도 80도 넘어가니 주의 할것 ㅎㅎ 이제 라즈베리파이에서 h264_mmal / h264_omx 사용가능 그러면 teheadend 에서 트랜스코딩 가능 프로파일에 있는 트렌스코딩이 아니라 우선 코딩해서 넘기는 방식 사용법은 vim transcoding.sh #!/bin/sh ffmpeg -c:v h264_mmal -i $1 -c:v h264_omx -preset ultrafast -f mpegts pipe:1 파일하나 만들고 m3u파일에 pipe:///home/pi/transcoding.sh rtp://xxx.xxx.xxx.xxx:5000 이런식으로 사용 라즈베리파이로도 tvheadend 트랜스 코딩이 가능! 동시 시청 2~3대 까지는 가능하다. ^^v -- 추가 -- 약간 쾌적하게 트랜스코딩 하는 방법 추가 했습니다. https://n...