Cov txheej txheem:

Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c: 5 Kauj Ruam
Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c: 5 Kauj Ruam

Video: Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c: 5 Kauj Ruam

Video: Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c: 5 Kauj Ruam
Video: Ib lo lus Remix Dj - Super zab _ Mob lub siab ua luaj no - Nkauj tshiab 2023 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c
Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c
Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c
Yuav Ua Li Cas Sib Tham Alexa Nrog Dragonboard-410c

Nrog rau qhov kev qhia no koj yuav kawm paub yuav ua li cas ntxiv Alexa hauv Dragonboard-410c. Ua ntej pib, cia peb qhia qee yam khoom uas koj xav tau:

Kev Pabcuam Alexa Lub Suab (AVS) - Ua kom muaj peev xwm tham nrog koj cov cuab yeej, koj yuav tuaj yeem nkag mus rau huab raws alexa uas muab AVS Apis. Hais cov lus tsa "Alexa" koj tuaj yeem tham nrog cov cuab yeej thiab tau txais lub suab teb tam sim

Alexa Skills - Koj tuaj yeem cuam tshuam nrog kev paub tus kheej, kev txawj ntse alexa txhais tau tias muaj peev xwm sib txawv uas koj tuaj yeem tsim lossis siv nrog Alexa Skill Kit (ASK)

AWS Lambda - Tso cai rau koj ua txoj cai yam tsis tas yuav tswj hwm tus neeg rau zaub mov, tsuas yog xav tias koj yuav tsum tau ua yog sau koj cov cai thiab lambda yuav tswj hwm txhua yam

Kauj Ruam 1: Kho AVS ntawm Dragonboard

  1. Tsim tus as khauj hauv Amazon Developer.
  2. Sau npe koj cov khoom tom qab qhov kev qhia no.
  3. Hauv koj lub davhlau ya nyob twg:

Clone qhov chaw cia khoom no:

$ git clone

Mus rau:

$ cd CoffeeMachine-alexa/DragonBoard410c/CoffeeMachine/sau ntawv

Thiab ua:

#./setup.sh

Ntawm tsab ntawv ua tiav koj yuav tsum teb qee cov lus nug:

Nco tseg: Yog tias koj yog tus neeg siv qib siab, koj tuaj yeem nruab qhov pib tsab ntawv tus kheej thiab kho kom nws cuam tshuam koj txoj kev teeb tsa, tab sis peb tsis muab kev lees paub. Cuam tshuam? (Y/n)? n

  • Koj siv lub operating system twg? Koj OS [debian]: debian
  • Koj siv lub operating system twg? Koj lub cuab yeej [raspberrypi]: lwm yam
  • Koj puas tseem xav txhim kho Airplay txhawb nqa (Y/n)? n

Cov lus nug tom ntej no koj yuav tsum teb txog koj li ntaub ntawv xov xwm ntaus cim yav dhau los.

4. Qhib nplaub tshev:

$ cd CoffeeMachine-alexa/DragonBoard410c/CoffeeMachine

5. Kho cov ntaub ntawv ClientAWS.py:

Teem koj cov ntaub ntawv raws li koj tus as khauj AWS thiab daim ntawv pov thawj tsim:

host = tus tswv chaw nyob los ntawm koj li AWS IOT tus lej kawg.

rootCAPath = txoj hauv kev rau daim ntawv pov thawj rootCA rub tawm. certificatePath = txoj hauv kev rau daim ntawv pov thawj rub tawm. privateKeyPath = txoj hauv kev rau tus yuam sij ntiag tug rub tawm. clientID = tus cim rau koj cov neeg siv mqtt.

Yog xav paub ntxiv txog yuav tsim daim ntawv pov thawj li cas, thov txheeb xyuas qhov txuas no.

Kauj Ruam 2: Tsim Alexa Skills

Tsim Alexa Kev Txawj Ntse
Tsim Alexa Kev Txawj Ntse
Tsim Alexa Skills
Tsim Alexa Skills
Tsim Alexa Kev Txawj Ntse
Tsim Alexa Kev Txawj Ntse

