티스토리 뷰
출처 : 라즈베리파이 활용 강좌 : 라즈베리 파이로 원격 데스크탑 사용하기
파이카메라 활용강좌 : V4L2(Video4Linux) 와 VLC 를 이용한 RTSP Streaming
Raspberry PI OS 설치
출처 : 라즈베리 파이 시작하기_OS설치
1. SD Format
SD Formatter for Windows용을 받아서 포맷한다.
2. OS 받기
NOOBS 받기
3. 앞축을 풀고 파일 복사
4. 부팅
SSH 데몬 실행
$ sudo raspi-config
키 생성 오류가 있으면 아래처러 키를 삭제하고 다시 SSH 모둘 확설화를 해본다.
$ sudo rm /etc/ssh/ssh_host* $ sudo ssh-keygen -A
LCD 설정
출처 : [버섯] 라즈베리 파이용 2.8인치 액정 쉴드(TFT LCD)
Waveshare 3.2/3.5/4 인치 TFT LCD 설정 방법
WaveShare SpotPear 3.2" and 3.5/4.0" TFT LCD overlays for the Raspberry PI and PI 2
waveshare 3.2inch tft-lcd setup - LCD에 Xwindow 띄우기
펌웨어 업그레이드
$ sudo apt-get update $ sudo apt-get upgrade
SPI 모둘 활성화
$ sudo raspi-config
FBTFT 드라이버들을 파일 시스템의 모듈 설치 디렉토리에 설치하고 다시 재부팅
$ sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom *** Performing self-update *** Relaunching after update *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom *** We're running for the first time *** Backing up files (this will take a few minutes) *** Remove old firmware backup *** Backing up firmware *** Remove old modules backup *** Backing up modules 3.18.11+ *** Downloading specific firmware revision (this will take a few minutes) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 167 0 167 0 0 156 0 --:--:-- 0:00:01 --:--:-- 224 100 47.9M 100 47.9M 0 0 821k 0 0:00:59 0:00:59 --:--:-- 1064k *** Updating firmware *** Updating kernel modules *** depmod 4.0.7+ *** depmod 4.0.7-v7+ *** Updating VideoCore libraries *** Using HardFP libraries *** Updating SDK *** Running ldconfig *** Storing current firmware revision *** Deleting downloaded files *** Syncing changes to disk *** If no errors appeared, your firmware was successfully updated to b2f5782d2a61cdfa1967942d34eae48900266ae1 *** A reboot is needed to activate the new firmware $ sudo reboot
WaveShare TFT LCD 용으로 만들어진 Device Tree 파일 (dtb) 을 다운로드
$ git clone https://github.com/swkim01/waveshare-dtoverlays.git
TFT LCD 의 종류에 따라 해당하는 dtb 파일을 /boot/overlays/ 디렉토리에 복사
$ sudo cp waveshare-dtoverlays/waveshare32b-overlay.dtb /boot/overlays/
/boot/config.txt 파일을 수정하여 커널 초기화 시에 TFT LCD 모듈을 적재하는 코드를 추가
$ sudo vi /boot/config.txt
3.2인치
dtparam=spi=on dtoverlay=waveshare32b
참고로 화면을 회전시키는 등의 매개변수를 설정하려면 다음 예와 같이 하면 됩니다.
dtoverlay=waveshare32b:rotate=270
HDMI에서 TFT-LCD로 출력 바꾸기
$ vi /usr/share/X11/xorg.conf.d/99-fbturbo.conf
Option "fbdev" "/dev/fb1" -- fb1이면 TFT-LCD / fb0이면 HDMI
Section "Device" Identifier "Allwinner A10/A13 FBDEV" Driver "fbturbo" Option "fbdev" "/dev/fb1" Option "SwapbuffersWait" "true" EndSection
Force X windows to Load to PiScreen Automatically on boot
출처 : Enable X windows on PiScreen
자동 로그인
$ sudo vi /etc/inittab
수정전
1:2345:respawn:/sbin/getty --noclear 38400 tty1
수정후
#1:2345:respawn:/sbin/getty --noclear 38400 tty1 1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1
부팅시 X windows 시작
/etc/rc.local 파일의 exit 구문 위에 내용추가
$ sudo vi /etc/rc.local
su -l pi -c "env FRAMEBUFFER=/dev/fb1 startx &"
RDP 서버 데몬 실행
$ sudo apt-get install xrdp Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: tightvncserver xfonts-base Suggested packages: tightvnc-java The following NEW packages will be installed: tightvncserver xfonts-base xrdp 0 upgraded, 3 newly installed, 0 to remove and 38 not upgraded. Need to get 7,219 kB of archives. After this operation, 11.5 MB of additional disk space will be used. Do you want to continue [Y/n]? Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main tightvncserver armhf 1.3.9-6.4 [786 kB] Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main xfonts-base all 1:1.0.3 [6,181 kB] Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main xrdp armhf 0.5.0-2 [252 kB] Fetched 7,219 kB in 11s (605 kB/s) Selecting previously unselected package tightvncserver. (Reading database ... 77911 files and directories currently installed.) Unpacking tightvncserver (from .../tightvncserver_1.3.9-6.4_armhf.deb) ... Selecting previously unselected package xfonts-base. Unpacking xfonts-base (from .../xfonts-base_1%3a1.0.3_all.deb) ... Selecting previously unselected package xrdp. Unpacking xrdp (from .../xrdp_0.5.0-2_armhf.deb) ... Processing triggers for man-db ... Processing triggers for fontconfig ... Setting up tightvncserver (1.3.9-6.4) ... update-alternatives: using /usr/bin/tightvncserver to provide /usr/bin/vncserver (vncserver) in auto mode update-alternatives: using /usr/bin/Xtightvnc to provide /usr/bin/Xvnc (Xvnc) in auto mode update-alternatives: using /usr/bin/tightvncpasswd to provide /usr/bin/vncpasswd (vncpasswd) in auto mode Setting up xfonts-base (1:1.0.3) ... Setting up xrdp (0.5.0-2) ... Generating xrdp RSA keys...... Generating 512 bit rsa key... ssl_gen_key_xrdp1 ok saving to /etc/xrdp/rsakeys.ini done (done). Starting Remote Desktop Protocol server : xrdp sesman.
원격 데스크톱 연결
Raspberry PI 무선랜 설정
츨처 : wpa_supplicant를 사용한 무선랜 사용 ( WPAPSK 무선 보안 방식 / AES 암호화 )
USB 연결 상태 확인
$ lsusb Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter Bus 001 Device 004: ID 24ae:2000
/etc/network/interfaces 확인
$ cat /etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
Wifi SSID 조회
$ sudo iwlist wlan0 scan | grep SSID ESSID:"kuksu" ESSID:"LUSSOSO_WIFI" ESSID:"netis 2G" ESSID:"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ESSID:"hak" ESSID:"sung" ESSID:"asran" ESSID:"iptime-g" ESSID:"U+Net3823" ESSID:"U+zone" ESSID:"\x00" ESSID:"" ESSID:"smhouse" ESSID:"\x00"
wpa_passphrase
$ wpa_passphrase "netis 2G" "aaaaaaaa" network={ ssid="netis 2G" #psk="aaaaaaaa" psk=47277e223f0edfc12e24b9d690c7231863048a7fbb11ae3fecc6c7c360b4067b }
/etc/network/interfaces 수정
$ cat /etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "netis 2G" wpa-psk "aaaaaaaa"
-
$ iwconfig wlan0 IEEE 802.11bgn ESSID:"netis 2G" Mode:Managed Frequency:2.412 GHz Access Point: 04:8D:38:17:96:00 Bit Rate=121.5 Mb/s Tx-Power=20 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality=70/70 Signal level=-29 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:51 Missed beacon:0 lo no wireless extensions. eth0 no wireless extensions.
PI Camera 설정
출처 : 라즈베리파이에 카메라 입출력을 받아보자. V4L2(Video4Linux2)설치
파이카메라 활용강좌 : 라즈베리파이 Pi-cam V4L2(Video4Linux2) 설치
라즈베리파이 카메라 성능 테스트
How to install or upgrade UV4L on Raspbian (for the Raspberry Pi)
GPU, Kernel 업데이트 (옵션)
$ sudo apt-get update $ sudo apt-get upgrade
Pi-Camera 장치 활성화
$ sudo raspi-config
Pi-Camera 캡쳐
$ raspistill -v -o test.jpg raspistill Camera App v1.3.8 Width 2592, Height 1944, quality 85, filename test.jpg Time delay 5000, Raw no Thumbnail enabled Yes, width 64, height 48, quality 35 Link to latest frame enabled no Full resolution preview No Capture method : Single capture Preview Yes, Full screen Yes Preview window 0,0,1024,768 Opacity 255 Sharpness 0, Contrast 0, Brightness 50 Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0 Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none' Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128 Rotation 0, hflip No, vflip No ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000 Camera component done Encoder component done Starting component connection stage Connecting camera preview port to video render. Connecting camera stills port to encoder input port Opening output file test.jpg Enabling encoder output port Starting capture 0 Finished capture 0 Closing down Close down completed, all components disconnected, disabled and destroyed
V4L2(Video4Linux2) 드라이버 활성화
$ ls /dev/vi* ls: cannot access /dev/vi*: No such file or directory $ sudo modprobe bcm2835-v4l2 $ ls /dev/vi* /dev/video0
V4L2(Video4Linux2) 부팅시 활성화 시키기
$ sudo vi /etc/modules
아래 내용 추가
bcm2835-v4l2
V4L2(Video4Linux2) 인증키 설치
$ wget http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc && sudo apt-key add ./lrkey.asc --2015-07-17 10:54:30-- http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc Resolving www.linux-projects.org (www.linux-projects.org)... 62.149.140.25 Connecting to www.linux-projects.org (www.linux-projects.org)|62.149.140.25|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1337 (1.3K) [application/pgp-signature] Saving to: `lrkey.asc' 100%[======================================>] 1,337 --.-K/s in 0s 2015-07-17 10:54:31 (14.2 MB/s) - `lrkey.asc' saved [1337/1337] OK
소스리스트 추가 및 업데이트(apt-get update시 같이 업데이트 됨)
$ echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main " | sudo tee -a /etc/apt/sources.list $ sudo apt-get update -y
UV4L및 Pi-Camera 드라이버 설치
$ sudo apt-get install uv4l uv4l-raspicam Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: uv4l uv4l-raspicam 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1,937 kB of archives. After this operation, 5,538 kB of additional disk space will be used. Get:1 http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy/main uv4l armhf 1.9.5-1 [559 kB] Get:2 http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy/main uv4l-raspicam armhf 1.9.27 [1,377 kB] Fetched 1,937 kB in 3min 31s (9,144 B/s) Selecting previously unselected package uv4l. (Reading database ... 78363 files and directories currently installed.) Unpacking uv4l (from .../uv4l_1.9.5-1_armhf.deb) ... Selecting previously unselected package uv4l-raspicam. Unpacking uv4l-raspicam (from .../uv4l-raspicam_1.9.27_armhf.deb) ... Processing triggers for man-db ... Setting up uv4l (1.9.5-1) ... Setting up uv4l-raspicam (1.9.27) ...
V4L2 장치활성화
$ uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --encoding jpeg --frame-time 0[core] Trying driver 'raspicam' from built-in drivers... [core] Driver 'raspicam' not found [core] Trying driver 'raspicam' from external plug-in's... [driver] Dual Raspicam Video4Linux2 Driver v1.9.27 built Feb 21 2015 [driver] Selected format: 640x480, encoding: jpeg, JPEG Still Capture [driver] Framerate max. 30 fps [driver] ROI: 0, 0, 1, 1 [core] Device detected! [core] Cannot create /dev/video0 because file already exists [core] Registering device node /dev/video1
사진촬영 테스트
$ dd if=/dev/video0 of=snapshot.jpeg bs=11M count=1 0+1 records in 0+1 records out 238909 bytes (239 kB) copied, 1.13632 s, 210 kB/s
Raspberry PI 부팅시 UV4L 드라이버가 로딩되게 하려면 추가 패키지를 설치 (옵션)
$ sudo apt-get install uv4l-raspicam-extras
Camera 사용하고 잇는 프로세스 중지
$ fuser /dev/video0 /dev/video0: 2593m $ ps axl | grep 2593 0 1000 2593 2560 20 0 152888 64416 futex_ Sl+ pts/1 4:00 vlc 0 1000 2775 2604 20 0 5380 3008 pipe_w S+ pts/2 0:00 grep --color=auto 2593 $ kill -9 2593
Tomcat 설치
$ sudo wget http://mirror.apache-kr.org/tomcat/tomcat-7/v7.0.63/bin/apache-tomcat-7.0.63.tar.gz $ sudo tar xvfz apache-tomcat-7.0.63.tar.gz
한글사용
라즈베리파이 기초강좌 : GUI 환경에서 한글 사용하기
$ sudo apt-get install ibus ibus-hangul ttf-unfonts-core
- Total
- Today
- Yesterday
- ble
- koba2010
- Xcode
- Delphi
- Spring MVC
- NDK
- ffmpeg
- 송주경
- 서울오토살롱
- Mac
- 일본여행
- flex
- 튜닝쇼 2008
- BPI-M4
- oracle
- KOBA
- Java
- android
- Spring
- 지스타2007
- 레이싱모델 익스트림 포토 페스티벌
- MySQL
- Linux
- ubuntu
- 전예희
- 동경
- sas2009
- Delphi Tip
- SAS
- JavaScript
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |