Cov txheej txheem:

Yuav Tswj Li Cas/Teeb Lub Tsev Siv Arduino thiab Amazon Alexa: 16 Cov Kauj Ruam (nrog Duab)
Yuav Tswj Li Cas/Teeb Lub Tsev Siv Arduino thiab Amazon Alexa: 16 Cov Kauj Ruam (nrog Duab)
Anonim
Yuav Tswj Li Cas/Teeb Lub Tsev Siv Arduino thiab Amazon Alexa
Yuav Tswj Li Cas/Teeb Lub Tsev Siv Arduino thiab Amazon Alexa

Kuv tau piav qhia yuav ua li cas tswj lub teeb uas txuas nrog UNO thiab tswj los ntawm Alexa.

Kauj Ruam 1: Cov Khoom Siv

HARDWARE SIV

  1. Arduino UNO & Genuino UNO
  2. Resistor 221 hli
  3. LED (generic)
  4. Raspberry Pi 3 Qauv B.

SOFTWARE YUAV TSUM TAU

  1. Arduino IDE Cov
  2. Amazon Alexa Alexa Skills Kit

Kauj Ruam 2: Teeb Raspberry Pi & Arduino IDE

1. First install binaries

sudo apt-tau nruab nruab sej-pip

pip nruab flask

pip nruab flask-nug

sudo apt-tau nruab pyserial

sudo apt-tau nruab intl libpython2.7-dev

2. Txhim Kho Arduino IDE ntawm RPi

Txhawm rau nruab Arduino hauv RPi

1. Mus rau qhov chaw raug cai thiab rub tawm cov ntawv tso tawm dhau los.

Tom qab ntawd unzip nws thiab mus rau phau ntawv teev npe ntawm arduino thiab pib nws nrog./arduino

Kauj ruam 3: Upload Program

Rub tawm qhov program
Rub tawm qhov program

Tom qab rub tawm qhov program, qhib lub davhlau ya nyob twg.

Thaum koj sau N coj yuav qhib.

Thaum koj sau F coj yuav tua.

Kauj Ruam 4: Ua Tus Python Script

Ua Tus Python Script
Ua Tus Python Script
Ua Tus Python Script
Ua Tus Python Script

Khiav nws siv nab hab sej lighcontrol.py

Kauj ruam 5: Download Ngrok

Download Nco
Download Nco

Ngrok yog qhov chaw nyab xeeb rau kev ua kom koj lub cuab yeej online. Nrog lub platform no koj tuaj yeem ua rau koj daim ntawv thov web lossis ib daim ntawv thov mus online nrog txoj hauv kev yooj yim heev. Txhawm rau rub mus rau qhov chaw raug cai thiab rub tawm rau ARM.

ngrok.com/

Unzip nws thiab mus rau cov npe uas koj rho tawm nws. Khiav nws siv cov lus txib

./ngrok http 5000

Kauj Ruam 6: Teeb Alexa

Teeb tsa Alexa
Teeb tsa Alexa

1. Nkag mus rau Amazon tus lej. Yog tias koj muaj ib tus account ces nkag mus, yog tias tsis kos npe rau ntawd thiab nkag mus.

developer.amazon.com/

2. Mus rau Developer Console nyob rau sab saum toj sab xis.

Kauj Ruam 7: Mus rau Alexa ==> Alexa Skill Kit ==> Ntxiv Kev Txawj Ntse Tshiab

Duab
Duab

Alexa Skill Kit ==> Ntxiv Kev Txawj Ntse tshiab "src =" https://content.instructables.com/ORIG/FJ2/4LKE/JBE12M7I/FJ24LKEJBE12M7I-j.webp

Duab
Duab

Alexa Skill Kit ==> Ntxiv Kev Txawj Ntse tshiab "src =" {{file.large_url | ntxiv: 'pib = webp & thav duab = 1 & qhov siab = 300' %} ">

Koj yuav pom nplooj ntawv zoo li no. Ntawm nplooj ntawv no nws yuav nug yam txuj ci, lub npe, hom lus thiab lub npe hu xov tooj. Koj tuaj yeem muab lub npe twg, hauv lub npe hu xov tooj koj yuav tsum muab lub npe uas koj hais thaum muab lus txib rau Alexa.

Thov nco ntsoov xaiv cov lus tsim nyog uas siv hauv koj lub tebchaws yog tias koj xaiv cov lus sib txawv thaum tsim cov txuj ci. Nws yuav tsis ua haujlwm.

Thaum kawg hloov kho nws, txuag nws thiab nias tom ntej.

Kauj ruam 8:

Kauj ruam 9:

Nyob rau nplooj ntawv tom ntej, nws yuav nug txog kev nkag siab. Ntawm lub hom phiaj sawv cev rau qhov kev ua uas ua tiav tus neeg siv cov lus thov. Yog xav paub ntxiv

developer.amazon.com/docs/custom-skills/de…

Yog tias muaj qhov yuam kev koj yuav pom xim liab.

Sau cov cai hauv qab no hauv lub thawv

"txhob txwm": "LightOn"

}, {

"txhob txwm": "LightOff"

}]

}

txuag nws thiab txav mus rau nplooj ntawv tom ntej.

Kauj Ruam 10: Ntawm Nplooj Ntawv Tom Ntej Nws Yuav Nug Ob Qhov Kev Xaiv rau Qhov Kawg Nkaus Ib Yog AWS thiab

Ntawm Nplooj Ntawv Tom Ntej Nws Yuav Nug Ob Qhov Kev Xaiv rau Qhov Kawg Nkag Ib Qhov yog AWS thiab HTTPS
Ntawm Nplooj Ntawv Tom Ntej Nws Yuav Nug Ob Qhov Kev Xaiv rau Qhov Kawg Nkag Ib Qhov yog AWS thiab HTTPS

Xaiv HTTPS & txuag nws thiab txav mus rau nplooj ntawv tom ntej.

Kauj Ruam 11: Rau SSL Daim Ntawv Pov Thawj Xaiv Qhov Xaiv thib ob. Txuag Nws thiab txav mus rau nplooj ntawv tom ntej

Rau SSL Daim Ntawv Pov Thawj Xaiv Qhov Xaiv thib ob. Txuag Nws thiab txav mus rau nplooj ntawv tom ntej
Rau SSL Daim Ntawv Pov Thawj Xaiv Qhov Xaiv thib ob. Txuag Nws thiab txav mus rau nplooj ntawv tom ntej

Kauj Ruam 12: Txheeb Xyuas Kev Pabcuam "ntawm"

Kev Pab Cuam
Kev Pab Cuam

Txhawm rau sim seb qhov kev pabcuam ua haujlwm lossis tsis ua. Nco ntsoov tias koj Ngrok server ua haujlwm thiab Python tsab ntawv tseem ua haujlwm tsis li nws yuav tsis ua haujlwm.

Koj tuaj yeem pom cov servers tau txais kev thov thiab tshaj tawm nws.

Kauj Ruam 13: Cov Neeg Tau Txais Kev Thov

Cov Neeg Tau Txais Kev Thov
Cov Neeg Tau Txais Kev Thov

Kauj Ruam 14: Thov Muab Tshaj Tawm

Thov Muab Tshaj Tawm
Thov Muab Tshaj Tawm

Kauj Ruam 15: Schematics Arduino

Schematics Arduino
Schematics Arduino

Kauj Ruam 16: Teeb duab LED

Schematics LED
Schematics LED

Vam tias nej txhua tus nyiam.

Pom zoo: