Cov txheej txheem:

Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv: 4 Kauj Ruam (nrog Duab)
Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv: 4 Kauj Ruam (nrog Duab)

Video: Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv: 4 Kauj Ruam (nrog Duab)

Video: Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv: 4 Kauj Ruam (nrog Duab)
Video: Оператор бассейна чиа FlexPool выпускает FlexFarmer для выращивания чиа с низким энергопотреблением и многое другое! 2024, Hlis ntuj nqeg
Anonim
Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv
Headless Pi - Ua Kom Koj Raspberry Pi Pib Tsis Muaj Lwm Yam Kho Vajtse Ntxiv

Nyob zoo, Qhov laj thawj koj tsaws ntawm no yog, kuv twv, tias koj zoo li kuv! Koj tsis xav ua kom yooj yim ntawm koj Pi - ntsaws Pi rau hauv lub ntsuas saib, sib txuas cov keyboard thiab nas, thiab voila! … Pfft, leej twg ua li ntawd?! Tom qab tag nrho, Pi yog "PC-pocket PC", thiab tsis muaj tus saib yuav haum rau hauv kuv lub hnab ris. Yog li, peb ua dab tsi? Peb tinker! Peb xam tawm ib txoj hauv kev los siv peb lub khoos phis tawj lub laptop zaub, keyboard thiab trackpad raws li peb Pi cov khoom siv ib puag ncig.

Nov yog yam peb yuav xav tau:

  • Laptop
  • Raspberry Pi
  • Daim npav nyeem ntawv
  • Micro-SD daim npav
  • Micro-USB cable
  • USB rau TTL serial Cable (yeem)
  • USB WiFi Dongle (yeem; Pi 2 thiab hauv qab)
  • Ethernet Cable
  • Wireless Internet Kev Sib Txuas

Kauj ruam 1: Txhim kho Raspbian

Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian
Txhim kho Raspbian

Yog tias koj tseem tsis tau teeb tsa OS rau hauv koj lub rooj tsavxwm, tam sim no yuav yog lub sijhawm zoo los ua li ntawd. Txheeb xyuas phau ntawv qhia lossis ua raws cov theem hauv qab no:

Qhov rai:

  1. Rub tawm qhov tseeb Raspbian duab los ntawm Raspberry Pi lub vev xaib Rub tawm nplooj ntawv.
  2. Tom qab rub tawm cov ntawv.zip, unzip nws kom tau txais daim duab (.img) rau kev sau rau koj daim npav SD.
  3. Ntxig daim npav SD rau hauv koj daim npav nyeem ntawv thiab ntsaws rau hauv koj lub laptop.
  4. Rub tawm Win32DiskImager cov khoom siv los ntawm Sourceforge Project nplooj ntawv ua zip file. Extract qhov ua tiav los ntawm cov ntawv zip thiab khiav cov khoom siv
  5. Xaiv cov ntaub ntawv duab koj rho tawm ua ntej.
  6. Xaiv daim ntawv tsav uas tau muab rau koj daim npav SD hauv lub thawv ntaus ntawv. Ua tib zoo xaiv qhov tsav kom raug; yog tias koj tau txais qhov tsis raug koj tuaj yeem rhuav tshem cov ntaub ntawv ntawm koj lub khoos phis tawj hard disk! Yog tias koj siv daim npav SD daim npav hauv koj lub khoos phis tawj thiab tsis tuaj yeem pom tus tsav hauv Win32DiskImager qhov rai, sim siv sab nraud SD adapter.
  7. Nyem Sau thiab tos kom sau kom tiav.
  8. Tawm ntawm qhov kev xav.

