Cov txheej txheem:

Wifi Teeb Hloov Raspberry Pi Web Server: 8 Kauj Ruam (nrog Duab)
Wifi Teeb Hloov Raspberry Pi Web Server: 8 Kauj Ruam (nrog Duab)

Video: Wifi Teeb Hloov Raspberry Pi Web Server: 8 Kauj Ruam (nrog Duab)

Video: Wifi Teeb Hloov Raspberry Pi Web Server: 8 Kauj Ruam (nrog Duab)
Video: ПРИВОЗ. ОДЕССА МАМА. Рецепт САЛО. ОБЗОР НОЖЕЙ 2024, Kaum ib hlis
Anonim
Wifi Teeb Hloov Raspberry Pi Web Server
Wifi Teeb Hloov Raspberry Pi Web Server

Kuv xav tswj lub teeb hloov hauv kuv chav pw yam tsis tau tawm ntawm lub txaj, yog li kuv xav kom tuaj yeem tswj nws los ntawm kuv lub xov tooj. Kuv muaj qee qhov kev txwv ntxiv, Kuv xav kom muaj peev xwm tswj tau nws los ntawm ib qho cuab yeej yooj yim, Kuv xav kom tuaj yeem siv lub teeb pom kev zoo li qub thiab kuv tsis tuaj yeem hloov kho ntau yam kho vajtse raws li kuv xaum chav tsev.

Kuv txiav txim siab siv Raspberry Pi los tswj lub cav servo uas yuav txav mus. Raspberry Pi yuav khiav lub web server uas kuv tuaj yeem nkag tau thaum nyob hauv lub network. Cov kev sib txuas ntawm lub vev xaib ntawm tus neeg rau zaub mov no yuav tso cai rau kuv kom qhib lub qhov hluav taws xob qhib thiab tawm. Los ntawm de-energizing servo ntawm kev hloov pauv kuv kuj tseem tuaj yeem siv lub teeb hluav taws xob li qub.

Kauj ruam 1: Cov ntaub ntawv

Rasperry Pib

Servo Tsav:

smile.amazon.com/gp/product/B0015H2V72/ref…

Hlau Ceev

Jumper Hlau

Kauj Ruam 2: Kauj Ruam 1: Teeb Raspberry Pi

Muaj ntau txoj hauv kev los ua qhov no. Yog tias koj muaj HDMI saib thiab usb keyboard ua ke Kuv xav tias nws yooj yim dua. Txwv tsis pub koj tuaj yeem ua qhov teeb tsa "tsis muaj taub hau".

Nov yog cov lus qhia zoo ntawm kev ua lub taub hau teeb ntawm Windows:

www.circuitbasics.com/raspberry-pi-basics-…

Thiab ib qho rau Mac:

www.circuitbasics.com/raspberry-pi-basics-…

Tab sis qhov yooj yim tshaj plaws yog thauj daim npav SD nrog NOOBS, khau raj pi thaum txuas nrog tus saib xyuas thiab cov keyboard thiab tsuas yog dhau los ntawm kev teeb tsa. Phau ntawv no piav qhia nws zoo heev:

www.circuitbasics.com/raspberry-pi-basics-…

Yog tias koj tsis tau teeb tsa lub taub hau koj tseem yuav tsum tau npaj SSH, nws tsim nyog rau qhov seem no. Txhawm rau ua qhov no kuv siv Putty. Tau nws ntawm no:

www.circuitbasics.com/raspberry-pi-basics-…

Thiab yog tias koj tsis paub koj tus IP chaw nyob tus IP koj tuaj yeem siv IP scanner zoo dua:

Tom qab ntawd tsuas yog nkag mus rau IP chaw nyob rau tus pi hauv kev nkag mus rau Tus Tswv Lub Npe/IP chaw nyob, tawm ntawm qhov chaw nres nkoj ntawm 22 thiab nyem qhib. Koj yuav raug ceeb toom rau tus ID nkag mus.

Kauj Ruam 3: Kauj Ruam 2: Teeb Tus Kheej Lub Vev Xaib

Kauj Ruam 2: Teeb tsa Lub Vev Xaib
Kauj Ruam 2: Teeb tsa Lub Vev Xaib

Txhawm rau khiav lub vev xaib kuv siv Apache. Koj tuaj yeem nruab qhov no siv cov lus txib:

sudo apt-tau nruab apache2

Qhov no yuav tsum yog lub hauv paus muab rau koj nplooj ntawv txaws thaum koj mus rau koj tus pi tus IP chaw nyob. Nws yuav tsum zoo li daim duab hauv qab no.

Kauj Ruam 4: Kauj Ruam 3: Tsim Lub Vev Xaib

Kauj Ruam 3: Tsim Lub Vev Xaib
Kauj Ruam 3: Tsim Lub Vev Xaib
Kauj Ruam 3: Tsim Lub Vev Xaib
Kauj Ruam 3: Tsim Lub Vev Xaib

Koj yuav xav hloov nplooj ntawv tsis zoo nrog koj lub vev xaib uas tuaj yeem tswj hwm lub cav servo. Thawj qhov uas yuav tau hloov yog cov ntawv ntsuas. Koj cov ntaub ntawv ntsuas rau lub vev xaib yuav tsum nyob hauv/var/www/html. Siv koj cov ntawv nyeem nyiam los tsim cov ntawv lossis tsuas yog luam cov ntawv ntawm no siv qee yam xws li winscp. Ntxiv "index.php" hauv qhov chaw no, koj yuav tsum khaws nws li php cov ntaub ntawv koj tus kheej li kuv tsis tuaj yeem tso nws li. Cov ntaub ntawv php no tsim lub vev xaib yooj yim nrog ob qhov txuas, ib qho rau "cgi-bin/off.py" thiab ib qho rau "cgi-bin/on.py". Nov yog ob daim ntawv nab nab uas hloov pauv txoj haujlwm ntawm servo motor.

Python tsab ntawv yuav tsum tau muab tso rau hauv qhov chaw sib txawv rau Apache kom cia lawv khiav. Lawv yuav tsum tau muab tso rau hauv cgi-bin. Nov yog qhov twg cov ntaub ntawv mus yog tias lawv yuav tsum tau khiav hauv Common Gateway Interface uas ua rau cov ntawv sau ntawm pi khiav. Nkag mus rau/usr/lib/cgi-bin thiab ntxiv ob daim ntawv "on.py" thiab "off.py".

Kauj Ruam 5: Kauj Ruam 4: Mount Motor

Kauj Ruam 4: Mount Motor
Kauj Ruam 4: Mount Motor

Kuv pom ib feem zoo los ntawm lwm tus kws tsim khoom los teeb tsa servo xws li nws tuaj yeem tig lub teeb hloov tus qauv. Koj tuaj yeem pom cov ntawv 3d rau nws ntawm no:

github.com/suyashkumar/smart-lights

Qhov no yog rau tus qauv loj servo raws li tau teev tseg hauv ntu ntu. Luam tawm qhov no lossis muab nws luam tawm thiab tom qab ntawd rub nws mus rau koj lub teeb hloov.

Kauj Ruam 6: Kauj Ruam 5: Hlau Pi thiab Tsav

Kauj Ruam 5: Hlau Pi thiab Tsav
Kauj Ruam 5: Hlau Pi thiab Tsav

Kuv siv lub pi nrog lub micro usb. Kuv faib tawm lwm micro usb thiab txuas hauv av thiab lub zog rau servo rau qhov no. Kuv qhia cov av nruab nrab ntawm pi thiab servo. Tom qab ntawd kuv txuas tus pin teeb liab rau servo rau GPIO18 ntawm Pi.

Kauj Ruam 7: Kauj Ruam 6: Kho Cov Ntawv Sau

Kauj Ruam 6: Kho Cov Ntawv Sau
Kauj Ruam 6: Kho Cov Ntawv Sau

Koj yuav tsum tau ua si ib puag ncig nrog koj teeb tsa me ntsis kom paub seb qhov txiaj ntsig sib xws rau On thiab Off rau koj li cas. Tus Pi tso cai rau koj sau mus rau gpio los ntawm kab hais kom ua siv cov lus txib yooj yim zoo nkauj. los ua gpio 18 pwm pwm siv cov lus txib:

gpio -g mode 18 pwm

tom qab ntawd teeb tsa pwm nrog:

gpio pwm

gpio pwm 192

gpio pwm 2000

Cov no tsuas yog qhov tsim nyog qhov tseem ceeb rau kev teeb tsa pwm zaus. Kev siv tom ntej:

gpio -g pwm 18 120

Qhov twg koj hloov 120 ib puag ncig txhawm rau nrhiav qhov tsim nyog tsim nyog rau txoj haujlwm qhib thiab tawm.

Thaum koj tau pom cov txiaj ntsig tsim nyog rau kev tawm thiab siv cov ntawv sau los hloov cov txiaj ntsig no hauv cov ntawv tshwj xeeb rau ob txoj haujlwm. Qhov chaw kom hloov pauv tau hais meej hauv daim duab.

Kauj Ruam 8: Kauj Ruam 7: Xeem Nws

Image
Image
Kev sib tw Wireless
Kev sib tw Wireless

Mus rau tus IP chaw nyob ntawm tus pi koj yuav tsum pom lub vev xaib nrog qhov txuas rau thiab tawm. Txhua nplooj ntawv tseem yuav muaj qhov txuas rau lwm nplooj ntawv.

Nws yog qhov yooj yim ntxiv qhov luv rau nplooj ntawv no rau koj lub xov tooj ntawm lub vijtsam hauv tsev kom nkag tau yooj yim.

Pom zoo: