Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Kev thaiv kab
- Kauj Ruam 2: Vaj Tsev
- Kauj ruam 3: Database
- Kauj ruam 4: Teeb
- Kauj ruam 5: Code
Video: SmartHome Nrog Raspberry Pi: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Txog qhov haujlwm no kuv tau ua SmartHome uas tuaj yeem ua haujlwm los ntawm lub vev xaib thiab mobile. Txog qhov no kuv siv Raspberry PI ua tus database thiab webserver.
Khoom siv
Yog tias koj xav pib qhov no, koj xav tau ntau yam:
- 5 dawb leds (5mm)
- 1 ib lub xov tooj cua kub sensor
- 1 LDR (lub teeb nyob ntawm tus tiv thaiv)
- 2 servo tsav
- 1 microSD (rau Raspberry Pi)
- 1 Breadboard powersupply
- 1 Raspberry Pi 3 Qauv B+
- 3 Ua npuas ncauj daim hlau
- 1 Stepper lub cev muaj zog (5V)
- 1 nyeem ntawv RFID-RC522
- 8 tus tiv thaiv (220 Ohm)
- 1 tus tiv thaiv (10K Ohm)
- 2 Cov qhob cij
- 2 pob ntawm jumperwires
- 1 16x2 LCD zaub
- 1 PCF8574 UA
- 4 lub qhov rais me me (luam tawm 3D)
- 1 lub qhov rooj (luam tawm 3D)
- 2 lub qhov rais loj (luam tawm 3D)
- 1 lub qhov rooj tsheb (luam tawm 3D)
Yog tias koj xav tau txhua yam no los yuav, tus nqi siab tshaj yuav nyob ib puag ncig € 150
Kauj ruam 1: Kev thaiv kab
Txoj hauv kev yooj yim tshaj plaws yog pib nrog xaim kom koj twb muaj cov hauv paus, nrog rau txoj hauv kev no koj tuaj yeem tshawb xyuas tau yooj yim yog tias txhua yam ua haujlwm thaum koj sau cov cai.
Ntawm txoj kev no, koj tuaj yeem pom yog tias koj muaj tus pin txaus ntawm Raspberry Pi txhawm rau txuas txhua yam. Hauv qhov no kuv siv PCF8574AN los tswj kuv lub LCD nrog tsawg dua GPIO pins.
Txhawm rau kos cov phiaj xwm kuv siv Fritzing. Nws yog txoj haujlwm yooj yim uas koj tuaj yeem saib koj cov cabling hauv txoj hauv kev zoo.
Raws li koj tuaj yeem pom ntawm daim duab thib ob muaj ntau cov kab xev yog li koj tseem yuav tsum tau ua haujlwm nyob rau hauv ib txoj kev.
Kauj Ruam 2: Vaj Tsev
Rau vaj tsev kuv siv cov laug cam ua phab ntsa. Kuv siv rab riam los txiav cov laug cam raws li qhov xav tau. Lub qhov rais, qhov rooj thiab qhov rooj rau tsheb yog 3D luam tawm. Tau kawg kuv kos lub tsev ua ntej yog li kuv paub tias qhov ntev kuv yuav tsum tau siv.
Kuv siv SketchUp los kos lub tsev. Kuv siv rab phom nplaum kom cov phab ntsa ncaj thiab tuav lawv ua ke, Yog tias koj tuaj yeem pom ntawm cov duab, lub qhov rai thiab lub qhov rooj qhov rooj tau txuas nrog kua nplaum nws thiaj li yuav muaj zog txaus. ntawm daim duab 3 yog lub npov uas kuv tau siv thauj kom txhua yam nyob twj ywm
Kauj ruam 3: Database
Ua ntej tshaj plaws, koj yuav tsum tsim cov ntaub ntawv siv Mysql Workbench. Yog tias qhov no ua tiav, koj yuav tsum teeb tsa Mysql database ntawm Raspberry Pi.
Thawj qhov khoom siv uas koj siv yog tshuaj xyuas yog tias koj Pi tau hloov kho tshiab. Koj tuaj yeem siv cov lus txib hauv qab no:
sudo apt-tau hloov tshiab
thiab
sudo apt-tau hloov tshiab
Tam sim no koj tuaj yeem teeb tsa Mysql server:
sudo apt-tau nruab mysql-server
Yog tias Mysql server tau teeb tsa, Nruab Mysql tus thov kev pabcuam
sudo apt-tau nruab mysql-client
Yog tias koj tam sim no saib ntawm sql server los ntawm cov lus txib:
sudo siv mysql
Tam sim no koj tuaj yeem ntshuam koj cov lej chaws los ntawm kev qhib.mwb cov ntaub ntawv nrog sql workbench thiab xa mus rau engineer. Koj luam cov cai thiab muab tso rau hauv mysql los ntawm Raspberry. Cov database yog ua.
Txhawm rau tus neeg siv kom tau txais txhua qhov kev tso cai, tsuas yog ntxiv koj lub npe siv hauv lub rooj
muab txhua txoj cai ntawm smarthome.* rau 'yourname'@'%' txheeb xyuas los ntawm 'yourname';
ofcourse koj yuav tsum tau kho lub rooj tam sim no
NTSEEG NTAWV QHOV TSEEB;
Txhawm rau txheeb xyuas qhov no koj tuaj yeem sim:
siv smarthome;
xaiv * los ntawm keeb kwm keeb kwm;
Hauv cov neeg siv lub npe cov npe ntawm cov neeg siv los ua ke nrog lawv daim paib, ntawm no koj tuaj yeem ntxiv cov neeg siv tshiab. Hauv cov khoom siv lub rooj koj tuaj yeem pom txhua lub ntsuas hluav taws xob nquag nrog lawv tus lej. Qhov keeb kwm keeb kwm cov lus qhia txhua yam uas tau tshwm sim zoo li lub ntsuas kub, cim npe nrog xwm txheej ntawm lub qhov rooj qhov rooj thiab ntau dua.
Kauj ruam 4: Teeb
Txhawm rau teeb tsa cov duab ntawm Raspberry Pi koj tuaj yeem siv Putty, qhov no yog qhov haujlwm pub dawb. Koj tuaj yeem nrhiav cov ntaub ntawv hauv paus ntawm no:
Kev cuam tshuam
Tau kawg koj yuav tsum tau pab qee qhov cuam tshuam ntawm Pi. Ua ntej mus rau nplooj ntawv teeb tsa.
sudo raspi-teeb tsa
Tam sim no koj tuaj yeem mus rau pawg 1-Hlau thiab Spi thiab ob leeg pab lawv. Koj yuav xav tau cov no rau qhov ntsuas kub.
Wifi
Ua raws cov theem tom ntej kom tau txais wifi ntawm Pi.
Thawj zaug nkag mus hauv paus
sudo-kuv
Tom qab ntawd sau lub npe thiab tus password ntawm koj lub network wifi
wpa_passphrase = "wifiname" "password" >> /etc/wpa_supplicant/wpa_supplicant.conf
Tom qab ntawd nkag mus rau tus neeg siv WPA
wpa_cli
xaiv lub interface
wb wl0
Tam sim no reload tus config
rov tsim dua tshiab
Thiab tam sim no koj tuaj yeem tshawb xyuas yog tias koj tau txuas nrog
ip aw
Pob
Thawj qhov uas yuav tsum tau ua yog hloov kho cov kho tshiab kawg
sudo apt hloov tshiab
Rau nab nab peb nruab thiab xyuas kom tseeb tias Pi tau xaiv qhov tseeb version
hloov tshiab-lwm -install/usr/bin/nab hab sej nab hab sej /usr/bin/python2.7 1 hloov kho-lwm txoj kev-nruab/usr/bin/nab hab sej nab nab/usr/bin/python3 2
Txhawm rau lub vev xaib kom khiav lub Vev Xaib ntawm, peb yuav tsum teeb tsa Apache2
sudo apt nruab apache2 -y
Qee cov pob sej yuav tsum tau teeb tsa ib yam
- Lub hwj
- Flask-Cors
- Flask-MySQL
- Flask-SocketIO
- PyMySQL
- Python-socketIO
- thov
- pib
- gpio ib
- Gevent
- Gevent-websocket
yog tias muaj teeb meem nrog pob uas tsis pom, tsuas yog nyem rau nws thiab cia nws nruab.
Kauj ruam 5: Code
backend
Rau tus backend, peb sau cov cai hauv nab nab thiab siv pycharm los sau rau hauv. Txoj hauv kev los ntawm lub backend tuaj yeem tshawb xyuas nrog tus xa ntawv. Nrog rau daim ntawv thov no koj tuaj yeem siv POST thiab GET txoj hauv kev. Hauv lub backend kuv siv kev nyeem ntau yam yog li txhua yam tau khiav hauv keeb kwm yav dhau thiab tuaj yeem ua haujlwm ua ke. Txhawm rau teeb duab ntawm Raspberry Pi koj tuaj yeem siv Putty, qhov no yog qhov haujlwm pub dawb.
sab xub ntiag
Ntawm lub ntsej muag muaj ob peb lub nyees khawm uas tuaj yeem qhib teeb, qhib qhov chaw nres tsheb thiab lub qhov rooj. Los ntawm kev siv javascript thiab CSS cov style los ntawm cov nyees khawm hloov thaum lawv nquag. Kuj tseem muaj qhov ntsuas kub nyob thiab daim ntawv qhia nrog qhov ntsuas kub dhau los. Ntawm tus neeg siv nplooj ntawv koj tuaj yeem pom ntau tus neeg siv, koj tseem tuaj yeem ntxiv tus neeg siv rau hauv lub hauv paus thiab muaj cov neeg siv keeb kwm uas koj tuaj yeem pom leej twg qhib lossis kaw lub qhov rooj qhov rooj thaum kawg.
Koj tuaj yeem pom cov cai rau lub ntsej muag thiab backend ntawm
github.com/NMCT-S2-Project-1/nmct-s2-proje…
Pom zoo:
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
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
PCB Tsim Nrog Cov Kauj Ruam Yooj Yim thiab Yooj Yim: 30 Kauj Ruam (nrog Duab)
PCB Tsim Nrog Cov Kauj Ruam Yooj Yim thiab Yooj Yim: HELLO PHOOJ YWG Nws muaj txiaj ntsig zoo thiab qhia tau yooj yim rau cov uas xav kawm PCB tsim los cia pib
Yuav Ua Li Cas Ua Ntej Screen Video Nrog Plaub Kauj Ruam: 4 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Thiaj Ua Ntej Video Nrog Plaub Kauj Ruam: Peb feem ntau pom tib tus neeg ua yeeb yam hauv qhov xwm txheej ob zaug hauv TV ua si. Thiab raws li peb paub, tus ua yeeb yam tsis muaj tus kwv ntxaib. Peb kuj tau saib tias ob daim vis dis aus hu nkauj tso rau ntawm ib qho screen los sib piv lawv cov txuj ci hu nkauj. Nov yog lub zog ntawm spl
Tsheb kauj vab taug qab System nrog Tuag Tus Txiv Neej Alert Nrog Sigfox: 7 Cov Kauj Ruam (nrog Duab)
Tsheb kauj vab taug qab System Nrog Tuag Tus Txiv Neej Alert Nrog Sigfox: Kev ruaj ntseg rau cov neeg caij tsheb kauj vab nrog taug qab thiab xa cov yam ntxwv ceeb toom. Thaum muaj xwm txheej ceeb toom raug xa nrog GPS txoj haujlwm.Kev ruaj ntseg rau cov neeg caij tsheb kauj vab yog qhov yuav tsum tau, nrog kev tsheb kauj vab lossis tsheb kauj vab roob sib tsoo tshwm sim thiab sai li sai tau thaum muaj xwm txheej ceev