Cov txheej txheem:

Qhia rau (Headless) Raspberry Pi: 12 Cov Kauj Ruam (nrog Duab)
Qhia rau (Headless) Raspberry Pi: 12 Cov Kauj Ruam (nrog Duab)

Video: Qhia rau (Headless) Raspberry Pi: 12 Cov Kauj Ruam (nrog Duab)

Video: Qhia rau (Headless) Raspberry Pi: 12 Cov Kauj Ruam (nrog Duab)
Video: QHIA QHOV TSEEB - KUB VAJ LOOG TSUA NEW MUSIC VIDEO 2022 2024, Hlis ntuj nqeg
Anonim
Qhia rau (Headless) Raspberry Pi
Qhia rau (Headless) Raspberry Pi

Thaum kawg! Siv koj li Raspberry Pi yam tsis tau siv dab tsi zoo li ib txhis txuas nrog cov khoom siv sab nraud thiab cuam tshuam nrog w/ cable tsis txaus ntseeg: teeb tsa koj Pi kom tsis muaj hau! (tsis yog yam txaus ntshai) Qhov no yog qhov muaj txiaj ntsig tshwj xeeb rau cov tib neeg qhia kev cob qhia nrog Raspberry Pi, vim nws tuaj yeem nyuaj (thiab kim) los muab cov saib, cov twj, thiab nas rau txhua tus tub ntxhais kawm.

Kuv tabtom kwv yees tias txhua tus paub me ntsis txog Pi, yog li qhov kev qhia no yuav tsis npog dab tsi Pi yog lossis nws muaj peev xwm txaus (Kuv tab tom saib koj, GPIO pins!). Txhawm rau kawm paub ntau ntxiv txog dab tsi Pi tuaj yeem ua, txheeb xyuas qee qhov ntawm kuv lwm yam kev qhia (saib ntu kawg hauv qhov kev qhia no) lossis tawm lus tawm.

Dab tsi yog npog hauv qhov kev qhia no: Ua kom siv thiab siv SSH, kev txheeb xyuas dav dav ntawm Linux lub davhlau ya nyob twg qhov rai, thiab yuav ua li cas txuas rau Pi's GUI (Cov Duab Siv Sib Txuas, aka Desktop saib) ntawm SSH.

Lub Sijhawm Nyeem Ntawv: 15 feeb

Tsim Sijhawm: ~ 20 feeb

Nqi: Pub dawb! (piv txwv tias koj twb muaj RPi thiab Ethernet cable)

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv

- Khoos phis tawj nrog Ethernet chaw nres nkoj & SD Card qhov

Raspberry Pi 3

- SD Card (8GB lossis loj dua)

- MicroUSB rau USB fais fab qaum

- Ethernet Cable

- Pom zoo: Raspberry Pi Case & GPIO cable

Kauj ruam 2: Software

Txog qhov haujlwm no, koj yuav xav tau cov software hauv qab no (dawb!)

  • Etcher

    Txhawm rau sau Raspbian OS rau SD Card (thiab tseem format SD card)

  • Bonjour Cov Kev Pabcuam Luam Ntawv (teeb tsa rau Windows lossis Linux OS nkaus xwb)

    Rau kev siv "raspberrypi.local" IP chaw nyob

  • PuTTY

    SSH rau hauv Pi

  • Kev Txuas Hluav Taws Xob Desktop (nruab rau ntawm lub khoos phis tawj uas tsis yog Windows)

    Txhawm rau khiav GUI ntawm SSH

Kauj ruam 3: Kho lub SD Card

Kho lub SD Card
Kho lub SD Card
Kho lub SD Card
Kho lub SD Card
Kho lub SD Card
Kho lub SD Card
Kho lub SD Card
Kho lub SD Card

1. Rub tawm qhov koj nyiam tsw ntawm Raspbian! Koj tuaj yeem tau txais cov ntawv tshiab tshaj plaws ntawm no

2. Ntxig daim npav SD rau hauv koj lub PC thiab qhib Etcher

3. Xaiv Raspbian zip file, tus tsav tsheb rau koj daim npav SD, thiab nyem "format"

4. Pab kom SSH nkag tau

Qhib cov ntaub ntawv txheem rau SD daim npav. Ntxiv cov ntawv sau tshiab hu ua "SSH". Yog tias lub khoos phis tawj ntxiv cov ntaub ntawv txuas ntxiv (piv txwv li ".txt"), rho tawm nws thiab tsis quav ntsej cov lus ceeb toom.

5. Tshem daim npav SD thiab ntxig rau hauv koj tus Pi

Kauj Ruam 4: Cia Peb Sib Txuas

Cia Peb Sib Txuas!
Cia Peb Sib Txuas!
Cia Peb Sib Txuas!
Cia Peb Sib Txuas!
Cia Peb Sib Txuas!
Cia Peb Sib Txuas!

1. Txuas lub Ethernet cable ntawm Raspberry Pi & koj lub computer

2. Txuas lub USB fais fab cable

Txheeb xyuas tias lub teeb liab liab tig thiab lub Ethernet chaw nres nkoj teeb (daj & ntsuab) tau qhib thiab/lossis ntsais muag.

3. Txuas RPi mus rau World Wide Web (aka Internet)

Mus rau Chaw -> Network & Internet -> Hloov Adapter Xaiv (aka Network Kev Sib Txuas).

Nyem rau ntawm Ethernet kev sib txuas, tuav "CTRL", thiab tom qab ntawd nyem rau ntawm koj li WiFi txuas.* Nyem rau sab xis hauv lub qhov rai thiab xaiv "Choj Txuas"-qhov no yuav txuas qhov txuas ntawm Ethernet chaw nres nkoj mus rau koj qhov chaw nres nkoj WiFi.

*Yog tias koj xaiv WiFi txuas ua ntej, nws yuav txuas qhov txuas ntawm WiFi mus rau Ethernet, uas yuav tso cai rau koj nkag mus rau Pi tab sis tsis txuas rau Is Taws Nem.

4. Qhib PuTTY thiab nkag mus rau Pi siv "raspberrypi.local" IP chaw nyob

Default username: pib

Default password: raspberry

5. Hloov tus password tsis raug los ntawm kev ntaus passwd thiab ua raws cov lus qhia

Kauj Ruam 5: Taw Qhia Linux Terminal Window (Plhaub)

Taw qhia rau Linux Terminal Window (Plhaub)
Taw qhia rau Linux Terminal Window (Plhaub)
Taw qhia Linux Terminal Window (Plhaub)
Taw qhia Linux Terminal Window (Plhaub)

Lub qhov rooj davhlau ya nyob twg yog lub vaj huam sib luag tswj rau lub kaw lus

Feem ntau nws qhia qhov hais kom ua sai sai, uas muab cov ntaub ntawv rau peb tab sis tsis yog ib feem ntawm cov lus txib rau hauv kab ke. Feem ntau qhov kev hais kom ua tam sim qhia tus neeg siv lub npe nkag thiab cov npe ua haujlwm tam sim no (sawv cev los ntawm twiddle: ~).

Cov lus txib nkag

Cov lus txib tau sau tom qab ua kom sai thiab nkag los ntawm kev nias tus yuam sij Enter.

Cov lus txib tuaj yeem ua raws li-lossis lossis ua raws ib lossis ntau txoj kev xaiv. Cov kev xaiv feem ntau muaj qhov tsoo nyob rau ntawm lawv xub ntiag, zoo li cov hauv qab no:

ls -ib

Koj tuaj yeem saib cov kev xaiv rau cov lus txib tshwj xeeb los ntawm kev ntaus lub npe ua raws los ntawm "-pab" (yuav npog qhov no ntxiv tom qab).

Daim duab thib ob qhia txog cov npe ntawm cov lus txib ib txwm muaj. Xyaum siv lawv los ntawm (1) mus rau lub Desktop, (2) tsim cov ntawv nrog qee cov ntawv, thiab (3) khaws cov ntawv.

Nov yog qhov kev sib tw tshwj xeeb: ntaus cov lus txib hauv qab no thiab sim xyuas seb nws ua dab tsi.

