Cov txheej txheem:
- Kauj Ruam 1: Kauj Ruam 1: Teeb Kho Vajtse
- Kauj Ruam 2: Kauj Ruam 2: Txhim Kho thiab Ua Ntej Ua Ntej Ua Ntej
- Kauj Ruam 3: Kauj Ruam 3: Chaw Ua Haujlwm Ruaj Ntseg - Sau
- Kauj Ruam 4: Kauj Ruam 4: Kev Kawm Paub
Video: Ntse Chaw Haujlwm Ruaj Ntseg: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Hauv txoj haujlwm no, peb lub hom phiaj kawm paub yuav siv AWS thiab MQTT rau hauv peb li kev teeb tsa IoT li cas.
Nrog kev hem thawj ntawm kev tawm tsam sab hauv, daim ntawv thov no tsom mus rau saib xyuas lub chaw haujlwm ntawm cov neeg siv muaj cai. Thaum tus neeg siv nyob deb ntawm chaw ua haujlwm, daim ntawv thov no yuav tshuaj xyuas lub chaw haujlwm.
- Nws taug qab ob qhov kub thiab txias qhov tseem ceeb thiab tso tawm nws ntawm daim ntawv thov web
- Nws tso cai rau cov neeg siv qhib thiab tua LED
-
2 hom tswb hom
- Tswb Tswb - Thaum lub tswb qhib, kev ntsuas qhov ntsuas kub thiab av noo yuav nres, thaum lub suab ntsuas yuav qhib. Yog tias muaj kev txav chaw hauv chaw ua haujlwm, lub suab nrov yuav nrov thiab yuav yees duab thiab cov neeg siv tuaj yeem pom dab tsi tau kuaj pom thaum lawv nyob deb ntawm lawv lub chaw haujlwm
- Tswb Tawm - Thaum lub tswb raug kaw, yuav muaj kev tshuaj xyuas qhov kub thiab txias thiab qhov txiaj ntsig yuav tshwm rau ntawm lub vev xaib thov thaum lub suab txav thiab lub koob yees duab yuav raug xiam
- Hauv ob qho tib si, cov neeg siv tseem tuaj yeem tswj lub teeb ci LED.
- Kev siv AWS DynamoDB, peb muaj peev xwm khaws cov duab kab kom cov neeg siv tuaj yeem pom cov duab coj
- Tsis tas li, siv AWS, peb muaj peev xwm xa email rau cov neeg siv thaum muaj cov lus pom thaum lub sijhawm lawv nyob thaum lawv tsis nyob ntawm lawv lub chaw haujlwm.
Tam sim no, cia nrhiav seb peb tswj hwm los siv cov txheej txheem zoo li cas!
Kauj Ruam 1: Kauj Ruam 1: Teeb Kho Vajtse
Koj xav tau dab tsi:
- 2x Raspberry Pi 3
- 2 x T-Cobbler Kit
- 1 x Breadboard
- Assorted Jumper Cables
- Ntau yam Resistors
- 1 x LED
- 1x DHT11 Kub thiab Vaum Sensors
- 1 x PIR Motion Sensor
- 1 x Buzzer
Peb teeb tsa muaj LED txuas nrog GPIO 18 kom tus neeg siv tuaj yeem tswj lub teeb pom kev zoo hauv lawv lub chaw haujlwm. Txog kev sau cia ntawm qhov kub thiab txias, peb yuav siv DHT sensor txuas nrog GPIO4. Ua raws los ntawm peb PIR Tsab Ntawv Pom Zoo Sensor txuas nrog GPIO 26 txhawm rau txheeb xyuas cov neeg nkag mus hauv chav haujlwm thaum tus neeg siv tsis nyob. Thaum kawg, lub tswb nrov kom nrov lub tswb thaum lub tswb qhib thiab pom qee yam.
Kauj Ruam 2: Kauj Ruam 2: Txhim Kho thiab Ua Ntej Ua Ntej Ua Ntej
AWS
Thawj zaug nkag mus rau
1. Tom qab nkag mus, nyem rau ntawm phau ntawv teev npe ntawm sab laug pane thiab tom qab ntawd nyem rau ntawm AWS Kawm Qhia Pib Nyiaj Txiag 75
2. Luam qhov Access Key ID thiab Secret Access Key rau kev teeb tsa hauv raspberry pi tom qab.
3. Nyem rau ntawm Open Console
Sau npe rau koj raspberry pi ua ib yam
1. Search AWS IOT
2. Nyem rau ntawm Manage ntawm sab laug pane thiab tom qab ntawd nyem rau Yam
3. Nyem tsim ntawm kaum sab xis
4. Select Sau npe ib qho AWS IOT yam
5. Txhua koj lub npe thiab nyem tom ntej
6. Nyem tsim daim ntawv pov thawj thiab txuag 4 yam khoom tsim tawm
7. Activate lub hauv paus CA
8. Tsim txoj cai thiab muab nws tso rau hauv koj li khoom
-Muab nws lub npe -Action: iot.* -Resource ARN:* -Check qhov tso cai Dynamodb
Ua ntej txhua yam, khiav aws teeb tsa Siv Tus ID nkag mus thiab tus yuam sij nkag tau yooj yim los ntawm ua ntej
Tom ntej no, 1. Tsim cov ntaub ntawv npe iot-role-trust.json nrog cov hauv qab no
iot-role-trust.json
2. Khiav cov lus txib hauv qab no: aws iam create-role --role-name my-iot-role --assume-role-policy-document file: //iot-role-trust.json
3. Tsim cov ntaub ntawv npe iot-policy.json nrog cov hauv qab no
iot-policy.jason
4. Run the command: aws iam put-role-policy --role-name my-iot-role --policy-name iot-policy --policy-document file: //iot-policy.json
DynamoDB
1. Create ntxhuav hauv Dynamodb rau cov lus tsa suab sensor thiab kub/av noo -For cov lus tsa suab teeb thawj qhov tseem ceeb rau sensor -For kub thiab av noo siv timestamp ua tus yuam sij tseem ceeb
2. Kev tsim txoj cai rau kev nrhiav kom pom
Tus cwj pwm:* lub ntsiab lus lim: ntsuas/txav
3. Action: xaiv cov lus sib faib rau ntau kab ntawm cov database
Lambda
1. Tsim cov haujlwm Lambda nrog cov ntsiab lus hauv qab no
Lambda muaj nuj nqi
2. Tsim txoj cai rau lambda
-Txoj cai:*
-topic lim: sensors/tag nrho
3. Kev xaiv xaiv ua rau Lambda ua haujlwm dhau cov lus
4. Lambda yuav ua tus so rau koj
SNS
1. Tsim lub ncauj lus SNS
2. Nkag mus rau lub ncauj lus thiab tso saib lub npe
3. Kho cov ntsiab lus txoj cai kom tso cai rau txhua tus tshaj tawm thiab sau npe ua cov ncauj lus
4. Sau npe yuav cov ncauj lus nrog email
5. Rov qab mus rau txoj cai tshawb nrhiav qhov txav
6. Ntxiv lwm qhov kev txiav txim rau txoj cai no hu ua amessage raws li SNS thawb ceeb toom
7. SNS lub hom phiaj yuav yog lub ntsiab lus uas koj tau tsim cov ntawv xov xwm RAW
S3
1. Mus rau S3 thiab tsim lub thoob rau upload cov duab
Yam tseem ceeb rau nruab rau ntawm Pis
Flask - sudo pip install flask
Boto - sudo pip nruab boto
Boto3 - sudo pip nruab boto3
AWSIoTPythonSDK - sudo pip nruab AWSIoTPythonSDK
awscli - sudo pip nruab awscli
paho - sudo pip nruab paho
mqtt - sudo pip nruab mqtt
Kauj Ruam 3: Kauj Ruam 3: Chaw Ua Haujlwm Ruaj Ntseg - Sau
Hauv tus neeg siv pi, peb muaj 1 tsab ntawv
client.py - Tsab ntawv no yuav sau npe mus rau ntau yam ncauj lus xws li lub ntsuas/ntsuas kub thiab lub ntsuas cua/av noo kom tau txais qhov ntsuas kub thiab av noo uas yuav tshwm rau ntawm daim ntawv thov web. Nws kuj tseem xa cov xwm txheej ntawm LED kom cov xwm txheej LED tuaj yeem hloov pauv ntawm sab server
neeg.py
Hauv server pi, peb muaj 1 tsab ntawv
server.py - Tsab ntawv no yuav sau npe rau lub teeb pom kev zoo lub npe kom lub teeb LED tuaj yeem qhib thiab tua tau. Nyob rau tib lub sijhawm, nws yuav tau txais qhov ntsuas kub thiab av noo los ntawm daim ntawv qhia zaub mov thiab tshaj tawm nws mus rau lub ncauj lus hu ua sensors/tag nrho thiab hauv lambda ua haujlwm qhov txiaj ntsig yuav raug tshaj tawm rau 2 lub ncauj lus sib txawv, ntsuas/ntsuas kub thiab ntsuas/ntsuas av noo
neeg rau zaub mov.py
Kauj Ruam 4: Kauj Ruam 4: Kev Kawm Paub
Hauv txoj haujlwm no, peb tau ntsib ntau yam kev cov nyom vim tias tus qauv no tseem tshiab rau peb. Txawm li cas los xij, los ntawm txoj haujlwm no, peb tau kawm ntau yam. Ua nws yog IOT ntawm AWS, peb txaus siab hais tias peb paub yuav ua li cas koom ua ke AWS rau hauv peb cov khoom siv IoT tseem ceeb thiab ua rau nws muaj ntau qhov ua ntej.
Pom zoo:
ESP8266 - Lub Sijhawm thiab Chaw Taws Teeb Tswj (Cov Neeg Ruaj Ntseg Ruaj Ntseg): 6 Cov Kauj Ruam
ESP8266 - Lub Sij Hawm thiab Cov Chaw Taws Teeb Tswj (Cov Neeg Ruaj Ntseg Ruaj Ntseg): Cov ntaub ntawv: Lub rooj sib tham no yog kev tshuaj xyuas kom tsis txhob muaj cua sov, hluav taws kub thiab raug xwm txheej thaum tsis nco qab siv cov khoom siv (feem ntau yog cov neeg laus nrog Alzheimer's). Tom qab khawm tau pib, lub qhov (socket) tau txais 110/220 VAC rau 5 feeb (lwm qhov
DIY Cheep/Cov Dej Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Zoo rau Tsiaj: 7 Kauj Ruam
DIY Cheep/Cov Dej Rhaub Dej Zoo rau Cov Tsiaj Tsiaj: Yog li koj tab tom khaws aub/luav/miv/… sab nraum thiab lawv cov dej ua kom khov thaum lub caij ntuj no. Tam sim no ib txwm koj yuav coj lawv mus sab hauv lossis yuav cov tais diav ua kom sov, tab sis cov tsiaj no tej zaum muaj ntxhiab tsw, koj tsis muaj chav nyob, thiab koj tsis tuaj yeem them $ 4
Tsho Ruaj Ntseg Ruaj Ntseg: Kev Ruaj Ntseg Ris Tsho LED Tsho: 11 Cov Kauj Ruam (nrog Duab)
Ris tsho Ruaj Ntseg Ruaj Ntseg: Kev Ruaj Ntseg Zoo LED Jacket: Txhim kho lub teeb yuag thiab siv tau cov khoom siv hluav taws xob tau qhib qhov muaj peev xwm tshiab rau kev siv thev naus laus zis mus rau hauv lub tebchaws thiab siv nws los ua kom muaj kev nyab xeeb ntawm cov neeg tshawb nrhiav. Txog rau qhov haujlwm no, Kuv kos kuv tus kheej kev paub nrog kev tawm sab nraud
DIY Raug Ruaj Ruaj Ruaj Ruaj Roj Teeb: 9 Kauj Ruam
DIY Raug Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ruaj Ris Ruaj Ris Ris Ris Los Ntawm Raug Raug Raug Raug Raug Raug Raug Raug Raug Raug Raug Rho Tawm Tsis Pom Dua DIY: Pom Fence cov tsiaj tiv thaiv lub tshuab xav tau lub roj teeb tshiab ntawm tus aub lub dab tshos txhua 3 lub hlis. Cov tswv lag luam uas pom tsis tau muag cov roj teeb pob rau ib puag ncig $ 15. Lub roj teeb kim no yog rooj plaub yas nyob ib puag ncig ib puag ncig CR1/3 lithium cell, npaj tau
$ 10 Tej thaj chaw deb Ruaj Ntseg Hauv Tsev Ruaj Ntseg: 7 Kauj Ruam
$ 10 Kev Ruaj Ntseg Hauv Tsev Ruaj Ntseg Ruaj Ntseg: Hloov qhov webcam pheej yig pheej yig mus rau hauv qhov system ruaj ntseg hauv tsev uas pom tau nyob txhua qhov chaw hauv ntiaj teb los ntawm koj lub xov tooj ntawm tes! Kuv vam tias koj nyiam qhov no thiab yog tias koj xav tau qhov kev xav zoo dua ntawm txoj haujlwm koj tuaj yeem saib kuv cov vis dis aus