Ubuntu:

  1. Rub tawm qhov tseeb Raspbian duab los ntawm Raspberry Pi lub vev xaib Rub tawm nplooj ntawv.
  2. Tom qab rub tawm cov ntawv.zip, unzip nws kom tau txais daim duab (.img) rau kev sau rau koj daim npav SD.
  3. Ntxig daim npav SD rau hauv koj daim npav nyeem ntawv thiab ntsaws rau hauv koj lub laptop.
  4. Txoj cai -nyem rau ntawm cov duab koj tau rho tawm ua ntej thiab xaiv Qhib nrog -> Disk Image Writer
  5. Xaiv koj daim npav SD los ntawm cov npe thiab ntaus Pib Rov Qab. Ua tib zoo xaiv qhov tsav kom raug; yog tias koj tau txais qhov tsis raug koj tuaj yeem rhuav tshem cov ntaub ntawv ntawm koj lub khoos phis tawj hard disk!
  6. Nkag mus rau koj tus password kom tso cai hauv paus thiab tos kom sau kom tiav.
  7. Tawm ntawm qhov chaw pabcuam.

Tsis txhob tshem daim npav SD tam sim no! Tsuas muaj ob yam ua ntxiv xwb.

  1. Txhawm rau pab kom lub plhaub nkag hla SSH: xauj mus rau phau ntawv teev npe khau raj thiab, siv cov ntaub ntawv kho kom raug, tsim cov ntaub ntawv uas tsis muaj npe hu ua ssh (tsis muaj cov ntawv txuas ntxiv)
  2. Txhawm rau ua kom muaj kev sib txuas lus txuas: xauj mus rau phau ntawv teev npe rov qhib dua, qhib cov ntaub ntawv config.txt siv cov ntaub ntawv kho vajtse thiab ntxiv cov kab hauv qab no (yam tsis muaj nqe lus) mus rau qhov kawg ntawm cov ntawv "enable_uart = 1". Txuag cov ntawv thiab koj ua tiav!

Kauj Ruam 2: Tau Paub Koj Tus IP Tus IP

Kev Paub Txog Koj Tus IP Tus IP
Kev Paub Txog Koj Tus IP Tus IP
Kev Paub Txog Koj Tus IP Tus IP
Kev Paub Txog Koj Tus IP Tus IP
Kev Paub Txog Koj Tus IP Tus IP
Kev Paub Txog Koj Tus IP Tus IP

Thaum koj ua tiav txhim kho OS, yooj yim ntxig daim npav micro-SD rau hauv koj Pi thiab txhawb koj lub rooj tsav xwm siv micro-USB cable. Tam sim no, kwv yees tias koj lub khoos phis tawj muaj wireless internet txuas (WiFi/USB dongle), ntsaws rau hauv ib qho kawg ntawm Ethernet cable rau koj Pi thiab lwm qhov rau koj lub laptop.

Txoj Kev 1 (Ubuntu)

  1. Qhib "Network Manager" thiab nyem rau ntawm "Edit Connections"
  2. Xaiv "Wired Connection 1" thiab nyem rau ntawm "Edit". Yog tias koj tsis muaj qhov txuas txuas txuas, nyem rau "Ntxiv"
  3. Hauv qab "Wired" tab, teeb tsa "Device MAC Address" teb rau xx: xx: xx: xx: xx: xx (eth0) kev xaiv los ntawm cov npe teev cia
  4. Hauv qab "IPv4 Settings" tab, teeb tsa "Txoj Kev" teb rau "Sib koom rau lwm lub Computer" kev xaiv los ntawm cov npe teev cia
  5. Qhib lub davhlau ya nyob twg thiab khiav ifconfig kom nco ntsoov IP tau muab rau eth0
  6. Tam sim no nqa cov lus ARP siv cov lus txib arp -a, nqes mus rau lub interface tshwj xeeb IP muab rau eth0 thiab tshuaj xyuas cov ntawv nkag los txheeb xyuas tus IP tau muab rau koj Pi (192.168.1.109, hauv kuv qhov teeb meem). Ping tus IP kom paub tseeb
  7. Xwb, tom qab theem (4), koj tuaj yeem ncaj qha pinged raspberrypi.local los txiav txim siab koj tus IP tus IP lossis koj tuaj yeem siv nmap

Txoj Kev 1 (Windows)

  1. Mus rau "Network thiab Chaw Sib Koom" thiab nyem rau ntawm "Change Adapter Settings"
  2. Txoj cai-nias rau "WiFi adapter" thiab nyem rau ntawm "Properties"
  3. Hauv qab "Sib Koom" tab, khij qhov Tso cai rau lwm tus neeg siv los sib txuas los ntawm cov kev sib txuas hauv Is Taws Nem kev xaiv txuas thiab xaiv qhov tsim nyog Ethernet adapter los ntawm cov npe. Tam sim no koj yuav tsum pom tias qhov txuas tau raug cim ua Sib Koom
  4. Txoj cai-nias rau "Ethernet adapter" thiab nyem rau ntawm "Properties"
  5. Hauv qab "Networking" tab, ob npaug nias rau "Internet Protocol Version 4" xaiv thiab xyuas kom meej tias qee qhov IP tau hloov pauv tau muab rau Ethernet chaw nres nkoj
  6. Qhib qhov kev hais kom ua tam sim thiab tshaj tawm ping hais kom ua ntawm qhov chaw tshaj tawm hauv xov tooj cua IP. Txij li tus IP tau muab rau Ethernet chaw nres nkoj ntawm kuv lub laptop yog 192.168.137.1, Kuv yuav yooj yim ping 192.168.137.255
  7. Tam sim no nqa cov lus ARP siv cov lus txib arp -a, nqes mus rau lub interface tshwj xeeb tus IP muab rau Ethernet (192.168.137.1, hauv kuv qhov teeb meem) thiab tshuaj xyuas cov nkag los txheeb xyuas tus IP tau muab rau koj Pi (192.168. 137.99, hauv kuv qhov teeb meem). Ping tus IP kom paub tseeb
  8. Xwb, tom qab kauj ruam (5), koj tuaj yeem ncaj qha pinged raspberrypi.mshome.net los txiav txim siab koj tus IP tus IP

Txoj Kev 2 (Windows)

Yog tias yog vim li cas cov txheej txheem saum toj no tsis ua haujlwm rau koj, sim txuas ob lub network.

  1. Qhib qhov chaw teeb tsa dua, nkag mus rau WiFi cov cuab yeej thiab lov tes taw sib koom.
  2. Nkag mus rau Ethernet cov khoom zoo li ua ntej, ob npaug nyem rau "Internet raws tu qauv Txheej Txheem 4" xaiv hauv qab "Networking" tab thiab xaiv qhov kev xaiv "Tau txais IP chaw nyob cia"
  3. Tam sim no, rov qab mus rau qhov chaw teeb tsa, hais txog ob qho kev sib txuas (WiFi thiab Ethernet), nyem rau sab xis thiab xaiv qhov kev xaiv "Txuas Txuas Txuas"
  4. Koj yuav tsum pom qhov txuas tshiab, hu ua Network Choj, tshwm sim.
  5. Qhib qhov hais kom ua tam sim ntawd thiab khiav ipconfig. Txav mus rau qhov nkag npe hu ua Ethernet adapter Network Choj thiab sau cia tus IP chaw nyob
  6. Txij li, hauv kuv qhov xwm txheej, IP tau muab rau Network Choj yog 192.168.1.101, tus IP muab rau Pi yuav tsum nyob hauv thaj tsam 192.168.1.2 txog 192.168.1.254 (192.168.1.1 yog lub qhov rooj tsis raug thiab 192.168.1.255 yog chaw nyob tshaj tawm). Tam sim no, siv tus IP scanner txhawm rau tshawb nrhiav txhua tus neeg siv khoom nyob hauv thaj tsam IP no thiab nrhiav tus IP muab rau Pi.
  7. Xwb, koj tuaj yeem sim muab tus IP zoo li qub rau koj Pi.

Txoj Kev 3 (Ubuntu hauv VM)