cd ua..

Kauj Ruam 6: Cov Ntsiab Lus Tshwj Xeeb Tshwj Xeeb

Cov Ntsiab Lus Tshwj Xeeb Tshwj Xeeb!
Cov Ntsiab Lus Tshwj Xeeb Tshwj Xeeb!
Cov Ntsiab Lus Tshwj Xeeb Tshwj Xeeb!
Cov Ntsiab Lus Tshwj Xeeb Tshwj Xeeb!

Lub qhov rais Linux davhlau ya nyob twg yooj yim dua (& nrawm dua) siv yog tias koj paub ob peb qhov tshwj xeeb ua ke ua ke. Feem ntau muaj xws li:

  • Ctrl+C: Xaus qhov haujlwm
  • Ctrl+A: Txav mus rau qhov pib ntawm kab hais kom ua
  • Ctrl+E: Txav mus rau qhov kawg ntawm kab hais kom ua
  • Up & Down Arrow yuam sij: Tshawb los ntawm keeb kwm hais kom ua (tuaj yeem kho cov no thiab nias Enter kom rov ua dua)
  • Tab: Filename tiav

Txheeb cov duab saum toj no kom ua tiav cov npe thiab xyaum siv cov no thaum koj mus rau kab hais kom ua!

Kauj Ruam 7: Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv Qhia

Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv
Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv
Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv
Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv
Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv
Tau Txais Kev Pab hauv Terminal #1: Phau Ntawv Qhia & Nplooj Ntawv

Cov nplooj ntawv phau ntawv yog cov peev txheej siv tau rau txhua qhov ntawm cov lus txib muaj nyob hauv Linux lub davhlau ya nyob twg qhov rai.

Txhawm rau nyeem cov nplooj ntawv phau ntawv ntawm cov lus txib tshwj xeeb, ntaus cov hauv qab no:

txiv neej hais kom ua

Hauv phau ntawv qhia, thawj kab ntawv muaj lub npe ntawm cov lus txib uas koj tab tom nyeem txog thiab ID ntawm ntu uas muaj nplooj ntawv qhia.

Tom qab thawj kab yog kab lus luv luv, uas yog cov lus piav qhia luv luv ntawm cov lus txib uas suav nrog kev sau cia ntawm txhua qhov kev xaiv thiab/lossis kev sib cav. Cov kev xaiv yog ib txoj hauv kev ua tiav cov lus txib, thiab kev sib cav yog qhov koj ua rau nws. Kev xaiv cov lus sib cav tau muab nruab nrab ntawm cov kab zauv.

Tom qab cov ntsiab lus yog piav qhia ntev dua ntawm cov lus txib, ua raws los ntawm kev nkag siab ntau ntxiv ntawm cov kev xaiv muaj, cov ntaub ntawv hais txog kev sib txuas ua ke kev xaiv, lwm cov lus txib cuam tshuam, thiab lwm yam ntaub ntawv ntsig txog cov lus txib.

Qee cov lus txib muaj ntau nplooj ntawv txiv neej, zoo li "passwd" hais kom ua. Txhawm rau pom txhua nplooj ntawv hais txog cov lus txib, siv qhov "-a" kev xaiv:

man -passwd ib

Thawj ntu ntawm nplooj ntawv qhia rau apropos hais kom ua yog qhia hauv daim duab thib ob saum toj no.

Cov nplooj ntawv cov ntaub ntawv muaj cov ntaub ntawv tshiab tam sim no thiab tuaj yeem siv tau yooj yim dua. Txhawm rau saib cov nplooj ntawv cov ntaub ntawv ntawm kev hais kom ua (hloov "hais kom ua" nrog lub npe tiag tiag ntawm cov lus txib koj xav tshawb fawb, zoo li "apropos"), ntaus cov hauv qab no:

cov lus txib hais kom ua

Txhawm rau mus rau nplooj ntawv cov ntaub ntawv, siv tus xub xub txhawm rau xaub los ntawm cov ntawv, sau tus yuam sij los nyeem txog cov ntsiab lus tshwj xeeb, "P" thiab "N" cov yuam sij mus rau yav dhau los lossis cov ncauj lus tom ntej, thiab thaj chaw seem kom txav mus rau ib nplooj ntawv ntxiv Siv "Q" txiav tawm.

Ib qho kev txiav tawm los ntawm cov nplooj ntawv qhia muaj nyob hauv daim duab thib 3 saum toj no.

Kauj Ruam 8: Tau Txais Kev Pab #2: Dab Tsi thiab Apropos Commands

Tau Txais Kev Pab #2: Dab Tsi thiab Apropos Commands
Tau Txais Kev Pab #2: Dab Tsi thiab Apropos Commands
Tau Txais Kev Pab #2: Dab Tsi thiab Apropos Commands
Tau Txais Kev Pab #2: Dab Tsi thiab Apropos Commands

Qhov "dab tsi" hais kom muab cov ntaub ntawv luv luv hais txog kev hais kom ua thiab teev thawj ntu hauv tus txiv neej nplooj ntawv uas muaj nplooj ntawv cuam tshuam (hauv kab lus tom qab lub npe hais kom ua).

Yog tias koj tsis paub meej tias yuav pib qhov twg, qhov "apropos" hais kom ua yog txoj hauv kev zoo los tshawb nrhiav cov ntsiab lus. Piv txwv li, yog tias koj xav paub pib browser li cas, koj tuaj yeem ntaus: "apropos browser", uas yuav rub tawm cov npe ntawm txhua qhov program cuam tshuam nrog browser, suav nrog web browsers, file thiab FTP browsers, thiab lwm yam.

Kauj Ruam 9: Tau Txais Kev Pab #3: -Pab Xaiv

Tau Txais Kev Pab #3: -Pab Kev Xaiv
Tau Txais Kev Pab #3: -Pab Kev Xaiv

Feem ntau cov lus txib tseem muaj qhov kev xaiv "-pab", uas piav qhia luv luv ntawm cov lus txib thiab cov npe ntawm cov kev xaiv muaj. Thaum tsis ntseeg, qhov no yog txoj hauv kev zoo kom tau txais qee cov ntaub ntawv nrawm thiab muaj txiaj ntsig ntawm kev siv cov lus txib tshwj xeeb thiab nws tuaj yeem txuas ntxiv mus.

Txhawm rau siv --help xaiv, ntaus "--help" tom qab cov lus txib tshwj xeeb, zoo li cov piv txwv hauv qab no (tseem pom hauv daim duab saum toj no):

apropos -pab

Kauj ruam 10: Txaus ntawm Terminal! Desktop nyob qhov twg?

Txaus ntawm Terminal! Desktop nyob qhov twg?!
Txaus ntawm Terminal! Desktop nyob qhov twg?!
Txaus ntawm Terminal! Desktop nyob qhov twg?!
Txaus ntawm Terminal! Desktop nyob qhov twg?!

Ua tau zoo.. Qhov kev sib txuas ntawm Desktop yog ib txoj hauv kev yooj yim los siv lub desktop saib, tseem hu ua "Graphical User Interface," lossis GUI kom luv.

1. Txhim Kho Cov Duab Txuas Rau Tej Chaw Nyob ntawm koj tus Pi:

sudo apt-tau nruab xrdp

2. Txhim Kho Qhov Chaw Txuas Hluav Taws Xob ntawm koj lub PC (twb tau teeb tsa ntawm Windows OS).

3. Qhib Chaw Taws Teeb Txuas Txuas thiab nkag mus siv tus IP "raspberrypi.local" (lossis nrhiav koj tus IP tus IP siv cov lus txib ifconfig). Tsis quav ntsej lus ceeb toom (nyem "yog").

4. Nkag mus nrog Pi tus username thiab password

Yog tias koj tseem tsis tau hloov koj tus lej password, ua tam sim no. (Yog, Kuv paub kuv twb tau hais rau koj ua li ntawd tab sis nws tsim nyog rov ua dua vim tias ib tus neeg tuaj yeem nkag mus rau hauv koj tus Pi yog tias koj tsis hloov pauv tus lej nkag mus.)

