Cov txheej txheem:
- Kauj ruam 1:
- Kauj ruam 2:
- Kauj ruam 3:
- Kauj ruam 4:
- Kauj ruam 5:
- Kauj Ruam 6:
- Kauj ruam 7:
- Kauj ruam 8:
- Kauj ruam 9:
- Kauj ruam 10:
- Kauj ruam 11:
- Kauj ruam 12:
- Kauj ruam 13:
Video: Tau Kuaj Rau Koj Lub Tsev Google Siv Raspberry Pi thiab Dialogflow (Chromecast Alternative): 13 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Puas tau txij li thaum kuv yuav kuv lub tsev Google Kuv tau xav tswj hwm kuv cov cuab yeej hauv tsev siv lub suab hais kom ua. Nws ua haujlwm txaus nyob rau txhua txoj hauv kev, tab sis kuv xav tias tsis zoo rau nws cov yeeb yaj kiab. Peb tuaj yeem saib Youtube thiab Netflix tsuas yog tias peb muaj Chromecast ntaus ntawv lossis TV nrog built -in Chromecast. Kuv muaj Raspberry Pi nrog kuv, yog li kuv xav siv nws los ua si kuv cov vis dis aus thiab cov yeeb yaj kiab nrog lub suab hais kom ua.
Kauj ruam 1:
Txog qhov no, kuv tau teeb tsa hauv qab no
Google Tsev -> Dialogflow -> Rpi IP chaw nyob ntawm Dataplicity -> Nodejs Server -> Code qhib URLs
Dialogflow yog google tib neeg-khoos phis tawj sib cuam tshuam thev naus laus zis raws li kev sib tham lus ib txwm. Nrog kev pab los ntawm qhov no, peb tuaj yeem txhim kho peb tus kheej kev sib tham lossis ua haujlwm los muab ua tswv yim rau Google tsev. Qhov no ua haujlwm raws li hauv qab no
Lub hom phiaj [Lub tswv yim, lus nug, kev sib tham, hais kom ua….] -> Google Tsev -> nqis tes ua [teb]
Ntawm no, cov lus teb tuaj yeem yog kev sib tham yooj yim lossis lwm cov ntaub ntawv khaws los ntawm lub webhook, uas peb tab tom yuav siv Rpi server. Yog li, mus rau Dialogflow lub vev xaib thiab tsim tus as khauj thiab tus neeg sawv cev tshiab.
Tom qab ntawd tsim lub hom phiaj tshiab….
Kauj ruam 2:
Tom qab ntawd nkag mus rau kab lus qhia. Cov no yog cov lus txib uas cov neeg siv tham thaum lawv sim nkag mus ua haujlwm tshwj xeeb los ntawm Google Tsev.
Kauj ruam 3:
Ntawm no, Lo lus 'lub vev xaib' tuaj yeem hloov mus rau txhua yam zoo li youtube, Netflix, amazon prime thiab lwm yam … Yog li, lo lus no ua raws li qhov sib txawv thiab thaum koj xaiv lo lus lub vev xaib [siv nas] koj tau txais cov hauv qab no
Kauj ruam 4:
Los ntawm, cov ntawv qhia zaub mov nco, xaiv '@sys.any' thiab nias nkag mus.
Kauj ruam 5:
Tom qab ntawd nkag mus rau tib lub npe ntsuas hauv ntu kev ua. Cov txiaj ntsig tau hais hauv ntu no raug xa mus rau lub webhook ua JSON cov ntaub ntawv, uas peb xav tau los khaws hauv tus neeg rau zaub mov kom paub lub vev xaib twg muaj tus neeg siv thov.
Tus nqi ntawm qhov sib txawv tau muab rov qab siv '$ variable_name'
Kauj Ruam 6:
Ntxiv cov lus teb uas peb xav hnov tom qab hais cov lus txib rau Google Tsev. Tom qab ntawd txuag lub hom phiaj. Yog tias xav tau teeb tsa lub hom phiaj no yog qhov kawg ntawm kev sib tham.
Kauj ruam 7:
Tam sim no peb yuav teeb tsa peb qhov kev pabcuam tom qab kawg kom tau txais cov lus nug no kom qhib cov vis dis aus thiab cov vev xaib ntawm peb cov raspberry pi.
Qhov teeb tsa ntxiv
Dataplicity -> Nodejs server -> chaws
Vim li cas peb thiaj xav tau dataplicity? vim tias Google Tsev txuas rau webhooks uas nkag mus tau yooj yim hauv is taws nem. Txawm hais tias peb GHome txuas nrog lub network hauv zej zog, cov lus nug tau los ntawm Google huab kev pabcuam thiab yog li ntawd, xav tau kev xa peb cov server rau hauv internet. Hloov chaw ntawm kev mob taub hau, peb tuaj yeem siv cov kev pabcuam dataplicity tso peb cov raspberry pi hauv internet tau yooj yim.
Ua ntej, txuas rau raspberry pi [ncaj qha nrog HDMI lossis txawm nrog SSh] Tau txais qhov tseeb nodejs khiav-sijhawm los ntawm cov lus txib hauv qab no hauv lub davhlau ya nyob twg.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E tsoo -
Tom qab ntawd nruab nws siv
sudo apt -tau nruab -y nodejs
Tom qab ntawd tsim cov ntawv tshiab
nano webserver.js
Kauj ruam 8:
Tom qab ntawd, ntxig cov cai hauv qab no rau hauv cov ntawv
Ntawm no, rau kev ua qauv qhia, Kuv siv tsuas yog ob lub vev xaib (google, youtube). Ib tus tuaj yeem hloov kho cov cai thiab hloov raws li.
bodyParser = xav tau ('lub cev-parser'); var exec = xav tau ('child_process'). exec; var nthuav tawm = xav tau ('nthuav tawm'); var app = nthuav tawm (); app.use (bodyParser.json ()); app.post ('/', function (req, res) {let variable = req.body.queryResult.parameters.website; exec ("midori www."+variable+". com", muaj nuj nqi (yuam kev, stdout, stderr) {console.log ("stdout:" + stdout); console.log ("stderr:" + stderr); yog (yuam kev! == null) {console.log ("exec errror:" + yuam kev);}}); rov res.end ();}); app.listen (80);
Kauj ruam 9:
Cov cai saum toj no tau sau tsuas yog piav qhia lub tswv yim. Kuv siv Midori browser hauv qhov chaws vim chromium tsis ua haujlwm nrog cov lus txib nyob deb. Peb tuaj yeem siv Firefox ib yam. [Peb yuav tsum teeb tsa lub cev-parser, nthuav qhia cov qauv nrog kev pab ntawm npm ua ntej sau cov cai]
Nco ntsoov tias peb yuav tsum tsuas yog mloog ntawm chaw nres nkoj 80 raws li dataplicity tuaj yeem xa mus tsuas yog chaw nres nkoj 80 ntawm raspberry pi.
Tam sim no peb yuav tsum teeb tsa Dataplicity
Mus rau Dataplicity lub vev xaib thiab tsim koj tus lej nyiaj thiab ua raws cov lus qhia ntxiv rau raspberry pi rau ntawm lub dashboard.
Kauj ruam 10:
Tom qab ntawd, qhib raspberry pi los ntawm cov npe khoom thiab xaiv wormhole kom tau txais IP Chaw Nyob tshwj xeeb rau raspberry pi uas peb tuaj yeem xa peb cov node server.
Luam tus IP chaw nyob rau hauv ntawv teev cia.
Kauj ruam 11:
Tam sim no khiav cov cai los ntawm raspberry pi davhlau ya nyob twg
sudo node webserver.js
Yog tias nws qhia qhov ua yuam kev txog zaub lossis hais txog cov kev cai…. ua
sudo xhost +
Tam sim no rov qab mus rau dialogflow, thiab nyem rau ntawm ntu ua tiav
Kauj ruam 12:
Nkag mus rau IP Chaw Nyob lossis URL los ntawm dataplicity hauv qhov chaw saum toj no.
Kauj ruam 13:
Thaum kawg, mus rau ntu kev xav thiab ua kom lub webhook hu los ntawm kev ua tiav tab.
Qhov ntawd yog nws! Tam sim no rov qab mus rau koj lub tsev google thiab tshawb xyuas seb nws ua haujlwm li cas!
Txog rau lub sijhawm tom ntej, Zoo Siab Hacking:)
Pom zoo:
Siv Kev Cia Siab Lub Hauv Paus txuas ntxiv txhawm rau Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Txoj Cai Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: 11 Kauj Ruam
Siv Kev Cia Siab Lub Hauv Paus Txuas Ntxiv kom Nrhiav Lub Tuam Tsev Tsis Ua Haujlwm Ua Haujlwm Hauv Koj Tsev Neeg Tsob Ntoo ntawm Kev Tshawb Nrhiav Tsev Neeg: Lub hom phiaj ntawm cov lus qhia no yog los qhia seb yuav tshawb nrhiav koj tsev neeg tsob ntoo li cas hauv Tsev Neeg Nrhiav rau cov poj koob yawm txwv nrog kev ua haujlwm hauv lub tuam tsev tsis tiav siv Kev Cia Siab lub hauv siab txuas ntxiv. Siv Kev Cia Siab Lub Hauv Paus tuaj yeem ua rau koj qhov kev tshawb nrhiav tsis tiav
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev -- Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: 4 Cov Kauj Ruam
Tuchless Hloov rau Cov Khoom Siv Hauv Tsev || Tswj Koj Cov Khoom Siv Hauv Tsev Tsis Muaj Tuch Ib qho Hloov: Nov Yog Qhov Tuchless Hloov Rau Cov Khoom Siv Hauv Tsev. Koj Siv Tau Qhov No Mus Rau Txhua Qhov Chaw Hauv Pej Xeem Kom Pab Tau Tawm Tsam Ib Yam Kab Mob. Lub Circuit Court Raws Li Tsaus Sensor Circuit Ua Los Ntawm Op-Amp Thiab LDR. Qhov Tseem Ceeb Thib Ob Ntawm Qhov Circuit Court SR Flip-Flop Nrog Sequencell
Lub kaus mom tsis yog lub kaus mom - Cov kaus mom rau cov neeg uas tsis tau hnav lub kaus mom tiag tiag, tab sis xav tau lub kaus mom kev paub: 8 Kauj Ruam
Lub kaus mom tsis yog lub kaus mom rau cov tib neeg uas tsis tau hnav lub kaus mom tiag tiag, tab sis xav tau lub kaus mom kev paub: Kuv ib txwm xav tias kuv tuaj yeem yog tus neeg lub kaus mom, tab sis tsis tau pom dua lub kaus mom uas ua haujlwm rau kuv. Qhov no "Hat Not Hat," lossis fascinator raws li nws tau hu ua yog txheej txheej sab saum toj rau kuv cov teeb meem lub kaus mom uas kuv tuaj yeem koom nrog Kentucky Derby, vacu
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Info: 4 Cov Kauj Ruam
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws … Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Cov Lus Qhia: yog tias koj tau mus rau lub vev xaib thiab nws ua nkauj nkauj uas koj nyiam thiab xav tau nws ntawm no yog cov lus qhia rau koj tsis yog kuv qhov txhaum yog tias koj cuam tshuam qee yam (tsuas yog txoj hauv kev nws yuav tshwm sim yog tias koj pib tshem cov khoom yam tsis muaj laj thawj. ) Kuv tuaj yeem tau txais cov nkauj rau
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rov Ua Rau Lawv rau 12V.: 3 Cov Kauj Ruam
Txaus Siab Rau Koj Tus Kheej Tsuas Yog Siv 12V-rau-AC-kab Inverter rau LED Lub Teeb Hluav Taws Xob Tsis txhob Rewiring Lawv rau 12V: Kuv txoj kev npaj tau yooj yim. Kuv xav txiav cov phab ntsa uas siv hluav taws xob LED teeb ua ib daim ces rov txuas nws kom khiav tawm 12 volts. Lwm txoj hauv kev yog siv lub zog hloov pauv, tab sis peb txhua tus paub tias lawv tsis muaj txiaj ntsig zoo, puas yog? Txoj cai? Los yog lawv?