Cov txheej txheem:

Tswj Raspberry Pi Tsis Saib Xyuas: 7 Kauj Ruam
Tswj Raspberry Pi Tsis Saib Xyuas: 7 Kauj Ruam

Video: Tswj Raspberry Pi Tsis Saib Xyuas: 7 Kauj Ruam

Video: Tswj Raspberry Pi Tsis Saib Xyuas: 7 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Tswj Raspberry Pi Tsis Saib Xyuas
Tswj Raspberry Pi Tsis Saib Xyuas

Hauv cov lus qhia yav dhau los Kuv tau qhia tus pib qhia rau Raspberry Pi. Muaj peb tau pom yuav ua li cas rau khau raj Raspbian mus rau Pi thiab siv nws ua lub desktop. Tab sis rau qhov teeb tsa peb xav tau ntau yam khoom siv xws li saib, HDMI cable, wireless keyboard thiab OTG adapter. Feem ntau peb tsis xav tau cov khoom siv no tom qab thawj khau raj. Txhawm rau txuag qee cov nyiaj peb tuaj yeem siv Pi hauv Hom Tsis Muaj Lub taub hau piv txwv tias nkag mus tau yam tsis muaj lub monitor. Yog li tsis tas nkim sijhawm ntxiv, cia ua kom raug rau nws.

Kauj Ruam 1: Yuav Tsum Tau:

Yuav tsum
Yuav tsum

Ua ntej pib, peb yuav tsum tau sau qee cov kho vajtse thiab software rau txoj haujlwm no. Hardware Components:

1. Raspberry Pi

Raspberry Pi Zero W …………. (Amazon US / Amazon EU / Banggood) Los yog

Raspberry Pi 3 Qauv B+ ……. (Amazon US / Amazon EU / Banggood)

2. Micro SD daim npav ……………………… (Amazon US / Amazon EU / Banggood)

3. Micro SD daim npav nyeem ntawv ……………. (Amazon US / Amazon EU / Banggood)

Software:

1. Raspbian OS

2. PuTTY rau Windows

3. Fing App

Kauj Ruam 2: Pab kom SSH Nrog Saib:

Txoj kev no yog rau cov uas muaj tus saib xyuas thiab lwm yam khoom siv ib puag ncig. Koj tsuas yog yuav tsum nruab Raspbian ntawm SD daim npav thiab ntxig nws rau hauv Pi. Txheeb tawm qhov kev qhia no yog tias koj xav kawm yuav ua li cas rau nruab Raspbian. Tom qab ua tiav txhim kho OS ntawm daim npav SD, ntxig rau hauv Pi thiab khau raj nws.

  1. Tom qab Pi tau khau raj, nyem rau ntawm lub cim raspberry nyob rau sab saum toj sab laug. Koj yuav pom cov ntawv qhia zaub mov nco-down, los ntawm cov ntawv qhia zaub mov no xaiv "Nyiam". Los ntawm cov ntawv qhia zaub mov nco thib ob, xaiv "Raspberrypi teeb tsa".
  2. Lub qhov rai pop -up yuav tshwm, Xaiv "Interface" tab.
  3. Tom ntej no, qhib lub Koob Yees Duab, I²C, GPIO thiab SSH. Cov no yog cov yam ntxwv peb yuav siv tshaj plaws.
  4. Tus Pi tam sim no tau npaj los tswj tsis muaj tus saib xyuas thiab keyboard.

Kauj Ruam 3: Pab kom SSH Tsis Saib Xyuas:

Pab kom SSH Tsis Saib Xyuas
Pab kom SSH Tsis Saib Xyuas

Tam sim no txhawm rau pab SSH yam tsis muaj tus saib, ua raws cov theem hauv qab no:

  • Nruab Raspbian duab mus rau SD daim npav zoo ib yam li kev qhia yav dhau los.
  • Tom qab daim duab raug hlawv, tsis txhob ntsaws daim npav. Xwb qhib lub khau raj muab faib. Nco ntsoov tias lub qhov rais yuav nug koj kom format lub tsav, hais tsis yog lossis thim nws. TSIS TXHOB ZOO TSHAJ PLAWS.
  • Hauv kev faib ua khau raj, muaj ntau cov ntaub ntawv thiab cov ntawv tais ceev tseg. Tsis txhob kho lossis tshem tawm cov ntaub ntawv los ntawm no, lossis lwm yam nws yuav ua rau lub kaw lus tsis ua haujlwm.
  • Ntawm no peb yuav tsum ntxiv ob daim ntawv, SSH thiab wpa_supplicant.conf
  • Ua ntej tshaj plaws peb yuav tsum tsim cov ntaub ntawv SSH, nyem txoj cai hauv lub khau raj muab faib thiab nyem rau "tshiab", los ntawm cov npe xaiv "Cov ntawv tshiab" Npe cov ntaub ntawv ssh thiab tshem qhov ".txt" txuas ntxiv. Tom ntej no khaws cov ntawv. Cov ntaub ntawv no yuav pab kom SSH tso cai rau peb txuas rau Pi siv PuTTY.
  • Tom ntej no tsim cov ntawv sau tshiab thiab npe nws "wpa_supplicant.conf" thiab khaws cov ntawv.
  • Qhib cov ntaub ntawv wpa_supplicant hauv cov ntawv sau thiab ntxiv cov ntawv hauv qab no:

lub teb chaws = IN

ctrl_interface = DIR =/var/run/wpa_supplicant GROUP = netdev update_config = 1 network = {ssid = "Koj lub npe network WiFi" scan_ssid = 1 psk = "WiFi password" key_mgmt = WPA-PSK}

  • Hauv tsab ntawv koj yuav tsum tau hloov qee yam. Hauv thawj kab tebchaws = IN, Kuv tau sau IN vim kuv los ntawm Is Nrias teb, thiab ISO code rau Is Nrias teb yog IN. Koj tuaj yeem pom cov cai ntawm koj lub tebchaws los ntawm Wikiwand. Tom ntej no ntxiv koj ssid uas tsis muaj dab tsi tab sis koj lub npe WiFi. Kuj ntxiv psk uas yog koj li WiFi password. Thaum koj ua tiav, nco ntsoov khaws cov ntawv.
  • Tam sim no tshem tawm daim npav SD thiab ntxig rau hauv Pi. Fais fab Pi thiab tos ob peb feeb. Nws yuav siv sijhawm ntev dua rau khau raj thawj zaug.

Kauj Ruam 4: Nrhiav Tus IP Chaw Nyob:

Nrhiav Tus IP Chaw Nyob
Nrhiav Tus IP Chaw Nyob

Ua ntej peb tuaj yeem SSH rau hauv Raspberry Pi, peb yuav tsum paub tus IP chaw nyob ntawm Pi. Txhawm rau nrhiav tus IP chaw nyob Kuv nyiam siv app hu ua Fing. Nws muaj rau ob qho tib si Android thiab iPhone. Txhawm rau nrhiav tus IP chaw nyob:

  • Ua ntej tshaj kom ntseeg tau tias koj lub xov tooj smartphone txuas nrog tib lub network WiFi zoo ib yam li Pi.
  • Qhib Fing app, ntawm nplooj ntawv hauv tsev koj yuav pom cov npe khoom siv txuas nrog lub router.
  • Nco tseg tus IP chaw nyob ntawm "raspberrypi". Peb yuav siv qhov no los tsim kev sib txuas nrog Pi.

Tam sim no peb yuav txuas rau lub rooj tsavxwm siv SSH hauv kauj ruam tom ntej.

Kauj ruam 5: SSH rau hauv Pi:

SSH rau hauv Pi
SSH rau hauv Pi
SSH rau hauv Pi
SSH rau hauv Pi
SSH rau hauv Pi
SSH rau hauv Pi

Yog tias koj siv Windows, Kuv pom zoo siv PuTTY. Tsuas yog rub tawm thiab teeb tsa nws zoo li lwm daim ntawv thov. Rau Linux cov neeg siv, SSH twb muaj lawm. Tsuas yog qhib lub davhlau ya nyob twg qhov rai, thiab ntaus qhov hais kom ua "ssh" kom pom tias nws ua haujlwm li cas.

