Cov txheej txheem:
- Kauj Ruam 1: Teeb thiab sim kho vajtse
- Kauj Ruam 2: Teeb tsa Web Server
- Kauj Ruam 3: PHP Code thiab Web Scripts
- Kauj ruam 4: Xaus
Video: R Pi -Remote Tswj PA thiab Teeb Pom Kev Zoo: 4 Cov Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Nov yog txoj haujlwm yooj yim rau kev tshaj tawm suab thiab qhib thiab tua teeb ntawm PI nyob deb ntawm lub vev xaib. Yog li ntawm no yog yam koj xav tau:
1) Raspberry Pi nrog Apache thiab PhP preinstalled. Kuv siv tus qub Pi v1 Kuv tau dag ib ncig. Kuv xav tias koj muaj nws txuas nrog koj lub network hauv tsev los ntawm wi-fi lossis ethernet.
2) Cov neeg hais lus (uas) tuaj yeem txuas nrog Pi ntawm qhov hais lus tso tawm txuas. Kuv siv cov txheej txheem qub tham los ntawm cov txheej txheem tso suab qub.
3) Teeb Xmas ntoo teeb - Kuv yuav kuv li ntawm Poundland.
4) Cov kauv khej thiab cov hlua txuas txuas rau txuas / ntsuas Pi rau tus hais lus thiab teeb. (Saib 7)
5) Pc lossis laptop nrog Putty lub davhlau ya nyob twg emulator rau kev nkag mus rau Raspberry Pi
6) Thaum Tshav Kub Kub Shrink Hlau
7) Cov phom cua kub rau txuas tus hais lus thiab teeb pom kev zoo
Lub tswv yim yooj yim yog tias kuv siv lub vev xaib los tshaj tawm tej thaj chaw deb dhau los ntawm kuv tus neeg hais lus thiab tseem hloov lub teeb rau thiab tawm. Kuv siv PHP cov ntawv uas tig ua Espeak rau cov ntawv kom hais lus me ntsis thiab GPIO cov lus txib rau teeb. Kuv xav tias koj paub yuav nruab Apache thiab PhP ntawm koj li Raspberry Pi li cas. Nws yog cov ntaub ntawv zoo heev.
Kuv tau sim khaws qhov nqi qis no thiab yog li kuv tau siv lub tshuab tso suab qub uas kuv muaj, thiab tom qab tshem cov kev sib txuas thiab nthuav tawm cov xov hluav taws xob, Kuv txuas nws mus rau lub xov tooj qub mic uas kuv tau txiav tawm qhov no txhais tau tias thaum tus neeg hais lus ntim qis dua tus hais lus sab nraud, Kuv tuaj yeem siv zog txhua yam los ntawm Raspberry Pi. Tib yam yog qhov tseeb ntawm cov teeb. Kuv tshem lub 3.3v lub hwj huam muab lub thawv los ntawm lawv, nthuav tawm cov xov hlau thiab txuas lawv mus rau Pi siv poj niam / txiv neej lub khob cij txuas. Kuv txuas tag nrho cov no nrog cov kauv kauv.
Tom qab kuaj thiab siv tau, tom qab ntawv kuv txuas tag nrho cov xov hlau nrog cua sov ntswj hlau siv rab phom cua kub.
Kauj Ruam 1: Teeb thiab sim kho vajtse
Kuv tau siv Pi thiab txuas tus hais lus rau Pi lub suab tso zis. Kuv txuas lub teeb los ntawm kev txuas ib kawg rau GPIO17 (tus lej thib 6 hauv kab sab hauv) thiab GND (tus lej thib 3 rau ntawm kab sab nraud) - saib daim duab saum toj no. THOV NCO NTSOOV Kuv tau siv PI version 1 Yog li thov hloov pauv tus lej PIN raws li yog tias koj tab tom siv VERSION PER tom ntej.
Qhia saum toj no yog Heat Shrink Wire thiab Phom Cua Kub rau txuas tus hais lus thiab teeb pom kev zoo
Tom ntej nrog txhua yam muaj zog ntawm kuv nkag mus rau Pi siv Putty los ntawm kuv lub khoos phis tawj Windows. Txhawm rau nrhiav Pi tus IP chaw nyob qhib koj lub router IP chaw nyob ntawm koj lub vev xaib (feem ntau yog qee yam xws li 192.168.1.254) uas yuav qhia cov npe ntawm cov khoom siv txuas nrog suav nrog Pi tus tswv lub npe thiab tus IP chaw nyob. Koj tuaj yeem siv ob qho no los nkag rau hauv Putty tab sis kuv ib txwm siv IP chaw nyob vim tias kuv muaj PIs tus lej. Xwb, koj tuaj yeem nkag mus rau hauv Putty los ntawm kev sim lub npe host xws li pi lossis raspberrypi. Thaum hais tawm ntawm Putty rau tus neeg siv lub npe thiab tus lej password sim pi/raspberry uas yog lub neej ntawd. (Kev siv DEFAULTS yog qhov tsis txaus ntseeg thiab tawm koj qhib rau kev tawm tsam los ntawm HACKERS Txawm hais tias yog nyob ntawm tus kheej ntiag tug NETWORK). Hauv kuv qhov kev paub, Pi cov haujlwm, Espeak thiab GPIO cov tsev qiv ntawv tau teeb tsa los ntawm lub hauv paus ntawm feem ntau Pi cov duab.
Yog lawm, thaum koj nkag mus rau kab hais kom ua ntawm RaspberryPi sim cov lus txib hauv qab no - sudo alsamixer uas shoudl nthuav tawm daim npav suab tswj hwm - yog tias koj muaj tus hais lus tsis zoo, raws li kuv tau siv, koj yuav xav tau nce qhov ntim mus rau qhov siab. Tom ntej no, hloov lub teeb rau
sudo/usr/local/bin/gpio -g hom 17 outsudo/usr/local/bin/gpio -g sau 17 1
tom qab ntawd, hloov lub teeb tawm
(NB ib qho teeb meem tsuas yog sim tsuas yog sudo gpio thiab lwm yam -tseem kuaj xyuas yog tias gpio tau teeb tsa los ntawm kev ntaus gpio -v -yog tias koj xav tau los teeb tsa saib ntawm
sudo/usr/local/bin/gpio -g sau 17 0
Tam sim no sim tias espeak ua haujlwm
~ $ sudo espeak "qhov no yog kev sim"
Kuv tsis tshua muaj teeb meem nrog Espeak tab sis tau ntsib teeb meem thaum Alsamixer ntim qis, thiab qee zaum lwm cov haujlwm tau rub daim npav suab. Koj yuav tsum tau khiav ps -ef thiab pom dab tsi lwm cov txheej txheem xov xwm tau ua. Koj tuaj yeem siv qee yam zoo li sudo tua -9 $ (sudo ps aux | sudo grep -v grep | sudo grep mplayer | sudo awk '{print $ 2}') tua lawv -Peb siv qhov no tom qab hauv tsab ntawv PHP
Kauj Ruam 2: Teeb tsa Web Server
Muaj ntau tus lej peb yuav tsum tau ua
1) Nrhiav tus tswv ntawm lub vev xaib pabcuam / server apache2 - khiav sudo ps aux | egrep '(apache | httpd)' thiab koj yuav tsum pom www-data2) ntxiv www-data rau sudo pab pawg-khiav sudo nano /etc /sudoers --- ntxiv kab www-data TXHUA = (TXHUA) NOPASSWD: TXHUA
3) ntxiv www-data rau pab pawg suab-sudo adduser www-data audio
4) Cov kauj ruam xaiv tau yog tsim cov ntawv phpinfo uas qhia koj txhua yam ntawm PHP kev ua haujlwm uas koj muaj thiab qhov chaw nyob
cov ntaub ntawv conf koj yuav xav hloov yam. Piv txwv li, qee qhov qauv ntawm PHP thaiv qhov ua haujlwm shell_exec () uas peb xav tau los ua kab hais kom ua cov haujlwm zoo li Espeak los ntawm lub web server. Nov yog qhov koj teeb tsa phpinfo..
Mus rau koj lub vev xaib phau ntawv teev npe feem ntau/var/www lossis/var/www/html ….. nws yog ib qho nrog cov ntawv index.html thiab ntaus sudo nano phpinfo.php tom qab ntawv ntaus hauv qab no rau hauv nano editor thiab nias tswj O txuag thiab tawm mus
Tsis txhob hnov qab ua kom nws ua tiav los ntawm kev ntaus sudo chmod 755 phpinfo.php - Txhawm rau saib nws, qhib cov url hauv qab no hauv koj lub vev xaib siv koj lub npe hostname tsis yog kuv li, piv txwv li raspberrypi -
?>
Kauj Ruam 3: PHP Code thiab Web Scripts
Kuv tau siv ob txoj haujlwm ntawm no - Ib qho rau lub vev xaib (espeak_form.php) thiab lwm qhov uas ua cov ntaub ntawv (my_espeak.php) Kuv tau suav nrog cov no saum toj no ua cov ntawv thiab xa lawv mus rau koj Pi, siv Putty tsim ob qho php cov ntaub ntawv thiab tom qab ntawd txiav thiab muab tshuaj txhuam los ntawm cov ntawv cov ntawv uas tau hais los saum no
pi@raspberrypi/var/www $ sudo nano /var//www/my_espeak.php
pi@raspberrypi/var/www $ sudo nano /var//www/espeak_form.php
Nco ntsoov ua kom lawv ua tiav los ntawm kev ntaus sudo chmod 755 *.php
Lub vev xaib daim ntawv PHP tsab ntawv (espeak_form.php) Kuv sau yuav tsis yeej ib qho khoom plig tsim tab sis nws muaj 2 daim ntawv. Ib qho los tshaj tawm (ntawv rau kev hais lus) thiab lwm daim ntawv siv los hloov lub teeb ib qho thiab tawm. Daim ntawv espeak sub tso cai rau koj xaiv cov lus sib txawv, tus poj niam lub suab thiab ua haujlwm ntxhi, Cov tub ntxhais ntawm my_espeak.php yog kev siv php muaj nuj nqi - shell_exec (). Raws li koj tuaj yeem pom, qhov no tso cai PHP kom ua tiav Linux cov lus txib yam tsis xav tau lwm lub tsev qiv ntawv, raws li koj xav tau hais hauv Python.
Kauj ruam 4: Xaus
Qhov no yog qhov kev daws teeb meem uas tsim nyog uas koj tau siv ntau yam ntawm Pi ib puag ncig, piv txwv li PHP, comand kab ua haujlwm, Apache, GPIO thiab lwm yam. Kuv vam tias nws qhia txog yam koj tuaj yeem ua nrog PIs tshwj xeeb thiab IOT hauv generl. Muaj ntau txoj hauv kev kom ua tiav qhov no thiab koj tuaj yeem tswj hwm nws los ntawm is taws nem yog tias koj nkag siab qhov chaw xa mus tom ntej, tua hluav taws thiab/ lossis VPN. Kuv vam tias koj nyiam nws tab sis ntawm no yog kuv qhov tsis lees paub:
Kuv YUAV TSUM YUAV TSUM ZOO TSHAJ PLAWS LOS NTAWM KEV NYUAJ SIAB THIAB NTAWV THOV XOV XWM Tsis txhob siv nws rau lub hom phiaj uas suav nrog kev ua haujlwm ntawm tus kheej, PERSONALAL lossis COMMERCIALLY SENSITIVE DATA Tsis tas li ntawd, txuas koj cov kab ntawv kev nyab xeeb thiab yog tias koj tab tom siv kev sib tham ib ntus, E. G. CROCODILE CLIPS Tom qab ntawd tsis txhob tso lub SYSTEM uas tsis tau koom los yog siv hauv HARSH ib puag ncig.
Nov yog txoj hauv kev zoo los kawm ntau yam txog IOT thiab tsuas yog nco ntsoov ua ntej xav txog kev lag luam thov siv txoj hauv kev zoo li no. Raspberry Pi tsuas yog zoo li nws daim npav SD. Kuv yuav hais ib xyoos hauv kev siv ib txwm piv rau qee tus servers kuv siv uas tau khiav rau 10+ xyoo.
Xijpeem, hmoov zoo.
Pom zoo:
Qhov muag tsis pom kev Nrog ESP8266, Google Tsev thiab Openhab Kev Sib Koom thiab Kev Tswj Xyuas Web: 5 Cov Kauj Ruam (nrog Duab)
Qhov muag tsis pom kev Nrog ESP8266, Google Tsev thiab Openhab Kev Sib Koom thiab Kev Tswj Xyuas Web: Hauv Cov Lus Qhia no kuv qhia koj li cas kuv ntxiv kev siv tshuab rau kuv qhov muag tsis pom. Kuv xav kom muaj peev xwm ntxiv thiab tshem tawm qhov kev siv tshuab nws, yog li txhua qhov kev teeb tsa yog clip ntawm.Qhov tseem ceeb yog: Stepper motor Stepper tsav tswj bij ESP-01 Iav thiab teeb tsa
Nqaim Band IoT: Teeb Pom Kev Zoo & Kev Ntsuas Paves Txoj Kev kom Zoo dua thiab Noj Qab Haus Huv Ecosystem: 3 Cov Kauj Ruam
Nqaim Band IoT: Teeb Pom Kev Zoo & Kev Ntsuas Paves Txoj Kev kom Zoo dua thiab Noj Qab Haus Huv Ecosystem: Automation tau pom nws txoj hauv kev yuav luag txhua qhov haujlwm. Pib los ntawm kev tsim khoom mus rau kev saib xyuas kev noj qab haus huv, kev thauj mus los, thiab cov khoom siv sib txuas, kev siv tshuab tau pom lub teeb ntawm hnub ntawd. Zoo, tag nrho cov no yog qhov tsis txaus ntseeg, tab sis muaj ib qho uas zoo li
Pom Qhov Pom Pom Pom Pom Lub Koob Yees Duab (TfCD): 15 Kauj Ruam (nrog Duab)
Pom Qhov Pom Pom Pom Pom Lub Koob Yees Duab (TfCD): Cov kev pabcuam paub uas tuaj yeem paub txog kev xav, ntsej muag ntawm tib neeg lossis cov khoom yooj yim tam sim no tseem nyob rau theem pib ntawm kev txhim kho, tab sis nrog kev kawm tshuab, thev naus laus zis no tau nce zuj zus. Peb tuaj yeem cia siab tias yuav pom ntau ntxiv ntawm cov khawv koob no hauv
Lub Teeb Pom Kev Pom Kev Pom Zoo/ Handheld Photograpy Teeb: 7 Cov Kauj Ruam (nrog Duab)
Intimate Video Light/ Handheld Photograpy Light: Kuv paub koj xav li cas. Los ntawm "intimate," Kuv txhais tau tias teeb pom kev nyob ze rau qhov xwm txheej teeb pom kev nyuaj-tsis tas yuav rau "xwm txheej zoo." (Txawm li cas los xij, nws tuaj yeem siv rau qhov ntawd ib yam nkaus …) Raws li New York City tus kws yees duab-lossis
Teeb pom kev pom lub teeb pom kev zoo (LED) Nrog C Stamp Microcontroller: 5 Kauj Ruam
Teeb pom kev rau lub teeb pom kev zoo (LED) Nrog C Stamp Microcontroller: Nov yog Thawj Qhov Kev Tsim Qauv thiab Kev Ua Haujlwm los ntawm CS310XXX (μ C 101) Cov Ntawv Qhia Qhia Los ntawm A-WIT Technologies, Inc. Hauv qhov kev qhia no, peb yuav pom Lub Teeb Emitting Diode (LED) nrog C Stamp Microcontroller. Cov C & n