Cov txheej txheem:

Lub Tsev TJBOT Nrog Raspberry Pi: 5 Kauj Ruam
Lub Tsev TJBOT Nrog Raspberry Pi: 5 Kauj Ruam

Video: Lub Tsev TJBOT Nrog Raspberry Pi: 5 Kauj Ruam

Video: Lub Tsev TJBOT Nrog Raspberry Pi: 5 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Lub Tsev TJBOT Nrog Raspberry Pi
Lub Tsev TJBOT Nrog Raspberry Pi

Taw qhia

IBM TJBOT Course: nyem qhov no

TJBotTJBot yog qhov phiaj xwm qhib, npaj rau zej zog coj thiab siv hauv txhua txoj kev uas koj tuaj yeem xav. TJBot yog ib ntawm ob peb IBM Watson Maker Kits, uas yog sau ua-nws-koj tus kheej (DIY) qhib qhov qauv coj los txuas rau Watson cov kev pabcuam hauv txoj kev lom zem.

TJBot yog thawj tus tsim cov khoom siv hauv kev sau thiab tau tsim los ntawm Maryam Ashoori ntawm IBM Kev Tshawb Fawb raws li kev sim txhawm rau nrhiav cov kev coj ua zoo tshaj plaws hauv kev tsim thiab siv cov khoom paub. TJBot tau muaj npe tom qab Thomas J. Watson, thawj tus Thawj Coj thiab CEO ntawm IBM. TJBot siv tau yooj yim, khoos phis tawj pheej yig: Raspberry Pi, hais lus, microphone, lub koob yees duab, LED, thiab servo motor.

TJBot siv cov khoom no (thiab lwm yam uas koj tuaj yeem txuas tau) kom nkag siab ib puag ncig ib puag ncig nws thiab nthuav qhia kev pom thiab hnov lus rau tus neeg siv. Hauv plawv ntawm kev txawj ntse ntawm TJBot yog IBM Watson cov kev pabcuam uas pab kom nkag siab ntxiv txog lub suab thiab kev pom lub ntsej muag los ntawm kev siv cov ntawv sau ntawm lub suab ntes los ntawm lub microphone, yam khoom thiab xim sib cais ntawm cov duab ntes nrog lub koob yees duab, hais lus sib txuas ntawm cov ntawv siv tus hais lus, kev txhais lus, kev xav thiab kev txheeb xyuas lub suab, thiab kev nkag siab cov lus ib txwm los teb rau cov neeg siv tswv yim. Neeg hlau tau yog ib feem ntawm kev ua yeeb yaj kiab yeeb yaj kiab thiab TV qhia rau ntau xyoo lawm. Txawm li cas los xij, kev txawj ntse dag tsuas yog nyuam qhuav ua rau nws muaj peev xwm rau cov neeg hlau los ua tus kheej ua haujlwm nrog cov peev txheej me me.

TJBot yog lub cev neeg hlau, tab sis lub peev xwm tuaj yeem ua haujlwm nyob txhua qhov chaw. Hauv chav kawm no, koj yuav siv Node.js thiab lub web-based simulator. Vim tias lub zej zog tau dhau los ua tus saib xyuas ntawm qhov haujlwm qhib, qhov tshiab ntawm kev ua haujlwm tam sim no suav nrog Swift thiab Node-RED.

Kauj Ruam 1: YUAV TSUM XAV

PARTS Yuav Tsum Tau
PARTS Yuav Tsum Tau

1. ELECTRONICS:

  • Raspberry Pi 3
  • USB lub microphone
  • Hais lus nrog 3.5mm audio jack.

2.3D Cov Ntawv Xeem:

Koj tuaj yeem tau txais Cov Ntaub Ntawv STL los ntawm kab ntawv hauv qab no

ibmtjbot.github.io/#gettj

Kauj Ruam 2: Npaj Koj Raspberry PI

1. Muaj koj li Raspberry pi nrog 4GB RAM (Rpi-3 kuj tseem yuav ua haujlwm tab sis cov lus teb qeeb heev)

2. Nruab koj li Raspbian OS.

3. Install Pob

Qhib daim ntawv thov davhlau ya nyob twg ntawm Pi thiab ua raws cov lus txib hauv qab no txhawm rau txhim kho qhov tseeb version ntawm Node.js thiab npm (Node Package Manager). Koj xav tau cov pob khoom no tom qab los khiav koj cov cai.

curl -sL https://ibm.biz/tjbot-bootstrap | sudo sh - cov

Nyob ntawm seb lub suab tso tawm qhov twg koj siv nrog koj Pi (HDMI, 3.5mm audio jack, Bluetooth, USB speaker), koj yuav xav tau teeb tsa lub suab teeb tsa.

HDMI/ 3.5mm Audio Jack Yog tias koj siv HDMI lossis 3.5mm audio jack, koj yuav xav teeb lub suab teeb tsa. Txhawm rau ua qhov no, mus rau lub davhlau ya nyob twg thiab qhib raspi-config.

sudo raspi-teeb tsa

Qhov no yuav qhib qhov Raspberry Pi teeb tsa lub vijtsam:

Xaiv "Advanced Options" thiab nias Enter, tom qab ntawd xaiv "Audio" thiab nias Enter. Xaiv qhov tseeb channel rau cov suab tso tawm. Yog tias koj tau txuas nrog tus neeg hais lus sab nraud rau lub mloog suab, koj yuav tsum xaiv 3.5mm nkaus.

USB Hais Lus Yog tias koj muaj lub suab USB, koj yuav tsum hloov kho koj/usr/share/alsa/alsa.config kom teeb tsa USB lub suab ua lub cuab yeej siv tau.

Pib nrog khiav cov lus txib hauv qab no kom paub tseeb tias koj USB txuas nrog thiab teev nyob rau ntawd.

lsusb

Tom ntej no yog txhawm rau txheeb xyuas daim npav tus lej ntawm koj lub USB suab.

kev -l

Sau ib daim npav ntawm tus lej cuam tshuam nrog koj lub USB Audio.

Tom qab ntawv mus rau alsa.config cov ntaub ntawv los teeb nws raws li lub neej ntawd.

sudo nano /usr/share/alsa/alsa.conf

Nrhiav

tsis. npe ctl0

defaults.pcm.card 0

thiab hloov daim npav naj npawb (0 ntawm no) rau daim npav ntawm koj lub USB suab.

Kev sib txawv ntawm Raspberry Pi OS yuav xav tau teeb tsa sib txawv. Yog tias koj muaj teeb meem nrog koj teeb tsa USB, txheeb xyuas phau ntawv qhia no los daws teeb meem.

Kauj ruam 3: Github Repository

Github Repository
Github Repository

Qhov chaws muaj nyob ntawm:

sudo git clone

cd TJBOT/recipes/conversationsudo npm nruab

Cov lus qhia Pro: yog tias koj tau txais qhov yuam kev rau npm nruab uas hais tias npm tsis pom, koj yuav tsum xub nruab npm ntawm koj lub tshuab. Qhov no yog kab hais kom ua rau nruab npm

sudo apt-tau nruab npm

Kauj Ruam 4: Ntxiv Koj Cov Ntawv Pov Thawj

Ntxiv koj daim ntawv pov thawj rau cov kev pabcuam hauv qab no:

Hais lus rau ntawv

watson tus pab

Cov lus rau kev hais lus

$ cp config.default.js config.js $ nano config.js

Tam sim no, koj npaj tau tham nrog koj TJBot! Qhib lub davhlau ya nyob twg thiab ua raws cov lus txib hauv qab no:

sudo kev sib tham.js

Kauj Ruam 5: Tham Nrog Koj TJBot

Watson kev sib tham siv lub hom phiaj los sau lub hom phiaj ntawm kab lus. Piv txwv li thaum koj nug TJBot "Thov qhia koj tus kheej", lub hom phiaj yog ua kom qhia. Koj tuaj yeem ntxiv koj tus kheej lub hom phiaj tshiab hauv Kev Sib Tham editor, tab sis tam sim no, peb tau pib koj nrog ob peb lub siab xav:

Taw qhia. Koj tuaj yeem hais cov kab lus xws li "Watson, thov qhia koj tus kheej", "Watson, koj yog leej twg", thiab "Watson, koj puas tuaj yeem qhia koj tus kheej"

Tso dag. Koj tuaj yeem nug "Watson, thov qhia kuv tso dag" lossis "Watson, Kuv xav hnov qhov lus dag ". Txhua daim ntawv teev npe, xyuas cov ntsiab lus ntawm chaw ua haujlwm-piv txwv.json

Ib lo lus mloog tau siv yog li TJBot paub koj tab tom tham nrog nws.

Lo lus mloog ua ntej yog 'Watson', tab sis koj tuaj yeem hloov nws hauv config.js raws li hauv qab no. Hloov kho cov ntaub ntawv teeb tsa los hloov lub npe neeg hlau hauv tjConfig ntu:

// teeb tsa TJBot kev teeb tsa xa tawm.tjConfig = {

log: {qib: 'verbose'},

neeg hlau: {lub npe: 'tee jay bot'}

};

Koj tuaj yeem hloov 'lub npe' rau txhua yam uas koj xav hu rau koj TJBot. Ib qho ntxiv, yog tias koj hloov poj niam txiv neej rau 'poj niam', TJBot yuav siv tus poj niam lub suab los tham nrog koj!

Txaus siab rau! Tsis txhob hnov qab qhia ib daim duab/video ntawm koj teeb #TJBot!:-)

Yog tias koj pom TJBot cov lus teb ntawm lub davhlau ya nyob twg tab sis tsis hnov TJBot tham, muaj lub sijhawm zoo uas ib qho ntawm ob yam no tau tshwm sim: (1) Lub suab tso tawm tau hais ncaj qha rau qhov tsis raug (koj tuaj yeem kho nws los ntawm raspi- config), (2) koj lub suab modules raug thaiv. Hauv qhov xwm txheej ntawd, mus rau /etc/modprobe.d/ thiab tshem blacklist-rgb-led.conf Tom qab ntawv khiav cov lus txib hauv qab no:

sudo hloov tshiab -initramfs -u

Rov pib dua thiab paub meej tias "snd" modules tab tom khiav los ntawm kev ua raws cov lus txib "lsmod". Qhov no yuav tsum daws qhov teeb meem.

lsmod ua

Rau ib qho lus nug hu rau [email protected]

Pom zoo: