Cov txheej txheem:

Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub: 11 Cov Kauj Ruam
Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub: 11 Cov Kauj Ruam

Video: Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub: 11 Cov Kauj Ruam

Video: Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub: 11 Cov Kauj Ruam
Video: Lub Zog Nruab Nrog (Hmong Dubbed) 2024, Hlis ntuj nqeg
Anonim
Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub
Teeb Raspberry Pi Nrog AdaFruit's PiTFT Zaub

CEEB TOOM: Vim tias nws tsis yog hnub tim, cov lus qhia no yuav tsum tsis txhob siv. Thov siv AdaFruit's Easy Install.

Teeb Raspberry Pi ua haujlwm nrog Adafruit's PiTFT zaub.

Cov lus qhia no siv MacBook Pro thiab tshwj xeeb USB cable hloov chaw saib, keyboard thiab nas los teeb tsa Raspberry Pi.

Kuv zoo siab heev los ntawm PiTFT cov zaub thiab xav ntxiv nws rau ntau ntawm kuv li haujlwm hauv tsev hauv tsev. Thawj kauj ruam yog kom nws ua haujlwm yog li kuv tuaj yeem ntxiv nws mus rau lwm qhov haujlwm.

Lub Hom Phiaj:

Teeb tsa Adafruit's PiTFT zaub kom khiav ntawm Raspberry Pi

Sau ntawv:

  • cov ntawv nyob hauv spades, zoo li no ♣ hloov-qhov no ♣ yuav tsum hloov nrog tus nqi tiag
  • Kuv tau sim ua credit txhua qhov chaw siv. Kuv thov txim rau txhua qhov tsis suav.
  • $ qhia txog cov lus txib ua tiav hauv lub qhov rais qhib ntawm MacBook thiab feem ntau yog ua tiav ntawm Raspberry Pi
  • Kuv sim ua tsis tiav kom tau PiTFT los khiav ntawm Diet-Pi

Kauj Ruam 1: Sau Qhov Chaw

Kuv tau pom cov ntu hauv qab no ua tau zoo tshaj plaws hauv kuv daim ntawv thov. Cov khoom no kim dua li muaj nyob hauv cov khoom pib ib txwm muaj.

Tau txais cov khoom thiab cov cuab yeej (tus nqi hauv USD):

  • MacBook Pro (lub PC tuaj yeem siv tau)
  • Ethernet cable, router, wireless nkag thiab internet txuas
  • Raspberry Pi 2 Qauv B Element14 $ 35
  • Panda 300n WiFi Adapter Amazon $ 16.99
  • 5.2V 2.1A USB Power Adapter los ntawm Amazon $ 5.99
  • Micro USB rau USB cable 3ft los ntawm Amazon $ 4.69
  • FTDI TTL-232R-RPI Serial rau USB cable los ntawm Mouser $ 15
  • SanDisk Ultra 16 GB microSDHC Class 10 nrog Adapter (SDSQUAN-016G-G4A) los ntawm Amazon $ 8.99
  • PiTFT - Sib dhos 320x240 2.8 "TFT+Touchscreen rau Raspberry Pi Adafruit $ 34.95

Kauj Ruam 2: Rub Adafruit's Version ntawm Raspbian Nrog PiTFT Txhawb

Rub tawm Adafruit's Raspian nrog PiTFT txhawb nqa:

  • Rub tawm qhov tseeb version ntawm Adafruit's raspbian nrog PiTFT rau hauv koj li MacBook phau ntawv teev npe
  • Thaum cov lus qhia no tau sau qhov hloov tshiab kawg yog: 24 Cuaj hlis, 2015 jessie
  • Tsiv duab 2015-09-24-raspbian-jessie-pitft28r.img los ntawm rub tawm mus rau cov npe uas koj khaws cov duab:

♣ koj-macbook-duab-phau ntawv teev npe ♣

Piv txwv li, kuv siv:

$ cd "/Cov neeg siv/♣ my_macbook_name ♣/Desktop/wifiEnabledHome/Raspberry Pi teeb tsa/duab raspbian"

Tau qhov twg los: Adafruit PiTFT teeb tsa cov lus qhia

Kauj Ruam 3: Hlawv Raspbian Duab rau Micro SD Card

TSEEM CEEB: Nco ntsoov tias koj ntaus tus lej disk raug - yog tias koj nkag mus rau tus lej disk tsis raug, koj yuav so koj lub hard disk!

Ntxig daim npav micro SD rau hauv SD Adapter, thiab tom qab ntawd ntxig daim npav SD rau hauv MacBook.

Ntawm MacBook siv cov lus qhia no los ntawm Raspberry Pi. Cov ntsiab lus ntawm no:

  • Qhib MacBook lub dav hlau qhov rai
  • Hloov mus rau cov npe uas muaj cov duab raspbian

$ cd ♣ your-macbook-image-directory ♣

  • Txheeb xyuas daim disk (tsis faib) ntawm koj daim npav SD
  • Hauv qhov no, disk2 (tsis disk2s1) lossis disk# = 2
  • Txhawm rau txheeb xyuas koj daim npav micro SD, khiav cov lus txib:

$ daim ntawv teev npe

/dev/disk0 #: HOM NPE SIAB IDENTIFIER 0: GUID_partition_scheme *160.0 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS ♣ my_macbook ♣ 159.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3/dev/disk NAME # IDENTIFIER 0: Apple_partition_scheme *2.5 GB disk1 1: Apple_partition_map 1.5 KB disk1s1 2: Apple_HFS ♣ my_dvd ♣ 2.5 GB disk1s2 /dev /disk2 #: HOM SIAB SIAB IDENTIFIER 0: FDisk_partition_scheme *15.5 GB disk2 1: Windows_FAT_32

  • Los ntawm qhov saum toj no, kuv daim npav micro SD yog daim disk# 2
  • Unmount koj daim npav SD los ntawm kev siv:

$ diskutil unmountDisk /dev /disk ♣ micro-SD-card-disk#♣

Luam daim duab rau koj daim npav SD. Xyuas kom lub npe duab thiab disk # raug

$ sudo dd bs = 4m yog = 2015-09-24-raspbian-jessie-pitft28r.img ntawm =/dev/rdisk ♣ micro-SD-card-disk#♣

  • CTRL-t kom pom cov xwm txheej ntawm kev theej.
  • Yog tias muaj qhov ua yuam kev, sim qhov sib txawv rau bs xaiv, xws li, 1m, 4m, lossis 1M. Cov Loj Loj Loj (bs) xav tau rau cov tsav loj. Cov ntawv me me zoo li tau nyiam dua los ntawm MacBook.
  • Thaum ua tiav, unmount SD Card:

$ diskutil unmountDisk /dev /disk ♣ micro-SD-card-disk#♣

  • Tshem SD adapter los ntawm MacBook thiab tshem daim npav micro SD los ntawm adapter
  • Ntxig micro SD Card hauv Raspberry Pi

Kauj ruam 4: Raspberry Pi Kev Sib Txuas

Raspberry Pi Kev Sib Txuas
Raspberry Pi Kev Sib Txuas

Ntxig cov no rau hauv Raspberry Pi

  • Micro SD daim npav
  • Ethernet cable
  • Wi-nkaus dongle
  • USB serial I/O cable (saib cov duab saum toj no)

    • Hauv av = xaim dub, tus pin 06 ntawm RPi
    • Tx = Yellow wire, pin 08
    • Rx = Liab hlau, tus pin 10

Thaum cov lus saum toj no tiav lawm:

Ntxig lub hwj huam kab

Ntxig USB/Serial cable rau hauv MacBook USB chaw nres nkoj

Kauj Ruam 5: Txheeb Xyuas USB Port

Txiav txim siab USB Port siv los ntawm USB-Serial adapter. Kuv MacBook siv lub nti los ntawm FTDI.

Qhib lub dav hlau qhov rai

Muaj ntau yam khoom siv hauv /dev. Siv cov lus txib no los txheeb xyuas lub cuab yeej:

$ ls /dev/tty.*

/dev/tty. Bluetooth-Incoming-Port /dev/tty.usbserial-FT9314WH

Nov yog lwm txoj hauv kev los tshawb pom:

$ ls /dev | grep FT | Cov grep twg

tty.usbserial-FT9314WH

Yog tias tsis ua haujlwm saum toj no, sim qhov no:

Ntxig USB cable rau hauv MacBook, thiab khiav:

$ ls /dev | grep twg