Txhawm rau tsim Alexa cov txuj ci qee cov ntsiab lus tseem ceeb kom nkag siab cov txheej txheem:

  • Lub npe hu - Lub npe ntawm koj lub cuab yeej. Nws yuav tsum tau thov kom ntaus ntawv ua ib yam dab tsi.

    Piv txwv: "Alexa, thov tshuab kas fes kom qhib".

  • Hom qhov - Cov lej uas tuaj yeem hloov pauv cov xeev tau teev tseg.

    Piv txwv: "Alexa, nug lub tshuab kas fes ua kas fes ntev" lossis "Alexa, nug lub tshuab kas fes ua kas fes luv"

  • Kev nkag siab - Ua kom txaus siab rau tus neeg siv kab lus hais.
  • Cov Lus Piv Txwv - Cov kab lus uas koj yuav hais rau Alexa ua qee yam. Nws muaj lub npe hu thiab hom kab.

    Piv txwv: "TurnCoffeMachine {CoffeeState} lub tshuab kas fes" txhais tau tias "qhib/kaw lub tshuab kas fes".

  1. Nrog koj tus amazon tus tsim tawm tus lej nkag mus, mus rau txuj ci.
  2. Ua raws li qhov kev qhia no los tsim cov txuj ci tshwj xeeb.
  3. Tam sim no koj yuav tsum txhais lub npe hu ua zoo li lub tshuab kas fes.
  4. Rau qhov ua piv txwv no, cia peb tsim 2 hom kab.

    1. COFFEE_STATE ntxiv qhov tseem ceeb:

      • nyob rau
      • tawm
    2. COFFEE_TYPE ntxiv qhov tseem ceeb:

      • luv
      • ntev
  5. Thaum kawg cia tsim 2 kev xav. Kev nkag siab yog kab lus uas koj yuav hais rau Alexa ua qee yam.

    1. TurnCoffeeMachine

      • Ua raws cov duab txuas uas muaj cov ntsiab lus hais txog Utterances.

    2. MakeCoffee

      Ua raws cov duab txuas uas muaj cov ntsiab lus hais txog Utterances.

Kauj Ruam 3: Teeb tsa AWS Lambda

Setup AWS Lambda
Setup AWS Lambda
Setup AWS Lambda
Setup AWS Lambda

AWS Lambda muab txoj cai ua haujlwm yam tsis tas yuav tsum muaj kev tswj hwm lossis tswj hwm cov servers. Nws sau tus lej nkaus xwb thaum xav tau, feem ntau cov haujlwm no tau thov los ntawm Alexa Kev Txawj Ntse thiab ua tiav thaum tus neeg siv hais lus ntau hom lus txib.

Cia peb tsim txoj haujlwm lambda tsim nyog rau lub tshuab kas fes ua haujlwm. Cov haujlwm no tau thov los ntawm cov txuj ci tshwj xeeb uas tsim los ntawm cov lus qhia no.

Yuav tsum:

Active AWS account

  1. Txhawm rau pib tsim cov haujlwm lambda kos npe rau hauv lub console.
  2. Qhib cov kev pabcuam Lambda thiab mus rau cov haujlwm.
  3. Xaiv tsim cov haujlwm, txhais lub npe thiab teeb tsa lub sijhawm rau Python 2.7

    • Tom qab koj tsim koj lub luag haujlwm, koj yuav tsum ntxiv qee txoj cai.

      1. Mus rau IAM thiab xaiv koj lub luag haujlwm uas tau hais tseg thaum tsim txoj haujlwm lambda.
      2. Txuas txoj cai AWSIoTFullAccess. (Cia lambda tshaj tawm cov ntaub ntawv)
  4. Qhib koj txoj haujlwm Lambda thiab ntxiv qhov ua rau Alexa Skills (qib 2 siv).
  5. Teem kab ntawv txuas rau koj txoj haujlwm lambda.

Kauj ruam 4: Khiav Koj Daim Ntawv Thov

  1. Txuas lub microphone ntawm Dragonboard-410c
  2. Ua daim ntawv thov:

$ cd CoffeeMachine-alexa/DragonBoard410c/CoffeeMachine

$ python main.py

3. Hais "Alexa" thiab tos lub suab teb.

Kauj Ruam 5: Xaus

Los ntawm kev ua cov theem no koj Dragonbord-410c tau npaj los muab kev sib txuas lus nrog Alexa, thiab koj yuav tuaj yeem tsim txhua hom iot ntaus ntawv tswj los ntawm Alexa.

Ua kom tiav Cov Lus Qhia:

  • Tshuab Kas Fes Nrog Android App Siv DragonBoard 410c thiab CSR1011
  • Txuas Android Daim Ntawv Thov Nrog AWS IOT thiab nkag siab lub suab lees paub API

Pom zoo: