Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Xav Tau
- Kauj ruam 2: Google Assistant
- Kauj Ruam 3: Txiav Hlau
- Kauj Ruam 4: Txuas twj rau Relay
- Kauj Ruam 5: Txuas Cov Khoom Siv Hluav Taws Xob rau Kev Tshaj Tawm
- Kauj Ruam 6: Txuas Raspberry Pi rau Relay
- Kauj Ruam 7: Ruaj Ntseg Lub Twj Tso Kua Mis
- Kauj Ruam 8: Coj Dej
- Kauj Ruam 9: Muab Txhua Yam Ua Ke
- Kauj Ruam 10: Kuaj Cov Khoom Ua Haujlwm
- Kauj ruam 11: Ntshuam Flask
- Kauj Ruam 12: Tsim Daim Ntawv Teev Npe rau Peb Txoj Haujlwm thiab Mus Rau Hauv Nws
- Kauj Ruam 13: Coding Web Server
- Kauj Ruam 14: Xeem Txoj Cai Ua Haujlwm
- Kauj ruam 15: Tunneling
- Kauj Ruam 16: Txhim Kho Ngrok
- Kauj Ruam 17: Xeem Ngrok
- Kauj Ruam 18: IFFF
- Kauj ruam 19: Ua tiav
- Kauj Ruam 20: Kev sib tw IOT
Video: Ok Google Tsob Ntoo Dej/rab phom dej: 20 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Nov yog txoj haujlwm lom zem uas siv Google Tsev lossis ib lub xov tooj nrog Google tus pab rau nws kom tsuag dej rau ntawm ib tus neeg lossis ywg dej rau qee cov nroj tsuag. Nws kuj tseem muaj peev xwm thov tau ntau yam rau lwm yam siv xws li teeb, cua sov, kiv cua thiab lwm yam. Yog tias koj nyiam qhov no thov pov npav rau cov haujlwm no hauv IOT kev sib tw. Ua tsaug.
Kauj Ruam 1: Cov Khoom Xav Tau
Koj yuav xav tau cov hauv qab no:
- Raspberry pi (txhua tus qauv uas tau nkag mus rau internet)
- Lub twj tso kua dej 12v (Nov yog qhov kuv tau siv)
- Lub hwj chim 12v (Siv qhov no lossis ib qho dag ib ncig)
- A 5v 2 channel relay (Nov yog hom uas kuv tau siv)
- Qee tus poj niam rau poj niam jumper coj
- Lub thawv yas tuav dej
- Qee txoj hauv kev kom cov dej tawm ntawm lub twj tso kua mis (Kuv khoov lub raj yas tab sis koj tuaj yeem siv cov quav quav)
Peb tau siv cov khoom xa rov qab raws li nws tso cai rau ua rau nws nyob deb nrog lub raspberry pi ntau dua li yuav tsum muaj lub cev nyob ntawd kom qhib nws raws li koj xav tau yog tias nws tsuas yog hloov pauv.
Kauj ruam 2: Google Assistant
Nco ntsoov tias koj muaj qee txoj hauv kev nkag mus rau Google tus pab. Koj tuaj yeem siv google tsev lossis xov tooj.
Kauj Ruam 3: Txiav Hlau
Siv cov xaim hluav taws xob los txiav thiab tom qab ntawd hle qhov xaus ntawm koj qhov 12v cov khoom siv thiab lub twj tso kua mis kom lawv tuaj yeem txuas rau qhov txuas. Nco ntsoov hle lub tsho kom txaus kom muaj kev sib txuas ruaj khov.
Kauj Ruam 4: Txuas twj rau Relay
- Ntsia lub davhlau ya nyob twg nruab nrab ntawm ob qho txuas
- Ntxig cov xov hlau los ntawm lub twj tso kua dej
- Ntsia dua
Kauj Ruam 5: Txuas Cov Khoom Siv Hluav Taws Xob rau Kev Tshaj Tawm
- Tshem tawm cov dav hlau
- Muab cov xov hlau los ntawm lub hwj chim 12v tso rau hauv
- Ntsia lawv rov qab rau hauv qhov chaw
Kauj Ruam 6: Txuas Raspberry Pi rau Relay
Txuas raspberry pi mus txuas ntxiv raws li qhia hauv daim duab saum toj no. Koj yuav tsum tau txuas tus xa mus rau hauv av, 5v, thiab 2 GPIO pins.
Kauj Ruam 7: Ruaj Ntseg Lub Twj Tso Kua Mis
Siv ob qho tib si blu-tack lossis kab xev kaw kom ruaj ntseg lub twj tso kua mis rau hauv lub khob yas.
Kauj Ruam 8: Coj Dej
Yog tias koj xav kom dej txhawm rau ib tus neeg hauv lub ntsej muag nws yuav tsum tau qhia. Txhawm rau ua qhov no kuv siv rab phom cua sov los kho lub raj yas rau hauv cov duab uas pom saum toj no. Tom qab ntawd kuv tau kaw lub cwj mem rau saum. Ib qho ntxiv, koj tuaj yeem siv cov quav nyab.
Yog tias koj xav tau dej qee cov nroj tsuag koj tuaj yeem ntxiv raj yas lossis sab hauv ntawm tus cwj mem.
Kauj Ruam 9: Muab Txhua Yam Ua Ke
Kuv tau ntxiv lwm lub thawv yas thiab muab cov raspberry pi thiab tso rau hauv kom nws tsis txhob ntub.
Kuv tau suav nrog daim duab qhia hluav taws xob saum toj no txhawm rau ua kom pom kev me me.
Kauj Ruam 10: Kuaj Cov Khoom Ua Haujlwm
Txhawm rau ntsuas lub twj tso kua mis ua haujlwm khiav cov cai hauv qab no ntawm raspberry pi. Qhov no yuav tsum tig lub twj tso kua mis tawm thiab tom qab ntawd (lossis lwm txoj hauv kev puag ncig).
los ntawm gpiozero ntshuam LED
lub sijhawm ntshuam #this yuav xa cov qauv cuam tshuam uas peb xav tau rau cov cai no
relay = LED (14)
relay2 = LED (15) #muab lub relays ib LED
thaum Muaj Tseeb:
relay.on () #yog koj twv nws… tig lub relay ntawm relay.off () #yog koj twv nws… tig lub relay tawm lub sijhawm.sleep (1) #tsaug zog rau 1 thib ob relay.on () #relay ntawm relay.off () #relay so time.sleep (1) #tsaug zog
Kauj ruam 11: Ntshuam Flask
Txoj hauv kev yooj yim tshaj plaws rau tus pabcuam google los tswj cov raspberry pi yog los ntawm kev tau txais nws los tuav lub vev xaib. Peb tuaj yeem tau txais Google mus ntsib nplooj ntawv ntawm tus neeg rau zaub mov ntawd thaum twg koj hais qee yam thiab sau tus lej raspberry los qhib thiab xa tawm thaum tus neeg rau zaub mov tuaj xyuas. Yog tias koj xav tau kev qhia ntxaws ntxaws ntxiv ntawm cov hwj tom qab ntawd: mus ntsib qhov kev qhia no los ntawm raspberry pi.
Ntawm koj tus raspberry pi ntshuam lub hwj chim module ntawm nab hab sej.
- Xyuas kom koj tau txuas nrog internet
- Qhib lub davhlau ya nyob twg
- Hom hauv:
sudo pip3 nruab flask
Yog tias qhov no tsis ua haujlwm:
- Xyuas kom koj tau txuas nrog internet
- Saib ntawm phau ntawv qhia no
Kauj Ruam 12: Tsim Daim Ntawv Teev Npe rau Peb Txoj Haujlwm thiab Mus Rau Hauv Nws
Ua qhov no los ntawm qhib lub davhlau ya nyob twg thiab ntaus hauv:
mkdir webapp cov
cd wb web
Kauj Ruam 13: Coding Web Server
- Qhib tsis ua haujlwm 3
- File> Tsim tshiab
- Txuag nws hauv lub vev xaib app nplaub tshev uas koj nyuam qhuav tsim
- Ntxig cov cai no
los ntawm cov raj ntshuam Flaskfrom gpiozero ntshuam LED lub sijhawm ntshuam #cov no tau xa cov qauv yuav tsum tau ua rau txoj haujlwm no xa tawm = LED (14) relay2 = LED (15) #muab lub relays LED app = Flask (_ name_) #muab Flask hloov pauv lub npe kom thiaj li nws yooj yim dua los ua haujlwm nrog nws tom qab ntawm @app.route ('/', cov hau kev = ['GET']) #ua kom tau txais ntawm nplooj ntawv web "" "qhov haujlwm no yuav rov ua dab tsi uas tau tshwm rau ntawm nplooj ntawv tseem ceeb "" "def index (): rov qab 'Nplooj ntawv tseem ceeb' @app.route ('/on') #turning ntawm kev xa tawm los ntawm kev ua haujlwm hauv qab no" "" tig rau lub relays thiab luam ntawv hi los xyuas qhov ua haujlwm tau zoo " "" def rau (): print ("hi") relay.on () relay2.off () rov qab 'ntawm' @app.route ('/off') #kaw qhov kev xa tawm los ntawm kev ua haujlwm hauv qab no "" "tig tawm ntawm qhov txuas thiab luam ntawv hi los xyuas qhov ua haujlwm tau ua haujlwm raug "" "def off (): print (" nyob zoo ") relay.off () relay2.on () rov qab 'tawm' @app.route ('/mus') #running lub luag haujlwm mus "" "txoj haujlwm no tig rau ntawm qhov txuas kom nws txau dej" "" def go (): relay.on () r elay2.off () time.sleep (3) relay.off () relay2.on () rov qab ('mus') "" "nkag mus rau nplooj ntawv web los ntawm qhov chaw cuam tshuam (8000 feem ntau yog tsev) thiab host" "" yog _name_ == '_main_': app.run (debug = True, port = 8000, host = '0.0.0.0')
Cov lus piav qhia dab tsi tshwm sim hauv txoj cai
Kauj Ruam 14: Xeem Txoj Cai Ua Haujlwm
Qhib koj lub vev xaib thiab nkag mus rau URL
Koj yuav tsum pom lub vijtsam dawb tab sis koj yuav tsum tuaj yeem hnov qhov nyem ntawm qhov txuas mus lossis yog lub twj tso kua mis ntsaws, nws yuav tsum mus.
Txhawm rau tig lub twj tso tawm mus rau
Nco tseg: 127.0.0.1 txhais tau tias "tsev", piv txwv li lub khoos phis tawj no: 5000 txhais tau tias 'chaw nres nkoj 5000', uas yog chaw nres nkoj lub vev xaib ua haujlwm. Yog tias qhov no ua haujlwm ces koj tuaj yeem coj nws mus ntxiv los ntawm:
1. Tshawb nrhiav koj tus raspberry pis tus IP chaw nyob los ntawm kev ntaus hauv:
hostname -Ib
2. Ntawm txhua lub khoos phis tawj txuas nrog tib lub wifi zoo li koj tus pi mus ntsib tus pisipadress/on
Qhov no yuav tsum qhib lub relay.
Qhov no qhia tau tias koj tuaj yeem tswj hwm koj li raspberry pi los ntawm ib lub computer txuas nrog tib lub wifi zoo li koj li raspberry pi.
Kauj ruam 15: Tunneling
Yog li Google Lub Tsev tuaj yeem mus ntsib lub vev xaib no koj yuav xav tsim lub qhov kom cov khoos phis tawj uas tsis txuas nrog tib tus IP chaw nyob zoo li koj tseem tuaj yeem kaw qhov txuas thiab qhib. Koj tuaj yeem ua qhov no nrog ngrok. Nov yog qhov program uas koj tuaj yeem teeb tsa ntawm raspberry pi uas yuav tso cai rau koj mus ntsib lub vas sab lub vev xaib los ntawm ib lub computer.
Mus ntsib lawv lub vev xaib kom paub ntau ntxiv:
Kauj Ruam 16: Txhim Kho Ngrok
Nkag mus rau qhov txuas no ntawm koj tus raspberry pi: https://ngrok.com/download thiab ua raws cov lus qhia txhawm rau rub tawm thiab teeb tsa ngrok.
Kauj Ruam 17: Xeem Ngrok
Xyuas kom tseeb tias koj lub flask server ua haujlwm. Qhib lwm lub davhlau ya nyob twg thiab ntaus hauv cd webapp
Tom qab ntawd pib ngrok los ntawm kev ntaus hauv
./ngrok http 5000
Qhov no yuav tsum qhia koj qhov URL uas koj yuav tsum muaj peev xwm mus rau ntawm ib lub cuab yeej. Luam qhov no thiab xa email rau koj tus kheej rau qib tom ntej
Yog tias qhov no tsis ua haujlwm:
- Xyuas kom lub raj mis khiav
- Nco ntsoov tias koj tab tom khiav ngrok hauv tib lub nplaub tshev zoo li lub program flask
- Nco ntsoov tias koj tau theej qhov txuas raug (nws hloov pauv txhua lub sijhawm koj rov pib qhov haujlwm)
Kauj Ruam 18: IFFF
IFFF: Yog Qhov No Yog Li No yog qhov program pub dawb uas tuaj yeem siv los ua koj lub tsev hauv google mus ntsib lub vev xaib thaum hais ib yam dab tsi rau nws, Txhawm rau teeb tsa qhov no ua raws cov theem hauv qab no:
- Tog twg los mus ntsib https://ifttt.com/ lossis rub tawm lub app
- Tsim ib tus account
- Nyem tsim tshiab applet (qee zaum hauv qab kuv cov applets)
- Nyem qhov no
- Tshawb Google thiab xaiv Google Assistant
- Nyem hais cov kab lus yooj yim
- Hauv qab qhov koj xav hais kom muab "qhib dej rab phom"
- Nyem tsim txhais
- Nyem qhov ntawd
- Tshawb nrhiav lub vev xaib
- Nyem webnooks
- Nyem Ua qhov web thov
- Hauv qab URL nkag mus rau qhov URL ngrok muab rau koj ua ntej/mus
- Hauv Txoj Cai Xaiv GET
- Hauv Cov Ntsiab Lus xaiv cov ntawv/dawb
- Nyem Tsim
- Nyem tag
Kauj ruam 19: Ua tiav
Tam sim no thaum koj hais nyob zoo google (ntxig cov kab lus koj tau xaiv), lub twj tso kua mis yuav tsum qhib.
Yog tias qhov no tsis ua haujlwm (nws coj kuv txog 15 sim kom nws ua haujlwm):
- Nco ntsoov tias txhua qhov program tau ua haujlwm
- Xyuas kom txhua tus Leads txuas nrog
- Nco ntsoov qhov URL koj nkag mus rau IFTT yog qhov tshiab tshaj plaws
- Nco ntsoov tias raspberry pi txuas nrog internet
Kauj Ruam 20: Kev sib tw IOT
Yog tias koj nyiam qhov kev qhia no thov thov pov npav rau peb hauv kev sib tw IOT. Ua tsaug ntau
Pom zoo:
Teeb Tsob Ntoo Bonsai Tsob Ntoo: 3 Kauj Ruam
Teeb Tsob Ntoo Bonsai Tsob Ntoo: Lwm tsob ntoo xaim! Zoo, Kuv yuav tsis nkim koj lub sijhawm yuav ua li cas kom tsob ntoo, raws li muaj ntau qhov qhia tau zoo heev nyob rau ntawd. Kuv tau txais kev tshoov siab los ntawm Txiaj Ntsig Zoo Tshaj rau kev tsim tsob ntoo, thiab suziechuzie rau kuv lub tswv yim txuas xov. Hauv qhov no
Lub Vev Xaib-Tsob Ntoo Christmas Tsob Ntoo (Ib Tus Neeg Tuaj Yeem Tau Nws): 19 Cov Kauj Ruam (nrog Duab)
Lub Vev Xaib-Tsob Ntoo Christmas Tsob Ntoo (Ib Tus Neeg Tuaj Yeem Tau Nws): Koj xav paub lub vev xaib tswj hwm tsob ntoo Christmas zoo li cas? Nov yog daim vis dis aus qhia tawm kuv qhov project ntawm kuv tsob ntoo Christmas. Tam sim no cov kwj tawm tau xaus los txog tam sim no, tab sis kuv tau ua yeeb yaj kiab, ntes dab tsi tau tshwm sim: Xyoo no, nyob nruab nrab ntawm Lub Ob Hlis
Tsis Siv Neeg Tsob Ntoo Dej Dej Siv Micro: ntsis: 8 Kauj Ruam (nrog Duab)
Tsis Siv Neeg Tsob Ntoo Dej Dej Siv Micro: me ntsis: Hauv Cov Lus Qhia no, Kuv tab tom yuav qhia koj yuav ua li cas txhawm rau tsim lub tshuab cog dej tsis siv neeg siv Micro: me ntsis thiab qee qhov lwm yam khoom siv hluav taws xob me me.Micro: ntsis siv lub ntsuas dej noo los saib xyuas cov dej noo nyob hauv cov av cov av thiab
Tsim kom muaj DIY Tus Kheej Dej Dej Nrog WiFi - Dej Tsob Ntoo Tuaj thiab Xa Kev Ceeb Toom Thaum Dej Tsawg: 19 Kauj Ruam
Ua DIY Tus Kheej Tus Kheej Dej Nrog WiFi - Dej Tsob Ntoo Tuaj thiab Xa Kev Ceeb Toom Thaum Dej Tsis Tshua: Cov ntawv qhia no qhia koj yuav tsim kho li cas Wi -nkaus txuas nrog tus kheej cog cog dej siv lub qub vaj cog, cov thoob khib nyiab, qee cov nplaum thiab tus kheej Watering Pot Subassembly Kit los ntawm Adosia
Yuav Ua Li Cas Siv Qhov Tsob Ntoo Tsob Ntoo Los Ua Ke Los Ua Ib Tug Ntoo Zoo Nkauj thiab Muaj Zog Ntoo: 10 Kauj Ruam
Yuav Siv Li Cas Ib Ntus Ntoo Los Ua Ke Los Ua Ib Tug Ntoo Zoo Nkauj thiab Muaj Zog: Lub npe ntawm caj npab neeg hlau yog WoodenArm. Nws zoo nkaus li ntxim hlub heev! Yog tias koj xav paub ntau ntxiv txog WoodenArm, thov xa mus rau www.lewansoul.com Tam sim no peb tuaj yeem qhia txog WoodenArm, cia peb txav mus