Unplug USB cable, tos ob peb feeb thiab khiav:

$ ls /dev | grep twg

Txheeb xyuas qhov sib txawv

Kauj Ruam 6: Qhib Terminal Window thiab Txuas rau Raspberry Pi

Txuas MacBook rau Raspberry Pi siv USB txuas txuas.

Qhib lub dav hlau qhov rai. Saib daim duab saum toj no thiab teeb tsa lub davhlau ya nyob twg qhov nyiam.

  • Terminal, xaiv Nyiam, nyem Advanced tab
  • xterm thiab vt100 ua haujlwm, tab sis ansi ua haujlwm zoo dua thaum siv nano
  • Teeb Western ASCII hloov chaw unicode (UTF-8)

Hauv lub qhov rai davhlau ya nyob twg nkag mus:

$ screen /dev/tty.usbserial-FT9314WH 115200

Siv lub davhlau ya nyob twg qhov rai ntawm MacBook, nkag mus rau RPi: username = pi password = raspberry

Nco tseg: USB-serial cable tuaj yeem tso tus cim. Yog tias cov cim tau poob koj yuav tsis tau txais qhov hais kom sai, nyem Rov qab los yog nkag mus rau lub npe siv thiab nias Enter.

Yog tias hom rov tshwm sim, tom qab ntawv micro SD tsis tau teeb tsa kom raug. Pib dua.

  • Qhov sai rau hom rov ua haujlwm yog #
  • Raspbian qhov kev hais daws ib txwm yog $.
  • NOOBS rov qab nkag mus thiab tus password yog: hauv paus thiab raspberry

Kauj Ruam 7: Teeb Raspberry Pi

Teeb raspbian siv raspi-config

$ sudo raspi-teeb tsa

  • Nthuav Filesystem
  • Thiab rov pib dua (tab kom Ua tiav thiab ntaus Enter) thiab rov pib dua

$ sudo raspi-teeb tsa

Hloov tus neeg siv tus password rau ♣ your_new_password ♣

Internalisation Options (Kuv nyob hauv Central Tebchaws Asmeskas lub sijhawm - hloov pauv kom haum rau koj cov kev xav tau)

  • * qhia xaiv
  • Siv spacebar toggle *
  • Rau Asmeskas, hloov thaj chaw unclick GB (siv qhov chaw bar) thiab nyem US English UTF 8 (en_US. UTF-8 UTF-8)
  • Nyem OK, xaiv UTF thiab nyem OK

$ sudo rov pib dua

Thaum lub qhov rais dav hlau MacBook tau tawg:

  • Kaw lub davhlau ya nyob twg lub dav hlau (kaw txhua lub qhov rai qhov rai thiab tawm hauv lub davhlau ya nyob twg app)
  • Tshem lub USB cable los ntawm MacBook
  • Tos ob peb feeb thiab ntsaws USB cable rov qab rau hauv
  • Pib lub qhov rai davhlau ya nyob twg tshiab thiab nkag mus

$ sudo apt-tau hloov tshiab

$ sudo apt-tau nce qib $ sudo apt-tau pib tshem tawm $ sudo reboot

Txuas ntxiv mus teeb raspbian

$ sudo raspi-teeb tsa

Kev xaiv sab hauv

  • Hloov sijhawm thaj tsam Asmeskas thiab Nruab Nrab
  • Tab kom Ua tiav thiab rov pib dua

$ sudo rov pib dua

$ sudo raspi-teeb tsa

Advanced Xaiv

  • Hloov hostname rau ♣ your_hostname ♣
  • Pab kom SSH
  • Tiav
  • Rov pib dua

Kauj Ruam 8: Teeb Raspberry Pi WiFi

Khiav cov lus txib:

$ sudo nano/etc/network/interfaces

thiab kho kom muaj tsuas yog:

wb wlan0

tso cai-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid "♣ koj-ssid ♣" wpa-psk "♣ koj-kab lus dhau ♣ ♣"

CTRL-o los sau cov ntawv

ENTER kom paub meej tias sau

CTRL-x kom tawm nano editor

Khiav cov lus txib:

$ sudo rov pib dua

Kauj ruam 9: Teeb Gmail

Kev xa ntawv muaj txiaj ntsig zoo rau kev tau txais ntawv ceeb toom thiab ceeb toom txog teeb meem ntawm Raspberry Pi.