Kauj ruam 11: SSH yog dab tsi, Xijpeem?

SSH yog dab tsi, Xijpeem?
SSH yog dab tsi, Xijpeem?

SSH sawv cev rau "Secure SHell" - nws yog "txheej txheem txheej txheem txheej txheem txheej txheem rau kev ua haujlwm pabcuam kev nyab xeeb hla lub network tsis muaj kev nyab xeeb." - Wikipedia

… Uh, dab tsi?

Hauv lwm lo lus, SSH yog txoj hauv kev nyab xeeb los sib txuas ntawm ib lub computer thiab lwm lub, txawm tias lub network uas koj txuas nrog tsis muaj kev nyab xeeb. Piv txwv li, yog tias koj nyob hauv kev sib koom network thiab koj siv SSH txhawm rau nkag mus rau lwm lub khoos phis tawj, lwm tus neeg ntawm kev sib koom network tsis tuaj yeem pom koj ua dab tsi los ntawm kev sib txuas hauv tej thaj chaw deb (txawm hais tias Snowden tau tshaj tawm cov ntaub ntawv uas qhia NSA qee zaum tuaj yeem rov txiav txim siab SSH).

Kev siv ntau ntawm SSH suav nrog kev nkag mus deb, zoo li yog tias koj xav txuas rau lub khoos phis tawj uas nyob deb li ib mais hauv qab yam tsis tas yuav, koj paub, qhov tseeb mus rau ntawd (Kuv siv los ua haujlwm rau qhov txias txias tsaus qhov teeb meem sim hu ua DRIFT thiab qhov no yog li cas peb yuav nkag mus rau lub khoos phis tawj uas tswj lub ntsuas hluav taws xob vim tias khoos phis tawj nyob hauv kuv li 3 mais hauv av.. nyob deb dhau mus rau kev hloov kho software!).

Nov yog nplooj Wikipedia tag nrho ntawm SSH - nws zoo heev yog li tshawb xyuas nws!

Kauj Ruam 12: Khiav Koj Li Headless Pi & Kawm Ntxiv

Khaws Koj Lub Headless Pi & Khaws Kev Kawm!
Khaws Koj Lub Headless Pi & Khaws Kev Kawm!

Tawm mus thiab tshawb! Xyaum siv lub qhov rooj dav dav kom txog thaum koj tau txais kev yooj yim thiab paub nrog cov lus txib yooj yim. Koj tuaj yeem txiav txim siab tshem tawm Ethernet cable & ua rau koj Pi nkag mus siv tau (Kuv yuav tshaj tawm cov lus qhia ntawm qhov no hauv ob peb lub asthiv tom ntej).

Ua haujlwm GPIO tus pin los ua cov khoom txias! Xav tau ib co tswv yim? Txheeb tawm cov kev qhia no:

1. Ua kom av noo Sensor

2. Tsim Tus Tswj Dej Dej (tuaj yeem sib tw nrog av noo Sensor)

3. Tsov Tom Qab: Nruab IoT Tsiaj Saib Xyuas

4. Nthuav tawm ntawm koj Lub Tsev Ntse & ntxiv Motion Triggered Music Player

Xav tau qhov?

Sib cais cov khoom qub & cov khoom siv hluav taws xob tawg! Cov khoom siv hluav taws xob yog qhov chaw zoo kom tau txais lub cav thiab tus hais lus. Yog tias koj xav tau cov cav zoo dua, sib cais cov cuab yeej siv zog.

Nug cov phooj ywg lossis nrhiav chaw kho vajtse kom muaj qhov txuas ntxiv thiab xaim, txuag cov hlua hluav taws xob los ntawm cov khoom siv hluav taws xob qub thiab siv lawv ua cov khoom siv hluav taws xob lossis sau lawv rau xov hlau thiab/lossis txuas, txuag lub mloog pob ntseg qub thiab siv lawv rau cov phiaj xwm suab.

Cov lus qhia zoo tshaj plaws: xav ua ntej koj pov tseg:)

Pom zoo: