"Raspberry Pi"의 두 판 사이의 차이

오픈소스 비즈니스 컨설팅
둘러보기로 가기 검색하러 가기
(새 문서: Raspberry Pi 정리 == Raspberry 개요 == == 참고 문헌 ==)
 
 
(같은 사용자의 중간 판 91개는 보이지 않습니다)
1번째 줄: 1번째 줄:
 
Raspberry Pi 정리
 
Raspberry Pi 정리
 +
 +
*홈페이지 : [http://www.raspberrypi.org/ http://www.raspberrypi.org/]
 +
*다운로드 : [http://www.raspberrypi.org/downloads/ http://www.raspberrypi.org/downloads/]
 +
**구매 : [http://www.icbanq.com/ http://www.icbanq.com/]
 +
*라이선스 : 
 +
*플랫폼 : 
  
 
== Raspberry 개요 ==
 
== Raspberry 개요 ==
 +
 +
영국 Raspberry Pi 재단에서 만든 초소형 PC (2012.03), $35 (모델 B)<br/>700 MHz * ARM * GPU / 512 MB Memory / SD 카드 / 100 M bits Network<br/>영상 출력&nbsp;: 컴포지트, HDMI, DSI<br/>음성 출력&nbsp;: 잭, HDMI<br/>USB, GPIO<br/>OS&nbsp;: NO OBS, 라즈비안, Apache Linux, Pidora, RISC OS
 +
 +
http://assets.windowsphone.com/3f82dfe6-a179-4ddf-9738-91989190c3fa/IoT-rpi2-board_InvariantCulture_Default.png
 +
 +
Raspberry Pi 3 B 사양
 +
* 4 Core (1.2 GHz) / 1 GB Memory / 16 GB Disk
 +
* CentOS Linux release 7.5.1804 (AltArch), 32 bits
 +
 +
== 싱글 보드 컴퓨터의 종류 ==
 +
 +
{| border="1" cellspacing="0" cellpadding="1" style="line-height: 20.7999992370605px; width: 100%;"
 +
|-
 +
| style="text-align: center; background-color: rgb(204, 204, 204);" | 싱글 보드 컴퓨터
 +
| style="text-align: center; background-color: rgb(204, 204, 204);" | 상세
 +
|-
 +
| <p style="text-align: center;">Arduino<br/>(arduino.cc)</p><p style="text-align: center;">$27</p>
 +
|
 +
*오픈소스 마이크로 컨트롤러 보드
 +
**다수의 스위치 또는 센서로부터 입력
 +
**LED 또는 모터와 같은 외부 장치를 제어
 +
**USB 또는 별도의 전원 필요
 +
*Atmel의 AVR 기반 제품
 +
**Arduino Uno &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: 16 MHz, 2 KB SRAM, $27
 +
**Arduino Zero
 +
*Cortex-M3 기반 제품 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;: Arduino Due
 +
*통합 개발 환경 (IDE)
 +
**어도비 플래시, Processing (Java 기반), Max/MSP
 +
**Linux, Windows, Mac OS X 지원
 +
*Arduino 1.0.6 (2013.05.15)
 +
*Arduino 1.5.8 Beta (Arduino Due)
 +
*Shield&nbsp;: 확장 부품. 유무선 통신, GPS 수신, 음악 재생 등
 +
 +
|-
 +
| style="text-align: center;" |
 +
Raspberry Pi
 +
 +
(www.raspberrypi.org)
 +
 +
$35
 +
 +
|
 +
*영국 Raspberry Pi 재단에서 만든 초소형 PC (2012.03), $35 (모델 B)
 +
*700 MHz * ARM * GPU / 512 MB Memory / SD 카드 / 100 M bits Network
 +
*영상 출력&nbsp;: 컴포지트, HDMI, DSI
 +
*음성 출력&nbsp;: 잭, HDMI
 +
*USB, GPIO
 +
*OS&nbsp;: NO OBS, 라즈비안, Apache Linux, Pidora, RISC OS
 +
*Raspberry Pi 2 Model B
 +
*Raspberry Pi 1&nbsp;Model B+&nbsp;: 2015년 2월 출시
 +
 +
|-
 +
| style="text-align: center;" |
 +
BeagleBone Black (BBB)
 +
 +
(beagleboard.org)
 +
 +
$55
 +
 +
|
 +
*ARM 기반의 오픈소스 하드웨어
 +
*1 GHz / 512 MB DDR3 RAM / 4 GB eMMC 저장 공간
 +
*USB, Ethernet, HDMI, 2 * 46 pin headers
 +
*Linux kernel (3.10.x, 3.8.x) 지원
 +
**Debian, Angstrom Linux, Android, Ubuntu
 +
 +
|-
 +
| style="text-align: center;" |
 +
Intel Gallireo
 +
 +
$60
 +
 +
|
 +
*인텔에서 개발한 오픈소스 하드웨어 보드로 Arduino와 호환
 +
*Gallireo (2013.10, 2014.06.03 종료), $70
 +
**x86 프로세스 기반. 반드시 별도의 전원이 필요. Linux가 구동
 +
**400 MHz, 512 KB SRAM
 +
**장치&nbsp;: 이더넷, 마이크로 SD 카드, USB 호스트, Real Time Clock, RS232 포트, 미니 PCI 익스프레스 지원
 +
*Gallireo Gen 2 (2014.08), $60
 +
**32 bits 인텔 펜티엄 브랜드
 +
**Linux, Windows, Mac OS X 호스트 운영 체제 지원
 +
**PWM 해상도 증가와 GPIO 성능과 토글링 기능 향상
 +
*[http://www.intel.co.kr/content/www/kr/ko/do-it-yourself/galileo-maker-quark-board.html <font color="#333333">http://www.intel.co.kr/content/www/kr/ko/do-it-yourself/galileo-maker-quark-board.html</font>]
 +
*[http://www.intel.co.kr/content/www/kr/ko/intelligent-systems/galileo/galileo-overview.html <font color="#333333">http://www.intel.co.kr/content/www/kr/ko/intelligent-systems/galileo/galileo-overview.html</font>]
 +
 +
|-
 +
| style="text-align: center;" |
 +
Intel Edison
 +
 +
$50
 +
 +
|
 +
*SD 카드 모양의 소형 컴퓨터, 2014.01.08
 +
**400 MHz * 듀얼 코어, 512 KB SRAM, 2 GB Storage
 +
**장치&nbsp;: 내장그래픽, 블루투스, WiFi
 +
**Yocto Linux 1.6으로 구동
 +
*에디슨 (2014.09), $50
 +
**500 MHz * 듀얼코아 Atom * 듀얼 스레드 + 100 MHz 32 bits 쿼크 프로세스
 +
**1 GB LPDDR3 (Memory) / 4 GB eMMC 플래시 메모리 (Disk)
 +
**무선랜, 블루투스 4.0LE
 +
**개발 환경&nbsp;: Arduino, C, C++, 파이선 등
 +
*보드&nbsp;: Breakout Board ($75), Arduino Kit ($100, 아두이노와 호환)
 +
 +
|}
 +
 +
== OS 설치 ==
 +
 +
=== Raspberry Pi 3에 CentOS 7 설치 ===
 +
 +
* http://mirror.centos.org/altarch/7/isos/armhfp/ 사이트에서 CentOS 7 다운로드 (CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw.xz)
 +
:* https://www.kraxel.org/repos/images/
 +
:* http://mirror.centos.org/altarch/7/isos/aarch64/
 +
* 압축을 풀어 CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일을 만든다.
 +
* CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일은 SD에 굽는다.
 +
:* [https://etcher.io/ Etcher]을 사용하여 SD에 굽는다.
 +
 +
root / centos 로 로그인하여 사용 한다.
 +
 +
* 설치된 사양
 +
:* CentOS Linux release 7.5.1804 (Core), 32 bits
 +
:* 4 cores
 +
 +
Disk resize
 +
 +
rootfs-expand
 +
df -h
 +
 +
Network 설정
 +
# systemctl  stop    NetworkManager.service
 +
# systemctl  disable  NetworkManager.service
 +
# systemctl  status  NetworkManager.service
 +
#
 +
# systemctl stop    firewalld.service
 +
# systemctl disable  firewalld.service
 +
# systemctl status  firewalld.service
 +
#
 +
# getenforce
 +
# vi  /etc/sysconfig/selinux
 +
#    SELINUX=disabled
 +
# setenforce 0
 +
# shutdown  -r  now
 +
#
 +
# cd  /etc/sysconfig/network-scripts
 +
# mv  ifcfg-link  nouse_ifcfg-link
 +
# vi  ifcfg-eth0
 +
#    DEVICE=eth0
 +
#    TYPE="Ethernet"
 +
#    BOOTPROTO="dhcp"
 +
#    ONBOOT="yes"
 +
#    NM_CONTROLLED="no"
 +
# shutdown  -r  now
 +
# systemctl  restart  network.service
 +
# ping -c 3 google -v
 +
 +
WiFi 설정
 +
yum -y install wpa_supplicant NetworkManager NetworkManager-wifi
 +
systemctl enable  NetworkManager.service
 +
systemctl disable NetworkManager-wifi.service
 +
systemctl start  NetworkManager.service
 +
systemctl stop    NetworkManager-wifi.service
 +
 +
nmcli dev wifi rescan
 +
nmcli dev wifi list                                        #--- WiFi 이름 확인
 +
nmcli --ask dev wifi connect ${와이파이_이름}                    #--- WiFi 연결
 +
 +
# cd  /etc/sysconfig/network-scripts
 +
# vi  ifcfg-wlan0
 +
#    DEVICE=wlan0
 +
#    TYPE="Ethernet"
 +
#    BOOTPROTO="dhcp"
 +
#    ONBOOT="yes"
 +
#    NM_CONTROLLED="no"
 +
# wpa_cli reconfigure
 +
# ifdown wlan0
 +
# ifup  wlan0
 +
#
 +
# vi /etc/sysconfig/wpa_supplicant
 +
# wpa_passphrase ${SSID} ${비밀번호}                              #--- WPA2 등을 사용할 경우 psk 값을 생성
 +
# vi  /etc/wpa_supplicant/wpa_supplicant.conf
 +
#    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev    #--- netdev, wheel
 +
#    network={
 +
#        ssid="접속하고자 하는 wifi 이름"
 +
#        psk="접속하고자 하는 wifi 비밀번호"                   
 +
#        # psk=NONE                                              #--- 비밀번호 없음
 +
#        scan_ssid=1                                            #--- SSID를 자동으로 찾기
 +
#        # key_mgmt=WPA-PSK
 +
#        priority=1
 +
#    }
 +
 +
Bluetooth 설정
 +
# yum -y install NetworkManager-bluetooth
 +
# # systemctl enable NetworkManager-bluetooth.service
 +
# # systemctl start  NetworkManager-bluetooth.service
 +
# systemctl restart  NetworkManager.service
 +
 +
기본 S/W 설치
 +
yum -y install which
 +
# yum -y install wireless-tools wpa_supplicant dhcpcd   
 +
 +
timedatectl list-timezones | grep -i seoul
 +
timedatectl set-timezone Asia/Seoul
 +
 +
참고 문헌
 +
* https://soulsearcher.github.io/blog/2017/11/23/centos7_setup2/
 +
* https://rharmonson.github.io/cos7instpi.html
 +
 +
=== Raspberry Pi 3에 GNOME 설치 ===
 +
 +
yum -y install "GNOME Desktop"
 +
 +
#--- 대기 모드 끄기
 +
vi  /etc/systemd/logind.conf
 +
    HandleLidSwitch=ignore
 +
 +
systemctl  restart  systemd-logind.service
 +
 +
=== Raspberry Pi 2에 CentOS 7 설치 ===
 +
 +
* http://mirror.centos.org/altarch/7/isos/armhfp/ 사이트에서 CentOS 7 다운로드 (CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw.xz)
 +
:* https://www.kraxel.org/repos/images/
 +
:* http://mirror.centos.org/altarch/7/isos/aarch64/
 +
* 압축을 풀어 CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일을 만든다.
 +
* CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일은 SD에 굽는다.
 +
:* [https://etcher.io/ Etcher]을 사용하여 SD에 굽는다.
 +
 +
root / centos 로 로그인하여 사용 한다.
 +
 +
* 설치된 사양
 +
:* CentOS Linux release 7.5.1804 (Core), 32 bits
 +
:* 4 cores
 +
 +
Network 설정
 +
systemctl  stop    NetworkManager.service
 +
systemctl  disable  NetworkManager.service
 +
systemctl  status  NetworkManager.service
 +
 +
# systemctl stop    firewalld.service
 +
# systemctl disable  firewalld.service
 +
# systemctl status  firewalld.service
 +
#
 +
# getenforce
 +
# vi  /etc/sysconfig/selinux
 +
#    SELINUX=disabled
 +
# setenforce 0
 +
# shutdown  -r  now
 +
 +
cd  /etc/sysconfig/network-scripts
 +
mv  ifcfg-link  nouse_ifcfg-link
 +
vi  ifcfg-eth0
 +
    DEVICE=eth0
 +
    TYPE="Ethernet"
 +
    BOOTPROTO="dhcp"
 +
    ONBOOT="yes"
 +
    NM_CONTROLLED="no"
 +
shutdown  -r  now
 +
# systemctl  restart  network.service
 +
ping -c 3 google -v
 +
 +
Disk resize
 +
 +
rootfs-expand
 +
lsblk
 +
df -h
 +
 +
# [root@localhost ~]# lsblk -l
 +
# NAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
 +
# mmcblk0  179:0    0 14.7G  0 disk
 +
# mmcblk0p2 179:2    0  488M  0 part [SWAP]
 +
# mmcblk0p3 179:3    0  1.4G  0 part /
 +
# mmcblk0p1 179:1    0  668M  0 part /boot
 +
 +
 +
# fdisk /dev/mmcblk0
 +
# #--- p d 3
 +
# #--- n p 3 엔터 엔터
 +
# #--- w
 +
# shutdown -r now
 +
 +
기본 S/W 설치
 +
yum -y install which
 +
 +
참고 문헌
 +
* https://rharmonson.github.io/cos7instpi.html
 +
 +
=== Raspberry Pi 3에 Raspbian 설치 ===
 +
 +
* [http://sourceforge.net/projects/win32diskimager/?source=directory Win32 Disk Imager 사이트]에서&nbsp;Win32DiskImager-0.9.5-install.exe 파일을 설치 합니다.
 +
* [http://www.raspberrypi.org/downloads/ Raspberry Pi 다운로드 사이트]에서 Raspbian 파일을 다운로드 합니다.
 +
:* 2018-10-09-raspbian-stretch-lite.img : Text 모드
 +
:* 2018-10-09-raspbian-stretch.img : GUI 모드
 +
* Win32 Disk Imager로 Micro SD 카드에 img 파일을 설치 합니다.
 +
 +
* Raspberry Pi로 부팅해서 다음 작업을 진행 합니다. pi / raspberry 로 로그인 한다.
 +
raspi-config
 +
    #--- "4 Localisation Options" 선택
 +
 +
    #--- "1 Change Locale" :
 +
    #---    en_GB.UTF-8, en_US.UTF-8, ko_KR.UTF8 (디폴트), ko_KR.ECU-KR 선택
 +
    #--- "2 Change Timezone" : Asia > Seoul
 +
    #--- "3 Change Keyboard Layout"
 +
    #---    Generic 105-key (Intl) PC > Other > Korean > Korean - Korean (101/104 key compatible) > The default for the keyboard layout > No compose key
 +
    #--- "4 Change Wi-fi Country" : US Unite States    (KR Korea (South) 사용 않음)
 +
 +
#--- 업데이트
 +
apt-get update
 +
apt-get upgrade
 +
reboot
 +
 +
#--- 한글이 깨어지는 경우
 +
apt-get install ibus 
 +
apt-get install ibus-hangul
 +
apt-get install fonts-unfonts-core
 +
reboot
 +
 +
X11 (X-Window) 환경 구성
 +
apt  install  lxde  lightdm  xinit
 +
# export DISPLAY=0.0
 +
startx
 +
 +
=== IP 확인 ===
 +
 +
mkdir  -p  /work/bin
 +
cd  /work/bin
 +
vi  raspberrypi.bash
 +
    #!/usr/bin/env bash
 +
    IPADDR=`/usr/sbin/ip addr list eth0 | /usr/bin/grep 'inet ' | /usr/bin/awk '{print \$2}'`
 +
    /usr/bin/curl http://www.obcon.biz/raspberrypi.php?ip=raspberrypi_2_${IPADDR}
 +
chmod  755  raspberrypi.bash
 +
 +
crontab -e
 +
    * * * * * /work/bin/raspberrypi.bash
 +
 +
== S/W 설치 ==
 +
 +
=== Node.js 설치 ===
 +
 +
* Node.js 8.9.4
 +
 +
# yum list | grep nodejs
 +
# yum -y install nodejs
 +
 +
yum -y install which wget
 +
uname -m                                                    #--- ARM 아키텍처 확인
 +
mkdir -p /work/install
 +
cd /work/install
 +
#--- https://nodejs.org/dist/
 +
# wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-armv7l.tar.xz
 +
# tar -xvf node-v10.9.0-linux-armv7l.tar.xz
 +
# cd node-v10.9.0-linux-armv7l
 +
wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-armv7l.tar.xz
 +
tar -xvf node-v8.9.4-linux-armv7l.tar.xz
 +
cd node-v8.9.4-linux-armv7l
 +
 +
/usr/bin/rm CHANGELOG.md LICENSE README.md
 +
/usr/bin/cp -R * /usr/local/
 +
node -v
 +
npm -v
 +
 +
=== Python 설치 ===
 +
 +
Python 2.7 설치
 +
yum -y install python python-IPy python-backports python-backports-ssl_match_hostname python-chardet python-cheetah python-configobj python-decorator python-firewall python-iniparse python-javapackages python-jsonpatch python-jsonpointer python-libs python-lxml python-markdown python-perf python-pillow python-prettytable python-progressbar python-pycurl python-pygments python-pyudev python-requestbuilder python-requests python-setuptools python-six python-slip python-slip-dbus python-urlgrabber python-urllib3
 +
 +
python -V
 +
 +
 +
Python 3.4 설치
 +
vi /etc/yum.repos.d/epel.repo
 +
    [epel]
 +
    name=Epel rebuild for armhfp
 +
    baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
 +
    enabled=1
 +
    gpgcheck=0
 +
 +
yum -y install python34 python34-pip
 +
python3 -V
 +
 +
=== GNOME에 VNC Server 설치 ===
 +
 +
* Raspberry Pi 7인치 Touch Screen Display
 +
:* LCD
 +
:* 해상도 : 800 * 480
 +
:* Raspberry Pi 7inch HDMI LCD (C)의 경우 1024*600의 해상도를 지원하며 /boot/config.txt 파일을 수정하여야 합니다.
 +
 +
* 사용자 : centos
 +
* VNC Port : 5901 port
 +
* VNC Viewer : https://www.realvnc.com/en/connect/download/viewer/
 +
:* 접속시 "IP:5901"로 접속 한다.
 +
 +
yum -y install tigervnc-server
 +
cp  /lib/systemd/system/vncserver@.service  /lib/systemd/system/vncserver@:1.service
 +
vi  /lib/systemd/system/vncserver@:1.service
 +
    [Service]
 +
    Type=forking
 +
 +
    # Clean any existing files in /tmp/.X11-unix environment
 +
    ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 +
    ExecStart=/usr/sbin/runuser -l centos -c "/usr/bin/vncserver %i"
 +
    PIDFile=/home/centos/.vnc/%H%i.pid
 +
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 +
 +
systemctl enable  firewalld.service
 +
systemctl restart firewalld.service
 +
systemctl status  firewalld.service
 +
 +
firewall-cmd  --permanent  --zone=public  --add-service  vnc-server
 +
firewall-cmd  --reload
 +
 +
su - centos                                            #--- 일반 사용자로 vncserver 시작
 +
vncserver -geometry 800x480
 +
    You will require a password to access your desktops.
 +
 +
    Password:
 +
    Verify:
 +
    Would you like to enter a view-only password (y/n)? y
 +
    Password:
 +
    Verify:
 +
    xauth:  file /home/centos/.Xauthority does not exist
 +
 +
    New 'localhost.localdomain:1 (centos)' desktop is localhost.localdomain:1
 +
 +
    Creating default startup script /home/centos/.vnc/xstartup
 +
    Creating default config /home/centos/.vnc/config
 +
    Starting applications specified in /home/centos/.vnc/xstartup
 +
    Log file is /home/centos/.vnc/localhost.localdomain:1.log
 +
# vncserver                                          #--- vncserver 실행
 +
# vncserver -geometry 1920x1080                      #--- 해상도를 지정한 후 vncserver 실행
 +
# vncserver -kill :포트번호                          #--- vncserver 종료
 +
exit
 +
 +
systemctl daemon-reload
 +
systemctl enable vncserver@:1.service
 +
systemctl status vncserver@:1.service
 +
reboot
 +
 +
== 관리자 가이드 ==
 +
 +
=== 화면 로테이션 ===
 +
 +
화면을 180도 로테이션을 한다. 로테이션에 따라 터치 스크린 정보가 같이 수정 한다.
 +
 +
참조
 +
:* /sys/class/graphics/fbcon/rotate 파일
 +
 +
=== GNOME용 한글 폰트 설치 ===
 +
 +
GNOME에서 한글이 깨어지면 아래와 같이 작업 한다.
 +
 +
# yum -y install kde-l10n-Korean
 +
# yum -y install fonts-korean
 +
yum -y install google-noto-sans-korean-fonts
  
 
== 참고 문헌 ==
 
== 참고 문헌 ==
 +
<ul style="line-height: 20.7999992370605px;">
 +
<li>[[Arduino|Arduino]]</li>
 +
<li>[[Raspbian|Raspbian]]</li>
 +
<li>[http://dev.windows.com/en-us/featured/raspberrypi2support Windows 10 for Raspberry Pi 2]</li>
 +
<li>[http://cafe.naver.com/pipc 라즈베리파이 네이버 카페]</li>
 +
<li>[http://ko.wikipedia.org/wiki/%EB%9D%BC%EC%A6%88%EB%B2%A0%EB%A6%AC_%ED%8C%8C%EC%9D%B4 위키 - 라즈베리 파이]</li>
 +
<li>[http://www.webvision.co.kr/?p=186 http://www.webvision.co.kr/?p=186]</li>
 +
<li>[http://blog.puding.kr/152 http://blog.puding.kr/152]</li>
 +
<li>[http://echo.tistory.com/34 http://echo.tistory.com/34]</li>
 +
<li>산딸기 설치
 +
*http://mauver.kr/wp/archives/388
 +
*http://mauver.kr/wp/archives/383
 +
*http://mauver.kr/wp/archives/408</li>
 +
 +
[[Category:Hardware|Category:Hardware]]<br/>[[Category:OS|Category:OS]]

2018년 11월 7일 (수) 19:03 기준 최신판

Raspberry Pi 정리

Raspberry 개요

영국 Raspberry Pi 재단에서 만든 초소형 PC (2012.03), $35 (모델 B)
700 MHz * ARM * GPU / 512 MB Memory / SD 카드 / 100 M bits Network
영상 출력 : 컴포지트, HDMI, DSI
음성 출력 : 잭, HDMI
USB, GPIO
OS : NO OBS, 라즈비안, Apache Linux, Pidora, RISC OS

IoT-rpi2-board_InvariantCulture_Default.png

Raspberry Pi 3 B 사양

  • 4 Core (1.2 GHz) / 1 GB Memory / 16 GB Disk
  • CentOS Linux release 7.5.1804 (AltArch), 32 bits

싱글 보드 컴퓨터의 종류

싱글 보드 컴퓨터 상세

Arduino
(arduino.cc)

$27

  • 오픈소스 마이크로 컨트롤러 보드
    • 다수의 스위치 또는 센서로부터 입력
    • LED 또는 모터와 같은 외부 장치를 제어
    • USB 또는 별도의 전원 필요
  • Atmel의 AVR 기반 제품
    • Arduino Uno                  : 16 MHz, 2 KB SRAM, $27
    • Arduino Zero
  • Cortex-M3 기반 제품           : Arduino Due
  • 통합 개발 환경 (IDE)
    • 어도비 플래시, Processing (Java 기반), Max/MSP
    • Linux, Windows, Mac OS X 지원
  • Arduino 1.0.6 (2013.05.15)
  • Arduino 1.5.8 Beta (Arduino Due)
  • Shield : 확장 부품. 유무선 통신, GPS 수신, 음악 재생 등

Raspberry Pi

(www.raspberrypi.org)

$35

  • 영국 Raspberry Pi 재단에서 만든 초소형 PC (2012.03), $35 (모델 B)
  • 700 MHz * ARM * GPU / 512 MB Memory / SD 카드 / 100 M bits Network
  • 영상 출력 : 컴포지트, HDMI, DSI
  • 음성 출력 : 잭, HDMI
  • USB, GPIO
  • OS : NO OBS, 라즈비안, Apache Linux, Pidora, RISC OS
  • Raspberry Pi 2 Model B
  • Raspberry Pi 1 Model B+ : 2015년 2월 출시

BeagleBone Black (BBB)

(beagleboard.org)

$55

  • ARM 기반의 오픈소스 하드웨어
  • 1 GHz / 512 MB DDR3 RAM / 4 GB eMMC 저장 공간
  • USB, Ethernet, HDMI, 2 * 46 pin headers
  • Linux kernel (3.10.x, 3.8.x) 지원
    • Debian, Angstrom Linux, Android, Ubuntu

Intel Gallireo

$60

Intel Edison

$50

  • SD 카드 모양의 소형 컴퓨터, 2014.01.08
    • 400 MHz * 듀얼 코어, 512 KB SRAM, 2 GB Storage
    • 장치 : 내장그래픽, 블루투스, WiFi
    • Yocto Linux 1.6으로 구동
  • 에디슨 (2014.09), $50
    • 500 MHz * 듀얼코아 Atom * 듀얼 스레드 + 100 MHz 32 bits 쿼크 프로세스
    • 1 GB LPDDR3 (Memory) / 4 GB eMMC 플래시 메모리 (Disk)
    • 무선랜, 블루투스 4.0LE
    • 개발 환경 : Arduino, C, C++, 파이선 등
  • 보드 : Breakout Board ($75), Arduino Kit ($100, 아두이노와 호환)

OS 설치

Raspberry Pi 3에 CentOS 7 설치

  • 압축을 풀어 CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일을 만든다.
  • CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일은 SD에 굽는다.
  • Etcher을 사용하여 SD에 굽는다.

root / centos 로 로그인하여 사용 한다.

  • 설치된 사양
  • CentOS Linux release 7.5.1804 (Core), 32 bits
  • 4 cores

Disk resize

rootfs-expand
df -h

Network 설정

# systemctl  stop     NetworkManager.service
# systemctl  disable  NetworkManager.service
# systemctl  status   NetworkManager.service
#
# systemctl stop     firewalld.service
# systemctl disable  firewalld.service
# systemctl status   firewalld.service
#
# getenforce
# vi  /etc/sysconfig/selinux
#     SELINUX=disabled
# setenforce 0
# shutdown  -r  now
#
# cd  /etc/sysconfig/network-scripts
# mv  ifcfg-link  nouse_ifcfg-link
# vi  ifcfg-eth0
#     DEVICE=eth0
#     TYPE="Ethernet"
#     BOOTPROTO="dhcp"
#     ONBOOT="yes"
#     NM_CONTROLLED="no"
# shutdown  -r  now
# systemctl  restart  network.service
# ping -c 3 google -v

WiFi 설정

yum -y install wpa_supplicant NetworkManager NetworkManager-wifi
systemctl enable  NetworkManager.service
systemctl disable NetworkManager-wifi.service
systemctl start   NetworkManager.service
systemctl stop    NetworkManager-wifi.service 

nmcli dev wifi rescan
nmcli dev wifi list                                         #--- WiFi 이름 확인
nmcli --ask dev wifi connect ${와이파이_이름}                    #--- WiFi 연결

# cd  /etc/sysconfig/network-scripts
# vi  ifcfg-wlan0
#     DEVICE=wlan0
#     TYPE="Ethernet"
#     BOOTPROTO="dhcp"
#     ONBOOT="yes"
#     NM_CONTROLLED="no"
# wpa_cli reconfigure
# ifdown wlan0
# ifup   wlan0
# 
# vi /etc/sysconfig/wpa_supplicant
# wpa_passphrase ${SSID} ${비밀번호}                              #--- WPA2 등을 사용할 경우 psk 값을 생성
# vi  /etc/wpa_supplicant/wpa_supplicant.conf
#     ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev     #--- netdev, wheel
#     network={
#         ssid="접속하고자 하는 wifi 이름"
#         psk="접속하고자 하는 wifi 비밀번호"                     
#         # psk=NONE                                              #--- 비밀번호 없음
#         scan_ssid=1                                             #--- SSID를 자동으로 찾기
#         # key_mgmt=WPA-PSK
#         priority=1
#     }

Bluetooth 설정

# yum -y install NetworkManager-bluetooth
# # systemctl enable NetworkManager-bluetooth.service
# # systemctl start  NetworkManager-bluetooth.service
# systemctl restart  NetworkManager.service

기본 S/W 설치

yum -y install which
# yum -y install wireless-tools wpa_supplicant dhcpcd    

timedatectl list-timezones | grep -i seoul
timedatectl set-timezone Asia/Seoul

참고 문헌

Raspberry Pi 3에 GNOME 설치

yum -y install "GNOME Desktop"

#--- 대기 모드 끄기
vi  /etc/systemd/logind.conf
    HandleLidSwitch=ignore

systemctl  restart  systemd-logind.service

Raspberry Pi 2에 CentOS 7 설치

  • 압축을 풀어 CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일을 만든다.
  • CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-1804-sda.raw 파일은 SD에 굽는다.
  • Etcher을 사용하여 SD에 굽는다.

root / centos 로 로그인하여 사용 한다.

  • 설치된 사양
  • CentOS Linux release 7.5.1804 (Core), 32 bits
  • 4 cores

Network 설정

systemctl  stop     NetworkManager.service
systemctl  disable  NetworkManager.service
systemctl  status   NetworkManager.service

# systemctl stop     firewalld.service
# systemctl disable  firewalld.service
# systemctl status   firewalld.service
#
# getenforce
# vi  /etc/sysconfig/selinux
#     SELINUX=disabled
# setenforce 0
# shutdown  -r  now

cd  /etc/sysconfig/network-scripts
mv  ifcfg-link  nouse_ifcfg-link
vi  ifcfg-eth0
    DEVICE=eth0
    TYPE="Ethernet"
    BOOTPROTO="dhcp"
    ONBOOT="yes"
    NM_CONTROLLED="no"
shutdown  -r  now
# systemctl  restart  network.service
ping -c 3 google -v

Disk resize

rootfs-expand
lsblk
df -h
# [root@localhost ~]# lsblk -l
# NAME      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
# mmcblk0   179:0    0 14.7G  0 disk
# mmcblk0p2 179:2    0  488M  0 part [SWAP]
# mmcblk0p3 179:3    0  1.4G  0 part /
# mmcblk0p1 179:1    0  668M  0 part /boot
#  
#  
# fdisk /dev/mmcblk0
# #--- p d 3
# #--- n p 3 엔터 엔터
# #--- w
# shutdown -r now

기본 S/W 설치

yum -y install which

참고 문헌

Raspberry Pi 3에 Raspbian 설치

  • 2018-10-09-raspbian-stretch-lite.img : Text 모드
  • 2018-10-09-raspbian-stretch.img : GUI 모드
  • Win32 Disk Imager로 Micro SD 카드에 img 파일을 설치 합니다.
  • Raspberry Pi로 부팅해서 다음 작업을 진행 합니다. pi / raspberry 로 로그인 한다.
raspi-config
    #--- "4 Localisation Options" 선택 

    #--- "1 Change Locale" :
    #---     en_GB.UTF-8, en_US.UTF-8, ko_KR.UTF8 (디폴트), ko_KR.ECU-KR 선택
    #--- "2 Change Timezone" : Asia > Seoul
    #--- "3 Change Keyboard Layout"
    #---     Generic 105-key (Intl) PC > Other > Korean > Korean - Korean (101/104 key compatible) > The default for the keyboard layout > No compose key
    #--- "4 Change Wi-fi Country" : US Unite States     (KR Korea (South) 사용 않음)

#--- 업데이트
apt-get update
apt-get upgrade
reboot

#--- 한글이 깨어지는 경우
apt-get install ibus  
apt-get install ibus-hangul
apt-get install fonts-unfonts-core
reboot

X11 (X-Window) 환경 구성

apt  install  lxde  lightdm  xinit	
# export DISPLAY=0.0
startx

IP 확인

mkdir  -p  /work/bin
cd  /work/bin
vi  raspberrypi.bash
    #!/usr/bin/env bash
    IPADDR=`/usr/sbin/ip addr list eth0 | /usr/bin/grep 'inet ' | /usr/bin/awk '{print \$2}'`
    /usr/bin/curl http://www.obcon.biz/raspberrypi.php?ip=raspberrypi_2_${IPADDR}
chmod  755  raspberrypi.bash

crontab -e
    * * * * * /work/bin/raspberrypi.bash

S/W 설치

Node.js 설치

  • Node.js 8.9.4
# yum list | grep nodejs
# yum -y install nodejs

yum -y install which wget
uname -m                                                    #--- ARM 아키텍처 확인
mkdir -p /work/install
cd /work/install
#--- https://nodejs.org/dist/
# wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-armv7l.tar.xz
# tar -xvf node-v10.9.0-linux-armv7l.tar.xz
# cd node-v10.9.0-linux-armv7l
wget https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-armv7l.tar.xz
tar -xvf node-v8.9.4-linux-armv7l.tar.xz
cd node-v8.9.4-linux-armv7l 

/usr/bin/rm CHANGELOG.md LICENSE README.md
/usr/bin/cp -R * /usr/local/
node -v
npm -v

Python 설치

Python 2.7 설치

yum -y install python python-IPy python-backports python-backports-ssl_match_hostname python-chardet python-cheetah python-configobj python-decorator python-firewall python-iniparse python-javapackages python-jsonpatch python-jsonpointer python-libs python-lxml python-markdown python-perf python-pillow python-prettytable python-progressbar python-pycurl python-pygments python-pyudev python-requestbuilder python-requests python-setuptools python-six python-slip python-slip-dbus python-urlgrabber python-urllib3

python -V


Python 3.4 설치

vi /etc/yum.repos.d/epel.repo
   [epel]
   name=Epel rebuild for armhfp
   baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
   enabled=1
   gpgcheck=0

yum -y install python34 python34-pip
python3 -V

GNOME에 VNC Server 설치

  • Raspberry Pi 7인치 Touch Screen Display
  • LCD
  • 해상도 : 800 * 480
  • Raspberry Pi 7inch HDMI LCD (C)의 경우 1024*600의 해상도를 지원하며 /boot/config.txt 파일을 수정하여야 합니다.
  • 접속시 "IP:5901"로 접속 한다.
yum -y install tigervnc-server
cp  /lib/systemd/system/vncserver@.service  /lib/systemd/system/vncserver@:1.service
vi  /lib/systemd/system/vncserver@:1.service
    [Service]
    Type=forking

    # Clean any existing files in /tmp/.X11-unix environment
    ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
    ExecStart=/usr/sbin/runuser -l centos -c "/usr/bin/vncserver %i"
    PIDFile=/home/centos/.vnc/%H%i.pid
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

systemctl enable  firewalld.service
systemctl restart firewalld.service
systemctl status  firewalld.service

firewall-cmd  --permanent  --zone=public  --add-service  vnc-server
firewall-cmd  --reload

su - centos                                            #--- 일반 사용자로 vncserver 시작
vncserver -geometry 800x480
    You will require a password to access your desktops.

    Password:
    Verify:
    Would you like to enter a view-only password (y/n)? y
    Password:
    Verify:
    xauth:  file /home/centos/.Xauthority does not exist

    New 'localhost.localdomain:1 (centos)' desktop is localhost.localdomain:1

    Creating default startup script /home/centos/.vnc/xstartup
    Creating default config /home/centos/.vnc/config
    Starting applications specified in /home/centos/.vnc/xstartup
    Log file is /home/centos/.vnc/localhost.localdomain:1.log
# vncserver                                          #--- vncserver 실행
# vncserver -geometry 1920x1080                      #--- 해상도를 지정한 후 vncserver 실행
# vncserver -kill :포트번호                          #--- vncserver 종료
exit

systemctl daemon-reload
systemctl enable vncserver@:1.service
systemctl status vncserver@:1.service
reboot

관리자 가이드

화면 로테이션

화면을 180도 로테이션을 한다. 로테이션에 따라 터치 스크린 정보가 같이 수정 한다.

참조

  • /sys/class/graphics/fbcon/rotate 파일

GNOME용 한글 폰트 설치

GNOME에서 한글이 깨어지면 아래와 같이 작업 한다.

# yum -y install kde-l10n-Korean
# yum -y install fonts-korean
yum -y install google-noto-sans-korean-fonts

참고 문헌