Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Teeb RPI
- Kauj ruam 2: Database
- Kauj Ruam 3: Kev thaiv kab hlau
- Kauj Ruam 4: Vaj Tsev
- Kauj ruam 5: Coding
Video: Ntse Chaw Nres Tsheb Siv Raspberry Pi: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hauv cov lus qhia no peb yuav tsim qhov chaw nres tsheb tsis siv neeg txuas nrog lub web interface. Koj yuav tuaj yeem pom qhov chaw raug coj mus, txiav txim siab leej twg nkag mus thiab leej twg tawm mus thiab nws tau nruab nrog lub tshuab teeb pom kev zoo tsis siv neeg.
Khoom siv
Kho vajtse
- 2 x Ultrasonic sensors
- 1x servo lub cev muaj zog
- 4x LEDs dawb
- 1x Lub teeb nyob ntawm tus tiv thaiv
- 1x 2*16 LCD Zaub
Xam
- 1x Raspberry Pi 3 B+
- 1x SD daim npav (8-16GB qhov kev xaiv yog koj li)
- 1x Adafruit I2S 3W Class D Amplifier Breakout - MAX98357A
- 1 x MCP3008
- 1x Resistor 2.2K Ohm
- 9x Resistors 1K Ohm
Ntau yam
- Jumper xov hlau
- Cov qhob cij
- UTP-kab
- Adapter rau koj raspberry pi
- Ib daim ntawv ntawm multiplex (koj tuaj yeem siv yam khoom twg koj xav tau rau lub casing)
- Phom phom
Software
- PuTTY
- Software kho cov cai (koj tuaj yeem siv txhua yam koj xav tau tsuav nws txhawb nqa: Python, HTML, CSS thiab java tsab ntawv
- Win32 Disk Imager
- Raspbian OS duab
- VNC Viewer (yeem)
Kauj ruam 1: Teeb RPI
Ua ntej peb pib nrog txuas cov cuab yeej kho vajtse, sau
software thiab ua lub casing peb yuav xav teeb tsa koj li PI nrog cov software tsim nyog koj yuav xav tau los ua qhov haujlwm.
Koj yuav xav tau daim duab ntawm Raspbian tso rau hauv koj daim npav SD thiab sau nws mus rau SD daim npav Win32 Disk Imager. Koj tuaj yeem pom cov ntawv txuas rau ob qho hauv qab no.
- Win32 Disk Imager:
- Raspbian duab:
Kev teeb tsa
-
Qhib Win32 Disk Imager
- Xaiv cov duab koj nyuam qhuav rub tawm los ntawm daim nplaub tshev icon
- Xaiv koj daim npav SD ntawm qhov nco cia
- Nyem rau sau
- Thaum cov txheej txheem ua tiav koj lub khoos phis tawj yuav zaum nug koj yog tias koj xav ua hom SD daim ntawv tsis txhob ua qhov no
Thaum koj ua tiav nrog cov theem no koj yuav tsum tau ua qee yam ntxiv yog li koj tuaj yeem nkag mus rau software ntawm koj li PI.
- Qhib daim npav SD hauv koj tus neeg tshawb nrhiav
- Qhib cov ntawv "cmdline.txt"
- Koj yuav pom kab ntawv ntev ntawm qhov kawg ntxiv: ip = 169.254.10.1
- Txuag cov ntawv
- Tsim cov ntaub ntawv npe ssh uas tsis muaj kev txuas ntxiv (yog tias koj tsis paub yuav ua li cas tsuas yog nyem rau ntawm cov ntawv tshiab, xaiv cov ntawv tshiab tshem tawm qhov txuas ntxiv thiab npe nws ssh)
- Kauj ruam kawg ntawm ntu no yog tshem tawm daim npav SD kom nyab xeeb thiab muab tso rau hauv Raspberry PI
Txuas
Thaum koj ua tiav cov kauj ruam dhau los nws yog lub sijhawm los txuas rau koj tus pi thawj zaug. Ua ntej koj yuav tsum tau ntsaws rau hauv koj lub UTP cable, ib kawg hauv koj lub khoos phis tawj lwm qhov hauv koj tus pi (nws yog qhov tseem ceeb uas koj ntsaws rau hauv LAN cable ua ntej koj ntsaws nws).
- Nruab Putty:
- Thaum koj tau teeb tsa nws qhib nws thiab nkag mus rau 169.254.10.1 hauv IP box
- Xaiv SSH thiab sau rau hauv chaw nres nkoj 22
- Nyem qhib
- Sau rau hauv lub npe siv: pi thiab tus password raspberry qhov no yog tus txheej txheem nkag mus rau ntawm cov duab tshiab
Raspi-teeb tsa
Ua ntej peb txav mus rau koj yuav tsum hloov pauv ob peb qhov teeb meem hauv cov ntawv qhia zaub mov raspi-config qhib nws los ntawm kev siv:
sudo raspi-teeb tsa
1. Pab kom I2C thiab SPI nyob rau hauv kev xaiv nws pawg cuam tshuam
2. Xaiv koj li WIFI coutry ntawm qeb kev faib chaw
3. Teem lub Desktop/CLI teeb tsa hauv cov khau raj xaiv qeb rau Desktop Autologin.
4. Hauv qab cov kev xaiv Advanced xaiv A1 nthuav tawm cov ntaub ntawv system (qhov no ua kom ntseeg tau tias koj siv qhov chaw ntawm tag nrho SD daim npav
5. Tam sim no tawm thiab sudo reboot
Wifi
Tam sim no nws yog lub sijhawm los teeb tsa koj li kev sib txuas wifi tawm ntawm chav kawm koj yuav xav tau daim ntawv pov thawj ntawm koj li wifi.
Ua ntej nkag mus rau hauv paus hom los ntawm kev ua cov lus txib no
Sudo -ib
Tam sim no koj muaj txoj cai tsim nyog los ua cov lus txib no:
Nco ntsoov hloov SSID rau koj lub npe wifi thiab PASSWORD rau koj tus password wifi
Wpa_passphrase “SSID” “PASSWORD” >> /etc/wpa_supplicant/wpa_supplicant.conf
Nkag mus rau WPA Client los ntawm kev ua cov lus txib no:
wpa_cli
Xaiv lub interface
Kev sib txuas wlan0
Reload tus config
Rov kho dua
Kawg tab sis tsis tsawg kawg yog tias nws ua haujlwm. Koj tuaj yeem ua qhov no los ntawm kev nkag mus:
Ip ib
Ntawm no koj tuaj yeem tshawb xyuas yog tias koj muaj tus IP nyob hauv WLAN0 cuam tshuam yog tias tsis sudo reboot (yeej tsis ua tiav (:).
Yog tias koj tsis xis nyob ua nws los ntawm kab hais kom ua koj ib txwm tuaj yeem ua nws ntawm GUI ntawm Raspbian uas yog tus neeg siv tau zoo dua me ntsis.
- Nruab VNC-viewer ntawm no:
- Nyem cov ntaub ntawv, kev sib txuas tshiab thiab nkag mus rau IP-chaw nyob bar: 169.254.10.1 thiab xaiv lub npe twg los xij koj xav tau
- Sau rau hauv lub npe siv: pi thiab tus password raspberry
- Nyem rau lub cim wifi thiab txuas qhov ntawd
Pob
Tam sim no peb tau txuas nrog internet peb tuaj yeem teeb tsa pob khoom peb xav tau los ua txhua txoj cai.
Ua ntej peb yuav xav tau hloov kho cov npe pob rau qhov tshiab los ntawm kev khiav:
sudo apt hloov tshiab
sudo apt hloov tshiab
Apache Webserver
Peb yuav xav tau tus webserver los khiav peb daim ntawv thov web. Peb tuaj yeem ua tiav qhov no los ntawm kev txhim kho apache webserver los ntawm kev ua cov lus txib no:
sudo apt nruab apach2 -y
Nab hab sej pob
Txhawm rau ua txhua yam haujlwm peb yuav xav tau ob peb pob. Cov no yog cov uas peb yuav xav tau.
- Lub hwj
- Flask-Cors
- Flask-Extension
- Flask-MySQL
- Flask-SocketIO
- Nab hab sej
Koj tuaj yeem nruab lawv los ntawm kev ua cov lus txib no:
pip nruab Flask Flask-Cors Flask-Extension Flask-MySQL Flask-SocketIO python-socketio
Kauj ruam 2: Database
MariaDB
Khiav cov lus txib hauv qab no txhawm rau teeb tsa MariaDB qhov no yog lub hauv paus database xav tau txhawm rau taug qab txhua cov ntaub ntawv uas lub ntsuas tau nyeem hauv.
sudo apt nruab mariadb-server
Tam sim no peb yuav xav tau kev nyab xeeb rau peb kev teeb tsa
Mysql_secure_installation
Thaum koj khiav cov lus txib nws yuav nug peb rau tus lej nkag hauv paus peb tseem tsis muaj ib qho yog li tsuas yog nias nkag mus.
Tam sim no nws yuav nug koj yog tias koj xav tau ib qho rau qhov laj thawj kev nyab xeeb peb xav tau ib qho yog li nias Y ntawm koj cov keyboard thiab xaiv tus lej twg koj xav tau.
Tam sim no nws tseem yuav nug koj ob peb lo lus nug ntxiv tsuas yog teb Y rau txhua tus ntawm lawv
Zoo tam sim no uas peb tau ua tiav rau qhov no peb yuav tsum tau mus rau hauv SQL plhaub.
Txhawm rau ua qhov no peb thawj zaug yuav tsum dhau los ua lub hauv paus dua los tso cai rau peb muaj txoj cai los ua qhov no los ntawm kev nkag mus rau cov lus txib no ntxiv:
sudo -i ua
Tam sim no nkag mus rau mysql plhaub
mysql ua
Tam sim no peb tab tom tsim tus neeg siv tso lub npe koj xav tau ntawm cov lus hais ua ntej @ thiab tus lej koj xav tau tom qab txheeb xyuas los ntawm
Tam sim no peb yuav tsum yaug cov lus tso cai los ntawm kev ua cov lus txib no:
NTSEEG NTAWV QHOV TSEEB;
Tom qab koj ua tiav cov theem no koj tuaj yeem rov tsim cov phiaj xwm db los ntawm daim duab saum toj no. Hmoov tsis zoo Kuv tsis tuaj yeem muab koj pov tseg ntawm cov ntaub ntawv vim kuv tab tom ntsib qee qhov software tsis raug.
Kauj Ruam 3: Kev thaiv kab hlau
Tam sim no nws yog lub sijhawm los ua txoj hlua ntawm txoj haujlwm. Txhawm rau ua kom cov txheej txheem yooj yim me ntsis los ntawm thawj zaug ua cov phiaj xwm hauv qhov program hu ua fritzing. Fritzing ua rau nws yog li nws yooj yim dua los tsim koj cov xov hluav taws xob hauv lub neej tiag tiag thiab koj tau txais daim duab meej ntawm yam koj tab tom ua.
Kauj Ruam 4: Vaj Tsev
Thawj kauj ruam yog txiav ntoo hauv cov duab zoo li pom hauv daim duab. Kuv tau ua nws ntawm lasercutting tab sis pom ib txwm yuav ua haujlwm ib yam nkaus. Tom qab ntawd koj yuav xav pleev xim ntoo dub kom tau xim asphalt. Thaum cov xim tau qhuav lawm koj tuaj yeem pleev xim kab txaij dawb kom tau txais qhov chaw nres tsheb ntawd. Rau lub laj kab kuv tsuag cov xim pleev xim kom zoo li tus ncej. Rau qhov laj kab nws tus kheej Kuv tau hla qee qhov goas mus rau tus ncej. Qhov teeb meem yog ua los ntawm paer maché uas kuv tau pleev xim rau tom qab.
Kauj ruam 5: Coding
Backend: Lub backend ntawm txoj haujlwm tau sau hauv Python thiab TSQL. Nws nyeem tag nrho cov ntaub ntawv ntawm lub ntsuas cua thiab sau nws mus rau lub hauv paus uas peb tau tsim ua ntej me ntsis. Nws kuj tseem siv lub vev xaib kom peb tuaj yeem txuas peb lub ntsej muag rau nws. Kuv tau sau cov cai xav tau rau sab nraub qaum hauv pycharm tab sis sab nrauv koj tuaj yeem siv txhua yam koj xav tau.
Koj tuaj yeem pom cov cai rau tus backend ntawm no:
Frontend: Tus frontend tau sau ua HTML, CSS thiab Javascript. Kuv siv kev sib xyaw ua ke ntawm qhov muag pom duab chaws thiab phpstorm los sau cov cai. Txoj cai pib sau tag nrho lub vev xaib thiab hauv javascript cov ntaub ntawv koj tuaj yeem pom cov cai xav tau kom tau txais cov ntaub ntawv los ntawm cov backend.
Koj tuaj yeem pom cov cai rau lub ntsej muag ntawm no:
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
IoT Raws Qhov Chaw Nres Tsheb Ntse Siv NodeMCU ESP8266: 5 Cov Kauj Ruam
IoT Raws Li Qhov Chaw Nres Tsheb Siv NodeMCU ESP8266: Tam sim no nrhiav chaw nres tsheb hauv thaj chaw tsis khoom yog nyuaj heev thiab tsis muaj kab ke kom tau txais cov ntsiab lus ntawm qhov chaw nres tsheb muaj nyob online. Xav txog yog tias koj tuaj yeem tau txais cov ntaub ntawv qhia chaw nres tsheb ntawm koj lub xov tooj thiab koj tsis muaj kev ncig mus ncig xyuas
Chaw Nres Tsheb Huab Cua DIY & WiFi Chaw Nres Tsheb Sensor: 7 Kauj Ruam (nrog Duab)
Chaw Tshawb Xyuas Huab Cua DIY & WiFi Chaw Nres Nkoj: Hauv qhov haujlwm no kuv yuav qhia koj yuav tsim lub chaw nres tsheb huab cua nrog rau qhov chaw nres tsheb WiFi sensor. Lub chaw nres tsheb ntsuas ntsuas cov ntaub ntawv kub thiab av noo hauv cheeb tsam thiab xa nws, los ntawm WiFi, mus rau chaw nres tsheb huab cua. Cov chaw nres tsheb huab cua tom qab ntawd qhia t
FinduCar: Lub Ntsej Muag Tsheb Ntsuas Qhia Cov Neeg rau Qhov Chaw Lub Tsheb Nres Tsheb: 11 Cov Kauj Ruam (nrog Duab)
FinduCar: Ntse Lub Ntsiab Tseem Ceeb Qhia Tib Neeg rau Qhov Chaw Tsheb Nres Tsheb: Txhawm rau daws cov teeb meem saum toj no, txoj haujlwm no tawm tswv yim txhawm rau txhim kho tus yuam sij tsheb ntse uas tuaj yeem coj tib neeg mus rau qhov chaw lawv nres tsheb. Thiab kuv txoj kev npaj koom nrog GPS rau hauv lub tsheb tseem ceeb. Tsis tas yuav siv lub smartphone app los taug qab
Ua Lub Sijhawm Tawm Ntawm Lub Tsheb Nres Nres Nres Disc: 7 Kauj Ruam
Ua Lub Sijhawm Tawm Ntawm Lub Tsheb Nres Nres Nres: Nov yog qhov koj tuaj yeem ua nrog txhua qhov qub/qub tsheb kauj vab nres uas koj tau dag ib puag ncig! ntsia liaj qhov rooj thiab 2 txiv ntoo kom haum lawv (xaiv tau)- brasso- daim txhuam cev hauv chav ua noj + phuam