Xav txog qhov no, koj tau txais Ubuntu teeb tsa hauv VM khiav ntawm lub Windows host thiab koj xav tau nkag mus rau koj Pi ntawm Ubuntu piv txwv li koj yuav tsum xub xam tawm ib txoj hauv kev los qhia koj li Ubuntu kev sib txuas hauv is taws nem (uas tsis muaj dab tsi tab sis kev sib txuas hauv qab txuas ntawm koj tus tswv txhais lus muab rau koj cov qhua nkag mus rau lwm lub network; cia peb tsis nkag mus rau hauv cov ntsiab lus) nrog koj Pi. Qhov no tuaj yeem muaj teeb meem nyob rau qee lub sijhawm. Txawm li cas los xij, Kuv tsis ntev los no tau hla qhov kev daws teeb meem yooj yim tiag tiag - Network Txhim Kho.

Txoj Kev 4 (Ubuntu/Windows)

Xwb, yog tias koj tsis muaj qhov chaw nres nkoj Ethernet pub dawb, koj tuaj yeem txuas ncaj qha rau koj Pi rau lub network ntawm koj lub tsev Router lossis Ethernet Hloov.

  1. Fais fab koj Pi thiab txuas nws rau koj lub network ntawm Ethernet chaw nres nkoj ntawm kev nkag tau yooj yim/router, txuas nrog koj lub network hauv tsev, siv Ethernet cable.
  2. Koj yuav tsum pom PWR thiab ACT LEDs ntsais muag cuam tshuam tias Raspbian duab tau raug khau raj. Tom qab ntawd koj yuav tsum pom lub ntsuab "LNK" LED thiab "10M" txiv kab ntxwv LED teeb nyob ze ntawm Ethernet chaw nres nkoj ntawm koj Pi cuam tshuam tias IP chaw nyob tau muab rau nws los ntawm koj tus router DHCP.
  3. Tam sim no, txhawm rau txheeb xyuas tus IP no yooj yim mus ntsib koj tus router nplooj ntawv los ntawm kev nkag mus rau router tus IP chaw nyob (192.168.1.1 rau iBall) hauv koj tus browser. Nkag mus thiab txheeb xyuas DHCP cov npe cov neeg siv rau IP uas tau muab rau koj Pi (Saib rau qhov nkag uas teev "Raspberry Pi Foundation", tej zaum nyob ib sab ntawm nws MAC chaw nyob). Yog tias qhov no tsis ua haujlwm sim siv IP Scanner xws li nmap.

Kauj Ruam 3: Nkag mus rau LX Terminal

Nkag mus rau LX Terminal
Nkag mus rau LX Terminal
Nkag mus rau LX Terminal
Nkag mus rau LX Terminal
Nkag mus rau LX Terminal
Nkag mus rau LX Terminal

Nqa lub plhaub yog ib qho yooj yim thaum peb muaj peb tus IP tus IP. Peb yuav siv SSH txhawm rau nkag mus rau peb tus Pi thiab nkag mus rau LX-Terminal. Ua li ntawd, Cov neeg siv Windows yuav tsum teeb tsa Putty, siv tau yooj yim SSH tus thov kev pab.

  1. Thaum teeb tsa, khiav Putty, teeb tsa hom kev txuas mus rau SSH thiab tus nqi chaw nres nkoj rau 22, nkag mus rau koj tus IP tus IP thiab ntaus Qhib.
  2. Xaiv "Yog", yog nug tias koj puas ntseeg tus tswv tsev no thiab koj yuav pom LX-Terminal hais kom koj nkag mus cov ntsiab lus.
  3. Mus tom ntej thiab sau "pi" raws li lub npe siv thiab "raspberry" rau tus password (tus password yuav tsis pom thaum koj ntaus nws, yog li tsis txhob poob siab)
  4. Ping google.com txhawm rau txheeb xyuas yog tias internet siv tau, thiab voila!

Linux cov neeg siv muaj lub luag haujlwm ua-hauv.

  1. Qhib lub davhlau ya nyob twg thiab khiav cov lus txib ssh [email protected] (x.x.x.x yog koj tus IP tus IP) lossis sim ssh [email protected]
  2. Ntaus hauv "yog", yog nug tias koj puas ntseeg tus tswv tsev no, ntaus rov qab thiab ntaus koj tus Pi lo lus zais (tus lej zais: "raspberry")
  3. Ping google txhawm rau txheeb xyuas yog tias internet ua haujlwm, thiab voila!

Ntxiv: Plhaub Nkag mus hla Kev Sib Txuas

Yog tias koj qhov chaw nres nkoj Ethernet tsis khoom, koj tuaj yeem siv koj lub Laptop USB chaw nres nkoj los tsim kev sib txuas nrog koj li Pi. Txhawm rau ua li ntawd, koj yuav xav tau USB rau TTL cov xov tooj txuas lossis USB rau Serial ntaus ntawv xws li FTDI FT232 cov hauv paus tawg pawg thawj coj.

Txij li Windows tsis suav nrog Daim Ntawv Thov Terminal uas yuav tso cai rau peb txuas mus txuas ntxiv, peb yuav siv Putty. Peb tseem yuav xav tau teeb tsa FTDI Tsav Tsheb.

  1. Khiav cov xov hlau los ntawm TTL lub taub hau mus rau tus pin sib xws ntawm lub nti. Nco ntsoov tias cov pins raug xa mus kom raug raws li qhia hauv kab lus.
  2. Txuas lwm qhov kawg ntawm TTL cable mus rau USB chaw nres nkoj ntawm koj lub PC. Qhib Tus Thawj Tswj Ntaus Ntawv thiab saib hauv qab "Ports (COM & LPT)" txhawm rau txheeb xyuas tus lej COM muab rau koj Pi.
  3. Khiav Putty, teeb tsa hom kev txuas mus rau Serial, nkag mus rau tus lej COM uas tau muab, teeb tsa nrawm rau 115200 thiab ntaus Qhib.
  4. Xaiv "Yog", yog nug tias koj puas ntseeg tus tswv tsev no thiab koj yuav pom LX-Terminal hais kom koj nkag mus cov ntsiab lus.
  5. Mus tom ntej thiab sau "pi" raws li lub npe siv thiab "raspberry" rau tus password

Linux cov neeg siv yuav xav tau teeb tsa Screen.

  1. Txhawm rau txheeb xyuas yog tias koj twb tau txais lub vijtsam teeb tsa ntawm koj lub tshuab Linux, tsuas yog qhib Terminal hom tshuaj ntsuam thiab ntaus rov qab. Koj yuav tsum tau txais qhov ua yuam kev, khiav qhov hais kom ua sudo apt-get install screen rau nruab Screen.
  2. Tom ntej no, teeb tsa FTDI Tsav Tsheb thiab koj zoo mus. Khiav cov xov hlau los ntawm TTL lub taub hau mus rau tus pin sib xws ntawm lub nti. Nco ntsoov tias cov pins raug xa mus kom raug raws li qhia hauv kab lus.
  3. Txuas lwm qhov kawg ntawm TTL cable mus rau USB chaw nres nkoj ntawm koj lub PC. Qhib lub davhlau ya nyob twg thiab khiav qhov hais kom ua sudo screen /dev /ttyUSB0 115200 thiab ntaus rov qab.
  4. Ntaus hauv "yog", yog nug tias koj puas ntseeg tus tswv tsev no, ntaus rov qab thiab ntaus koj tus Pi lub npe siv thiab tus lej zais (lub npe siv tsis raug: "pi" tus password tsis raug: "raspberry")

Zoo, peb tau nkag mus rau lub plhaub, tab sis dab tsi txog internet?! Txij li thaum peb tsis tau siv Ethernet cable txuas rau peb Pi, tsis muaj txoj hauv kev uas peb tuaj yeem faib kev sib txuas is taws nem nrog nws. Txawm li cas los xij, peb tuaj yeem siv USB WiFi Dongle (Pi 3 muaj WiFi built-in) nrog peb Pi txuas rau WiFi thiab nkag mus rau internet.

Kauj ruam 4: Nkag mus rau LXDE Desktop

Nkag mus rau LXDE Desktop
Nkag mus rau LXDE Desktop
Nkag mus rau LXDE Desktop
Nkag mus rau LXDE Desktop
Nkag mus rau LXDE Desktop
Nkag mus rau LXDE Desktop

Tam sim no peb tau nkag mus rau Plhaub, cia peb mus tom ntej thiab tau txais peb txhais tes ntawm Raspbian's Desktop GUI ib puag ncig, hu ua LXDE. Peb tuaj yeem nkag mus rau LXDE desktop hla HDMI los ntawm kev ntaus "startx" hauv kab lus kab lus qhov rai. Txawm li cas los xij, qhov no yuav tsis ua haujlwm dhau SSH. Hmoov zoo, peb tseem tuaj yeem nkag mus rau LXDE Desktop ntawm VNC.

Qhov rai

  1. Pib los ntawm kev txhim kho VNC server ntawm Pi. Ntaus sudo apt-tau nruab tightvncserver hauv SSH plhaub
  2. Pib lub server rau ntawm koj Pi los ntawm kev hais kom ua vncserver: 1 (pib vnc server ntawm zaub 1). Tam sim no koj yuav raug ceeb toom kom nkag mus rau 8 tus cim tus lej uas yuav siv txhua lub sijhawm koj nkag mus rau koj tus Pi nyob deb (tus password yuav tsis pom thaum koj ntaus nws, yog li tsis txhob poob siab). Yog tias tau hais kom nkag mus nyeem ib tus lej nkaus xwb nias “n” thiab rov qab los.
  3. Tom ntej no, teeb tsa VNC tus neeg siv khoom ntawm koj lub laptop zoo li koj ib txwm nruab lwm lwm software.
  4. Khiav tus neeg siv khoom, xaiv "Kev Sib Txuas Tshiab" hauv qab "Cov ntaub ntawv" ntawv qhia zaub mov, nkag mus rau koj tus IP tus IP (192.168.1.108: 1, hauv kuv qhov xwm txheej), muab lub npe rau kev sib txuas (hais tias, Raspberry Pi) thiab nyem rau "Txuag".
  5. Ob npaug nyem rau ntawm qhov nyem rau ntawm qhov kev sib txuas nyuam qhuav tsim, nyem rau "Txuas", nkag mus rau tus password uas tau teeb tsa yav dhau los thaum hais kom ua, thiab nyob ntawd koj mus, LXDE Desktop!

Ubuntu

  1. Pib los ntawm kev txhim kho VNC server ntawm Pi. Ntaus sudo apt-tau nruab tightvncserver hauv SSH plhaub
  2. Pib lub server rau ntawm koj Pi los ntawm kev hais kom ua vncserver: 1 (pib vnc server ntawm zaub 1). Tam sim no koj yuav tau txais kev nkag mus rau tus lej 8 tus lej cim uas yuav siv txhua lub sijhawm koj nkag mus rau koj Pi nyob deb. Yog tias tau hais kom nkag mus nyeem ib tus lej nkaus xwb nias “n” thiab rov qab los.
  3. Tom ntej no, teeb tsa VNC tus neeg siv khoom ntawm koj lub laptop. Qhib lub davhlau ya nyob twg tshiab thiab khiav sudo apt-tau nruab xtightvncviewer
  4. Thaum qhov kev teeb tsa tiav, khiav cov neeg siv khoom siv xtightvncviewer hais kom ua
  5. Qhov no yuav tsum nqa lub thawv ntawv me me. Ntaus koj tus IP tus IP thiab tso tawm tus lej (192.168.1.109: 1, hauv kuv qhov xwm txheej), ntaus rov qab thiab koj yuav tau txais kev ceeb toom kom nkag mus rau lo lus zais teeb tsa yav dhau los. Ntaus tus password, ntaus rov qab dua thiab muaj koj mus, LXDE Desktop!

Pom zoo: