Cov txheej txheem:
- Kauj Ruam 1: Matrix Core & Matrix HAL Kev teeb tsa ntawm RPi
- Kauj ruam 2: Snips App (hloov tshiab)
- Kauj Ruam 3: Yuav Tsum Npm Pob
- Kauj ruam 4: Webpage
- Kauj ruam 5: ID nkag mus nplooj ntawv
- Kauj Ruam 6: Nplooj Ntawv Tseem Ceeb
- Kauj ruam 7: Pab
- Kauj Ruam 8: Qhov tshwm sim
Video: Tsev Automation Siv Raspberry Pi Matrix Lub Suab thiab Snips (Ntu 2): 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Hloov tshiab ntawm Tsev Automation Siv Raspberry Pi Matrix Lub Suab thiab Snips. Hauv PWM no yog siv rau kev tswj hwm sab nraud LED's thiab Servo motor
Tag nrho cov ntsiab lus muab rau hauv ntu 1
www.instructables.com/id/Controlling-Light…
Kauj Ruam 1: Matrix Core & Matrix HAL Kev teeb tsa ntawm RPi
1. Ntxiv Matrix repository thiab qhov tseem ceeb.
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt -key ntxiv -
ncha "deb https://apt.matrix.one/doc/apt-key.gpg $ (lsb_release -sc) lub ntsiab" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
Matrix repository rau Matrix HAL
curl https://apt.matrix.one/doc/apt-key.gpg | sudo apt -key ntxiv -echo "deb https://apt.matrix.one/doc/apt-key.gpg $ (lsb_release -sc) lub ntsiab" | sudo tee /etc/apt/sources.list.d/matrixlabs.list
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
2. Nruab qhov Matrix Core pob khoom.
sudo apt-tau nruab matrixio-malos
sudo rov pib dua
Nruab lub pob MATRIX HAL.
sudo apt-tau nruab matrixio-creator-init libmatrixio-creator-hal libmatrixio-creator-hal-dev
Rov pib dua koj lub cuab yeej.
sudo rov pib dua
3. Txhawm rau nruab ZeroMQ
ncha "deb https://download.opensuse.org/repositories/network…./" | sudo tee /etc/apt/sources.list.d/zeromq.list
wget https://download.opensuse.org/repositories/networ… -O- | sudo apt-key ntxiv
4. JavaScript teeb tsa Tsim cov phiaj xwm phiaj xwm hauv cov npe hauv tsev ntawm RPi
cd ~/mkdir js-matrix-core-app (lub npe twg koj xav tau)
cd js-matrix-core-app
npm pib
5. Txhim kho npm Pob rau ZMQ thiab Cov Txheej Txheem Tsis Zoo
Txhawm rau teeb tsa ZMQ thiab MATRIX Protocol Buffers npm pob. Nco ntsoov tias koj nyob hauv cov npe uas koj tsim saum toj no (lub npe koj muab). Ntawm no kuv muab nws js-matrix-core-app. Qhov no tso cai rau koj los cuam tshuam nrog Matrix Core los ntawm Node.js.
npm nruab zeromq --save
npm nruab matrix-protos --save
Raws li kuv tab tom siv JavaScript, yog li siv PWM rau LEDs sab nraud Kuv siv Matrix lite lub tsev qiv ntawv. Txhawm rau nruab nws siv cov lus hais hauv qab no kom ntseeg tau tias koj nyob hauv tib phau ntawv uas peb tsim thaum txhim kho Matrix core.
npm nruab @matrix-io/matrix-lite --save
Kauj ruam 2: Snips App (hloov tshiab)
1. Tsim qhov qhib tshiab thiab muab nws lub npe rau txhua yam uas koj xav tau. Ntawm no kuv siv plaub qhov
- hloov rau, tawm, qhib, thiab kaw lub xeev
- chav rau chav sib txawv xws li chav pw, chav dej thiab lwm yam
- ntaus ntawv rau cov khoom siv xws li lub teeb, kiv cua, qhov rooj thiab lwm yam
- ci ntsa iab rau teeb ci ci ntawm lub teeb nyob hauv chav sib txawv.
2. Tom qab ntawd muab lub npe hom rau. Ntawm no kuv tab tom tsim kev cai qhov hom.
chav qhov
Muab lub npe twg los xij koj xav tau. Tom qab ntawd ntxiv qhov tseem ceeb "chav dej", "chav pw", "chav ua noj", thiab "chav loj" thiab lwm yam.
Rau qhov hloov pauv Muab txhua lub npe yam koj xav tau.
Tom qab ntawd ntxiv qhov txiaj ntsig qhov "rau", "tawm", "qhib", thiab "kaw".
Ntaus qhov
Muab lub npe twg los xij koj xav tau. Tom qab ntawd ntxiv qhov qhov tseem ceeb "teeb", "kiv cua", thiab "qhov rooj".
qhov ci ci
Muab lub npe twg los xij koj xav tau. Tom qab ntawd ntxiv qhov txiaj ntsig 75, 50, 25, 0
3. Kaw lub app, txhawm rau qhia qhov piv txwv kev cob qhia uas yog siv qhov twg
- Nyem ob npaug rau Off thiab On thiab xaiv lub npe lub npe (hloov).
- Nyem ob npaug rau ntawm lub npe chav thiab xaiv lub npe (chav).
- Ob npaug nyem rau ntawm lub teeb, kiv cua thiab xaiv lub npe lub npe (ntaus ntawv).
- Ob npaug nias rau qhov muaj nuj nqis (0, 25, 50) thiab xaiv lub npe (qhov ci).
Tom qab ntawd khaws nws thiab koj tuaj yeem sim nws hauv lub qhov rais muab sab xis ntawm nplooj ntawv.
4. Tom qab ntawd xa nws
Kauj Ruam 3: Yuav Tsum Npm Pob
Rau xa xa nruab pob ntawm pob
npm nruab nodemailer
Npm pob rau kev sib tham raws kev sib tham ob tog
npm nruab socket.io
Npm pob rau nthuav qhia
npm nruab express
Yog koj xav hnov cov lus. Koj tuaj yeem rub tawm pob ntawm no.
npm install hais
Ntxiv cov kab no hauv qhov program (piv txwv)
const hais = xav tau ('hais')
say.speak ('Lub teeb ci tau teeb tsa rau 75');
Kauj ruam 4: Webpage
Kuv tau ua nplooj ntawv los qhia cov cav (chav, khoom siv, lub xeev cov cuab yeej, tus nqi siv zog thiab hnub tim) thiab ntsuas ntsuas qhia tus nqi siv tam sim no kom kuv tuaj yeem paub cov lus txib twg kuv siv thaum tham nrog snips. Ua raws cov theem hauv qab no txhawm rau ua lub vev xaib.
Nco tseg - Koj tuaj yeem siv Node server lossis Apache server.
Hauv qhov haujlwm no kuv tab tom siv node server li Apache server qeeb thiab nws tsis tuaj yeem hloov kho cov ntaub ntawv kom raug.
Nco tseg - Yog tias koj siv cov lej muab rau hauv txoj haujlwm no kom ntseeg tau tias koj txhua cov ntaub ntawv nyob hauv cd/var/www/html phau ntawv teev npe lossis koj tuaj yeem hloov chaw nyob hauv txoj haujlwm.
Ua ntej, txhawm rau nruab Apache server siv cov lus txib (Tsis xav tau)
sudo apt-tau nruab apache2
Apache server tsis xav tau yog tias koj muaj node server lossis Node server Ua cov ntaub ntawv tsis muaj npe server.js, ntxiv cov program muab rau hauv cov haujlwm program thiab khaws nws.
Txhawm rau khiav server siv cov lus txib
node server.js
Tom ntej no, mus rau phau ntawv teev npe cd/var/www/html thiab ua ob daim nplaub tshev
1. Ua lub npe nplaub tshev js siv cov lus txib
mkd yus
cd js // mus rau phau ntawv teev npe
Hauv/var/www/html/js phau ntawv teev npe cov ntaub ntawv angular.min.js thiab muab cov ntaub ntawv los ntawm qhov txuas
Hauv tib phau ntawv teev npe ua lwm cov ntaub ntawv npe gauge.min.js thiab muab cov ntaub ntawv los ntawm kab ntawv txuas
Yuav tsum tau cov ntaub ntawv
2. Ua lub npe nplaub tshev jsonpage siv cov lus txib
mkdir jsonpage
cd json paj
Hauv jsonpage phau ntawv teev npe ua cov ntaub ntawv info.js. Ua kom nws khoob
Nco tseg:- Json cov ntaub ntawv yuav raug tshem tawm tom qab 50 lub suab hais kom ua
Kauj ruam 5: ID nkag mus nplooj ntawv
Txhawm rau ua nplooj ntawv nkag mus rau phau ntawv teev npe cd/var/www/html thiab ua cov ntaub ntawv khoob npe index.html. Ntxiv qhov program muab rau hauv qab no
Kauj Ruam 6: Nplooj Ntawv Tseem Ceeb
Txhawm rau ua nplooj ntawv tseem ceeb mus rau phau ntawv teev npe cd/var/www/html thiab ua cov ntaub ntawv tsis muaj npe HA.html (ib qho). Ntxiv qhov program muab rau hauv qab no
Rau kev ntsuas ntsuas ua qhov khoob cov ntaub ntawv npe index.js hauv cd/var/www/html phau ntawv teev npe. Txoj haujlwm tau muab rau hauv qab no.
Kauj ruam 7: Pab
assistant.js rau lub vev xaib raug muab hauv qab no
Thaum ua tiav nrog txhua qhov teeb tsa. Ntxiv mus, qhib lub plhaub thiab khiav
cd js-matrix-core-app
node pab.js
Qhib lwm lub plhaub thiab khiav
cd/var/www/html
node server.js
Qhib browser
localhost: 8080/index.html
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
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Lub Suab Tswj Teeb Hluav Taws Xob RGB Led Strips thiab Ntau Nrog Cortana thiab Arduino Tsev Automation: 3 Kauj Ruam
Lub Suab Tswj Teeb Hluav Taws Xob RGB Led Strips thiab Ntau Nrog Cortana thiab Arduino Tsev Automation: Zoo li lub tswv yim ntawm kev tswj hwm yam nrog koj lub suab? Los yog tsis nyiam tawm ntawm lub txaj los tua teeb? Tab sis txhua qhov kev daws teeb meem zoo li google tsev yog kim heev? Tam sim no koj tuaj yeem ua nws tus kheej rau qis dua $ 10. Thiab txawm tias zoo dua nws yog qhov yooj yim heev
Ntse Suab Nkauj hauv Chav Dej thiab Da Dej Nrog Raspberry Pi - Sib Koom Ua Ke Hauv Chav, Tswb, Khawm Tswj thiab Kev Siv Tsev Hauv Tsev: 7 Kauj Ruam
Ntse Suab Nkauj hauv chav pw thiab Da Dej Nrog Raspberry Pi - Sib Koom Ua Ke Hauv Chav, Tswb, Khawm Tswj thiab Kev Siv Tsev Hauv Tsev: Niaj hnub no peb xav muab ob qho piv txwv txog yuav ua li cas koj tuaj yeem siv Raspberry Pi nrog peb Max2Play software rau hauv tsev automation: hauv chav dej thiab chav pw . Ob txoj haujlwm zoo ib yam nyob hauv cov suab paj nruag siab ncaj los ntawm ntau qhov chaw tuaj yeem rub tawm los
DIY Lub Suab/Internet Tswj Tsev Automation thiab Saib Xyuas Siv ESP8266 thiab Google Tsev Mini: 6 Cov Kauj Ruam
DIY Lub Suab/Internet Tswj Tsev Automation thiab Saib Xyuas Siv ESP8266 thiab Google Tsev Mini: Hav !! Tom qab so ntev kuv nyob ntawm no vim peb txhua tus yuav tsum tau ua ib yam dab tsi tho txawv (txoj haujlwm) kom khwv tau. yooj yim tab sis ua tau zoo tshaj plaws