SSH siv PuTTY Rau Cov Neeg Siv Windows:

  • Thawj lub zog ua rau Raspberry Pi siv lub zog 5v. Nws yuav tsum txuas rau koj li WiFi network li ob peb feeb.
  • Tam sim no qhib PuTTY thiab nkag mus rau IP chaw nyob ntawm Pi thiab nyem rau ntawm "Qhib".
  • Hauv ob peb lub vib nas this lub qhov rai yuav tshwm tuaj uas peb yuav tsum nkag mus rau tus username thiab password. Lub npe siv tsis raug yog "pi" thiab tus password yog "raspberry".
  • Nco ntsoov tias koj tsis tuaj yeem pom tus lej zais hauv lub davhlau ya nyob twg yog li sau qeeb lossis koj yuav tau txais "Kev tsis lees paub".
  • Tom qab ua tiav kev nkag mus koj yuav pom lub qhov rai davhlau ya nyob twg. Tam sim no koj tuaj yeem txuas rau koj li Raspberry Pi siv SSH! hais lus zoo rau cov keyboard ntxiv, nas, thiab saib xyuas!

Rau Unix Cov Neeg Siv: (Linux thiab macOS)

Txhawm rau tsim SSH kev sib txuas hauv Linux, qhib lub davhlau ya nyob twg thiab nkag mus rau ssh hais kom ua

ssh [email protected]

  • Ntawm no koj yuav ntxiv koj tus IP chaw nyob thiab ntaus nkag.
  • Tom ntej no, koj yuav raug nug yog tias koj xav txuas rau lub cuab yeej. Hom y.
  • Tom qab ntawd koj yuav raug nug kom nkag mus rau tus password, ntaus tus password tsis raug "raspberry".

Thiab qhov ntawd yuav tsum coj koj mus rau hauv Raspberry Pi lub davhlau ya nyob twg. Tam sim no ib qho kawg uas yuav tsum ua yog kev nyab xeeb Pi.

Kauj Ruam 6: Ruaj Ntseg Raspberry Pi:

Pawg Raspberry Pi muaj tib lub npe siv thiab tus lej nkag los ntawm lub neej ntawd. Yog li ntawd, nws tuaj yeem ua rau muaj kev phom sij rau hackers. Txhawm rau tiv thaiv ib qho tsis raug tso cai nkag mus rau peb Pi, peb yuav hloov tus password tsis raug.

Txhawm rau hloov tus password:

  • Ntaus passwd thiab ntaus nkag.
  • Koj yuav raug nug kom nkag mus rau tus lej tam sim no rau kev lees paub. Nkag mus rau tus lej zais zais raspberry thiab ntaus nkag.
  • Tam sim no koj yuav raug nug kom nkag mus rau tus lej tshiab, ntawm no nkag mus rau tus lej tshwj xeeb nrog ua ke ntawm cov tsiaj ntawv, tus lej thiab tus cim tshwj xeeb. Thaum koj ntaus tus password, tsis muaj dab tsi yuav tshwm rau ntawm lub davhlau ya nyob twg, yog li xyuas kom koj ntaus qeeb thiab raug.
  • Tom qab koj nkag mus rau tus password tshiab, koj yuav raug nug kom paub meej tus password. Ntawm no ntaus tus password tshiab dua thiab ntaus nkag.
  • Cov lus ua tiav yuav tshwm rau ntawm lub davhlau ya nyob twg:

passwd: lo lus zais tshiab tau ua tiav

Qhov no qhia tias tus lej tshiab tau siv. Cov txheej txheem no yuav ua rau Pi ruaj ntseg. Yog tias koj xav kawm paub ntau ntxiv txog Cov Neeg Siv thiab Passwords tshawb xyuas cov ntawv no ntawm Raspberry Pi tus vev xaib raug cai. Nws yuav muab cov lus qhia ntxaws ntxiv rau koj.

Kauj Ruam 7: Lus Cim Kawg:

Tam sim no koj tau npaj siv koj li Raspberry Pi nrog SSH. Hauv kev qhia tom ntej, peb yuav pom yuav siv GPIO pins ntawm peb Pi li cas los tswj LEDs.

Tsis txhob hnov qab txheeb xyuas kuv li ebook "Mini WiFi Robot" yog tias koj tsis tau ua dua. Nws yuav coj koj hla txhua kauj ruam los tsim koj tus kheej kev cai neeg hlau.

Vam tias koj pom cov ntaub ntawv qhia no. Yog tias koj muaj kev ua xyem xyav, thov nug hauv cov lus.

Pom zoo: