기본설정
[파일설치 필요함.]
라즈베리파이 이미지 로더 = https://www.raspberrypi.com/software/
VNC 뷰어 = https://www.realvnc.com/en/connect/download/viewer/
SSH 쉘 = https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
[라즈베리파이 이미지로더로 sd카드에 이미지 import ]
쓰기작업 완료후 sd카드 제거. -> 라즈베리파이에 sd카드 연결
[주의] 라즈베리파이 부팅시 1분 정도 소요됨. cmd에서 ping테스트로 연결확인진행.
[주의] sd카드,랜선 연결후 전원연결.
#원격 접속하기
1.라즈베리파이 드라이브에 ssh파일 생성 [파일이름: ssh , 확장자 X ] // putty enable
2.putty->session->hostName-> raspberrypi.local 입력후 open. // 노트북wifi Off 필수!
3.생성되는 터미널에서 id,pw 입력. [라즈베리파이 imager 로더에서 설정한 id / pw 입력]
#라즈베리파이 연결확인
cmd 에서 ping raspberrypi.local 입력 -> ping 들어오는지 확인.
#putty
sudo raspi-config // 라즈베리파이 세팅 [sudo = 루트권한]
-> 1번항목 엔터. -> 국가는 GB로 설정
# ifconfig -> ping 테스트
ping 8.8.8.8 (8.8.8.8은 Google Public DNS 서비스의 주소)
ping (라즈베리 파이 ip주소) 예) 169.254.248.211
#WLAN0 연결확인
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
-> 임의로 내용입력후 저장및 터미널메인으로 이동.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
-> 입력내용 저장됐는지 확인
#터미널 명령어 참고
ctrl + o -> 엔터 // 저장
ctrl + x -> 뒤로가기
#Static IP (고정아이피)
sudo nano /etc/dhcpcd.conf
#[vnc 사용을 위한 setting] - #은 빼고 입력해야함.
#######################################
interface wlan0
static ip_address=192.168.0.??/24
static routers=192.168.0.1
#######################################
#VNC
sudo raspi-config
-> 3번 항목 interface option 선택
-> VNC enable
-> finish
#검정화면
sudo reboot
#VNC 접속
192.168.0.?? [dhcpcd.conf에서 설정한 ip주소]
#라즈베리파이 로컬 터미널에서 다음의 설정을 진행함.
#nodejs 다운로드 :
$ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
sudo apt-get update
sudo apt-get upgrade
#npm / node-red 다운로드
$ sudo npm install -g --unsafe-perm node-red
#LED깜빡임
#LCD i2c통신 enable
1.sudo raspi-config
2.interface Optrion
3.i2c -> enable
$ i2cdetect -y 1
LCD 팔레트 다운로드 // 노드레드
node-red-contrib-iiot-rpi-pcf857x
#MQTT통신
aedes // MQTT Broker install
###################################################################################
###################################################################################
user@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.248.211 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::bb1d:4b7f:9f52:4698 prefixlen 64 scopeid 0x20<link>
ether e4:5f:01:cb:61:59 txqueuelen 1000 (Ethernet)
RX packets 576 bytes 68467 (66.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 570 bytes 133299 (130.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 112 bytes 10970 (10.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 112 bytes 10970 (10.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::3ce1:c5a3:7b9e:f761 prefixlen 64 scopeid 0x20<link>
ether e4:5f:01:cb:61:5a txqueuelen 1000 (Ethernet)
RX packets 12 bytes 1820 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 1303 (1.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
아두이노& 라즈베리파이
미니프로젝트
[아두이노와 라즈베리파이]
# https://openstory.tistory.com/150
# https://design-whale.tistory.com/168
아두이노 - 마이크로 컨트롤러(Microcontroller)
라즈베리파이 - 마이크로 프로세서(Microprocessor)
외부기기 제어가 중심이라면 아두이노, 데이터 처리 중심이라면 라즈베리파이를 사용함.
아두이노 -> 센서, LCD, 모터의 제어
라즈베리파이 -> 비디오나, 카메라, 복잡한 수치계산 같은 그래픽, 데이터 처리
[1]Bluetooth Nerf Turret - Blast your enemies from a safe distance!
https://projecthub.arduino.cc/Little_french_kev/bluetooth-nerf-turret-ea2fac
[2]Pick and Place Delta Robot (Controlled by Arduino Mega)
An Arduino-controlled delta robot built with fischertechnik: fast and precise pick and place robot.
https://projecthub.arduino.cc/ArduinoFT/pick-and-place-delta-robot-controlled-by-arduino-mega-a7bf84
[3]Barbot: Cocktail Mixing Robot
Barbot is an open source Arduino cocktail mixing robot controlled with the hybrid mobile app via Bluetooth.
https://projecthub.arduino.cc/sidlauskas/barbot-cocktail-mixing-robot-5b3b3c
[참고]
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
- 리눅스 명령어
- nano 텍스트 편집기를 사용하여 슈퍼유저 권한으로 wpa_supplicant.conf 파일을 편집
# wpa_supplicant.conf : Wi-Fi 연결을 관리하기 위한 설정 파일 . wpa_supplicant에서 사용됨
# wpa_supplicant: Wi-Fi 네트워크에 연결하기 위해 필요한 인증 및 보안 설정을 처리
# Wi-Fi 네트워크의 SSID, 비밀번호, 보안 프로토콜, 인증 방법 등을 설정함.
[참고 - ip 주소 설정시 충돌방지를 위한 ip scan]
다수 연결시에는 ip 주소를 조회하여 빈 주소를 사용하도록 합니다.
https://www.zzaturi.com/ip_scanner
IP 스캐너 - ZZATURI
IP 스캐너 주변 컴퓨터들의 IP접속 상태를 알아야 할 때, 일일이 IP상태를 확인하기 번거로울 때 도움을 줍니다. 다운로드 라이선스 : 개인, 기업, 공공기관 무료 Windows 7, 2008 이상 | .NET 4.O 이상
www.zzaturi.com
[참고 - 리눅스 cmd 명령어]
복사: Ctrl+Insert 또는 Ctrl+Shift+C
붙여넣기: Shift+Insert 또는 Ctrl+Shift+V
[Linux] 리눅스 단축키 및 명령어 정리
1. 리눅스 단축키 1.1. 터미널 실행 관련 단축키 터미널 실행 : Ctrl + Alt + T 새로운 탭으로 터미널 실행 : Ctrl + Shift + T 새로운 창으로 터미널 실행 : Ctrl + Shift + N 탭으로 실해된 터미널 종료 : Ctrl + Sh
rainbow97.tistory.com