Cov txheej txheem:
- Kauj ruam 1: Pib
- Kauj Ruam 2: Teeb Koj Cov Khoos Phis Tawj
- Kauj Ruam 3: Kho Koj Li Pi
- Kauj ruam 4: Nruab Ansible
- Kauj ruam 5: Nrog koj zoo siab
Video: Raspberry Pi 3 "Bramble": 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Kev xa tawm Apache2 webserver hla hla qhov ua tau Raspberry Pi3 Qauv B "sib tw" ntawm HAProxy load balancer!
Kuv ua ntau qhov kev txhim kho lub vev xaib thiab tau nyeem ntau txog kev teeb tsa geo-redundancies thiab thauj khoom sib npaug, yog li kuv xav tias nws yog lub sijhawm kuv tau txhaj tshuaj ntawm kev teeb tsa nws txhua tus. Kuv tau muaj qhov tsis txaus siab uas muaj tus neeg rau zaub mov poob thiab xav tiv thaiv qhov ntawd los ntawm qhov tshwm sim dua yav tom ntej!
Ntxiv rau, nws tsuas zoo li txias.
Kauj ruam 1: Pib
** Hloov tshiab **
**************************************************************************************************************************
Kuv yeej ua qhov Qhia no yooj yim dua. Kuv refactored repo ntawm Github kom tau txais kev teeb tsa, teeb tsa thiab teeb tsa HAProxy loadbalancer ntawm koj tus Pi xaiv! Tsawg tus lej, hloov kho tsawg dua, muaj feem tsawg dua rau kev ua yuam kev thiab muaj feem ntau rau kev lom zem!
**************************************************************************************************************************
Lub taub hau mus rau https://www.raspberrypi.org/downloads/raspbian/ thiab rub daim ntawv tshiab ntawm Raspbian Stretch Lite.
Luam cov ntaub ntawv. ZIP thiab sau.img rau txhua daim npav MicroSD rau txhua Pi hauv koj pawg. OSX cov neeg siv, cov cuab yeej zoo rau qhov no yog
Tom qab koj etch lub.img rau daim npav MicroSD, txav mus rau daim npav hauv Finder tshiab lossis File Explorer qhov rai - qhov no yuav tsum muaj npe khau raj los ntawm lub neej ntawd. Ntawm qhov ntawd, tsim daim ntawv tshiab hu ua SSH. Nco ntsoov tias koj tsis tso dab tsi rau cov ntawv txuas ntxiv. Qhov no yuav ua rau SSH ntawm koj Rpi3. Tshem daim npav thiab muab tso rau hauv koj tus Pi. Rov ua cov kauj ruam no rau 2 Pi ntxiv (lossis txawm li cas los xij koj feem ntau siv).
Kauj Ruam 2: Teeb Koj Cov Khoos Phis Tawj
Qhov piv txwv no kwv yees 3 node Rpi pawg, thiab cov npe khoom siv hauv qab no:
-
5 chaw nres nkoj Ethernet Hloov x 1
https://www.amazon.ca/gp/product/B00QR6XFHQ/ref=oh…
-
5 chaw nres nkoj USB Lub Hwj Chim Adapter x 1 **
https://www.amazon.ca/gp/product/B017R9IJTU/ref=oh…
-
Ethernet Cables x 4
https://www.amazon.ca/gp/product/B01J8KFTB2/ref=oh…
-
USB 2. rau Micro USB B Fais Cables x 3
https://www.amazon.ca/gp/product/B019U0V75W/ref=oh…
-
Raspberry Pi3 Qauv B x 3
https://www.amazon.ca/gp/product/B01CD5VC92/ref=od…
-
Cov cua sov x 6
https://www.amazon.ca/gp/product/B010ER7UN8/ref=od_aui_detailpages00?ie=UTF8&psc=1
* Nws yog qhov tseem ceeb uas koj siv USB Lub Hwj Chim Adapter uas muaj peev xwm muab Raspberry Pi nrog lawv qhov tsawg kawg nkaus xav tau kev khiav haujlwm
- Txuas x1 Ethernet Cable los ntawm koj lub router mus rau Ethernet Hloov.
- Txuas x1 Ethernet Cable los ntawm koj Ethernet Hloov mus rau txhua tus ntawm koj tus Pi
- Txuas x1 USB-rau-MicroUSB los ntawm txhua tus ntawm koj Pi mus rau USB Lub Hwj Chim Adapter.
- Plug nws txhua qhov thiab saib lub teeb ntsais muag
Thaum tsis tsim nyog, tab sis kuv xav kom bramble saib kom txias li sai tau thiab ua txhua yam kom me ntsis zoo dua. Kuv txiav txim siab khaws 3 ntawm cov teeb meem no los ntawm Amazon. Kuv tsis suav nrog nws hauv cov lus qhia no vim nws _technically_ tsis xav tau, tab sis rau cov ntsiab lus zoo nkauj Kuv xav kom khaws qee yam.
www.amazon.ca/gp/product/B07BNDFXN9/ref=oh…
** Cov Ntsiab Lus Ntxiv **
Kuv xaiv mus rau cov ntsiab lus nerd ntxiv thiab xav tau qhov pom tau zoo dua ntawm cov neeg rau zaub mov twg kuv tau cuam tshuam nrog. Kuv tau muaj qee qhov kev tiv thaiv tiv thaiv ib puag ncig thiab ib pawg ntawm LED's thiab cov tiv thaiv, yog li kuv tau nrawm nrawm ua ke qee cov laug cam kom tso hla tus pi's GPIO pins. Qhov zoo tshaj plaws, Kuv yuav tau siv qee tus poj niam lub taub hau, tab sis kuv tsuas yog txiv neej yog li kuv xav tau txiav qee cov xov hlau txuas.
Yog tias koj xav mus rau txoj kev ntawd ib yam (vim tias LED yog qhov txaus), koj yuav xav ua raws cov lus qhia no ntawm:
thepihut.com/blogs/raspberry-pi-tutorials/…
Kauj Ruam 3: Kho Koj Li Pi
Koj yuav tsum paub tus IP chaw nyob ntawm txhua tus Pi's ntawm koj lub network. Yog tias koj yog CLI ninja, qhov no yuav tsum yooj yim-peasy. Rau txhua tus neeg, koj tuaj yeem siv IP Scanner dawb, xws li SuperScan (OSX). Sau tus IP chaw nyob.
Tom ntej no, luam koj tus lej SSH pej xeem rau txhua tus ntawm koj Pi los ntawm kev siv cov lus txib hauv qab no los ntawm koj lub davhlau ya nyob twg:
ssh-daim ntawv-id
Piv txwv::
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
Tsis muaj tus yuam sij SSH? Tsis muaj teeb meem! Cia li khiav:
ssh-keygen cov
hauv koj lub davhlau ya nyob twg thiab ua raws li cov lus qhia. Peb nyob ze!
Kauj ruam 4: Nruab Ansible
Yog tias koj tau ua tiav qhov no, nrog koj zoo siab! Koj tsuas yog ob peb feeb deb ntawm kev khiav koj tus kheej lub network faib faib.
Ntawm koj lub khoos phis tawj / laptop, koj yuav xav nruab Ansible los ntawm kab hais kom ua. Rau Mac cov neeg siv, nws yog:
sudo pip nruab ua tau
Rau txhua tus neeg ntxiv, xa mus rau https://docs.ansible.com/ansible/latest/installat… rau koj OS.
Tam sim no, koj yuav xav clone qhov repo no rau hauv daim nplaub tshev lossis rub tawm. ZIP thiab rho tawm nws mus rau hauv daim nplaub tshev ntawm koj lub tshuab hauv zos.
github.com/Jtilley84/ansible-apache2-webse…
Hauv qhov repo, koj yuav pom cov ntaub ntawv hosts.ini. Qhib nws hauv koj cov ntawv nyeem uas koj nyiam (lossis nano lossis vim):
[loadbalancer]
pi-headnode ansible_host = 192.168.0.228 # <--- Hloov qhov no mus rau tus IP chaw nyob ntawm Pi uas koj xav HAProxy rau.
[ntawm]
node2 ansible_host = 192.168.0.16 # <--- Hloov qhov no mus rau tus IP chaw nyob ntawm koj tus Pi thib ob
node3 ansible_host = 192.168.0.58 # <--- Hloov qhov no mus rau tus IP chaw nyob ntawm koj tus Pi thib peb
Qhov ntawd yog nws! Txhawm rau khiav phau ntawv ua si, mus rau lub hauv paus repo nplaub tshev thiab ntaus cov hauv qab no hauv koj lub davhlau ya nyob twg:
ansible-playbook playbook.yml
Kauj ruam 5: Nrog koj zoo siab
Koj nyuam qhuav ua computer khawv koob tshwm sim. Nrog koj zoo siab!
Qhov no tsuas yog pov thawj ntawm lub tswv yim. Hauv qhov rov ua dua tshiab no, phau ntawv sau thawb qhov cim tshwj xeeb.html cov ntaub ntawv rau txhua tus ntawm cov nodes kom koj tuaj yeem pom qhov debug seb nws puas ua haujlwm lossis tsis ua haujlwm. Rau cov neeg rau zaub mov tsim khoom, koj yuav xav kom pom tseeb hloov phau ntawv ua si kom xa koj lub xaib.
Yog tias koj muaj lus nug lossis lus pom, kuv nyiam hnov lawv! Thov txheeb xyuas Github repo thiab rab rawg tseg! Kuv xav pom dab tsi koj tuaj nrog.
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
"Ready Maker" - Tswj dua "Lego Power Functions" Project: 9 Kauj Ruam
"Ready Maker" - Tswj dua "Lego Power Functions" Project: Kawm paub tswj Lego " Lub zog ua haujlwm " Cheebtsam nrog Arduino pawg thawj coj thiab tsim koj txoj haujlwm hauv " Ready Maker " editor (Tsis xav tau tus lej) txhawm rau tswj koj tus qauv
HC - 06 (Slave Module) Hloov "Npe" Tsis Siv "Saib Serial Arduino" tias "Ua Haujlwm Yooj Yim": Txoj Kev Tsis Txaus!: 3 Cov Kauj Ruam
HC - 06 (Slave Module) Hloov "Npe" Tsis Siv "Saib Serial Arduino" … tias "Ua Haujlwm Yooj Yim": Txoj Kev Tsis Txaus!: Tom qab " Ntev Ntev " sim Hloov Lub Npe mus rau HC - 06 (qhev Module), siv " serial saib ntawm Arduino, tsis muaj " Ua tiav ", Kuv pom lwm txoj hauv kev yooj yim dua thiab koom nrog tam sim no! Muaj kev lom zem phooj ywg