Xyuas kom cov chaw khaws khoom tau hloov kho tshiab. Khiav cov lus txib:

$ sudo apt-tau hloov tshiab

Nruab SSMTP thiab xa ntawv xa tuaj:

$ sudo apt-tau nruab ssmtp

$ sudo apt-tau nruab mailutils

Kho cov ntaub ntawv teeb tsa SSMTP:

$ sudo nano /etc/ssmtp/ssmtp.conf

raws li nram no:

hauv paus = koj-gmail-account♣@gmail.com

mailhub = smtp.gmail.com: 587 hostname = ♣ your-hostname ♣ AuthUser=♣your-gmail-account♣@gmail.com AuthPass = ♣ your-gmail-password ♣ UseSTARTTLS = YOG

Kho cov ntaub ntawv SSMTP aliases:

$ sudo nano/etc/ssmtp/revaliases

Tsim ib kab rau txhua tus neeg siv hauv koj li kab ke uas tuaj yeem xa email. Piv txwv li:

hauv paus: ♣your-gmail-account♣@gmail.com: smtp.gmail.com: 587

Teem cov kev tso cai ntawm SSMTP cov ntaub ntawv teeb tsa:

$ sudo chmod 664 /etc/ssmtp/ssmtp.conf

Kauj Ruam 10: Txuas PiTFT Zaub rau Raspberry Pi

Khiav qhov hais kom ua

$ sudo kaw -h 0

Tshem tawm ethernet cable

Tshem tawm USB txuas txuas los ntawm Raspberry Pi thiab los ntawm MacBook

Tshem tawm lub hwj chim

Txuas PiTFT zaub rau Raspberry Pi

Rov qab fais fab mov

Thaum Raspberry Pi rov pib dua, cov zaub yuav tsum ua haujlwm. Koj tuaj yeem nres tam sim no.

Kauj ruam 11: Backup Micro SD Card

Thaum Raspberry Pi tau teeb tsa, tom qab ntawd thaub qab cov duab. Siv daim duab no los tsim txoj haujlwm tom ntej.

Tsis tas li, thaub qab txoj haujlwm thaum nws ua tiav. Yog tias muaj dab tsi mus tsis raug nrog daim npav SD, tom qab ntawd nws yog qhov yooj yim los kho nws.

Kaw lub Raspberry Pi

$ sudo kaw –h 0

Tos kom txog thaum daim npav kaw, thiab tom qab ntawd tshem lub hwj chim tawm, thiab tom qab ntawd tshem daim npav micro SD

Ntxig daim npav micro SD rau hauv SD Adapter, thiab tom qab ntawd ntxig daim npav SD rau hauv MacBook

Ntawm MacBook siv cov lus qhia los ntawm The Pi Hut nrog kev hloov kho raws li hauv qab no:

Qhib lub dav hlau qhov rai

Hloov mus rau cov npe uas muaj cov duab raspbian

$ cd ♣ your-macbook-image-directory ♣

Txheeb xyuas lub disk (tsis muab faib) ntawm koj daim npav SD piv txwv li disk4 (tsis yog disk4s1). Los ntawm diskutil cov zis, = 4

$ daim ntawv teev npe

TSEEM CEEB: Nco ntsoov tias koj siv qhov raug - yog tias koj nkag mus tsis raug, koj yuav kawg so tawm koj lub hard disk!

Luam daim duab los ntawm koj daim npav SD. Xyuas kom lub npe duab thiab raug:

$ sudo dd yog =/dev/disk ♣ micro-SD-card-disk#♣ ntawm = ♣ your-macbook-image-directory ♣/SDCardBackup ♣ piav qhia ♣.dmg

CTRL-t kom pom cov xwm txheej ntawm kev theej.

Thaum ua tiav, unmount SD Card:

$ diskutil unmountDisk /dev /disk ♣ micro-SD-card-disk#♣

Tshem SD adapter los ntawm MacBook thiab tshem daim npav micro SD los ntawm adapter

Ntxig micro SD Card hauv Raspberry Pi

Ntawm qhov haujlwm tom ntej, siv daim duab no thiab hla ntau qib hauv cov lus qhia no.

Thiab koj ua tiav!

Pom zoo: