Cov txheej txheem:

Lub Suab Lub Koob Yees Duab Siv Raspberry Pi: 6 Kauj Ruam
Lub Suab Lub Koob Yees Duab Siv Raspberry Pi: 6 Kauj Ruam

Video: Lub Suab Lub Koob Yees Duab Siv Raspberry Pi: 6 Kauj Ruam

Video: Lub Suab Lub Koob Yees Duab Siv Raspberry Pi: 6 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Lub Suab Siv Lub Koob Yees Duab Siv Raspberry Pi
Lub Suab Siv Lub Koob Yees Duab Siv Raspberry Pi

Tsim lub koob yees duab uas tuaj yeem khiav ntawm lub suab dhau cov lus txib, qhov no feem ntau yog tsim los rau tib neeg ntawm txhua yam, tshwj xeeb tshaj yog rau cov tib neeg uas nrhiav kev lom zem lub sijhawm thaij duab.

Kauj Ruam 1: Phau Ntawv Qhia Kho Vajtse

Phau Ntawv Qhia Kho Vajtse
Phau Ntawv Qhia Kho Vajtse

VDC tau tsim los ntawm Raspberry Pi (Qauv B) thiab xav tau qee yam khoom siv ntxiv xws li wifi-adapter (yeem) thiab USB microphone. Cov cuab yeej tawm tswv yim tau qhia hauv qab no nrog txuas rau cov ncauj lus kom ntxaws. Koj tuaj yeem sim cov khoom sib txawv me ntsis/tshwj xeeb ntawm cov khoom siv kho vajtse. VDC tsis koom nrog ib qho ntawm cov neeg muag khoom kho vajtse txuas.

Daim Ntawv Teev Npe Tiav

  1. Raspberry Pi Qauv B.
  2. Picamera
  3. USB Mini Microphone
  4. Daim npav SD
  5. Ethernet cable
  6. Mini-USB Adapter (yeem)
  7. Micro USB - phab ntsa them nyiaj
  8. Cov neeg hais lus uas ua haujlwm dhau los ntawm Raspberry Pi audio jack (tej zaum yuav tsum tau siv tus kheej)

Raspberry Pi Verified Peripherals List tej zaum yuav pab tau rau nrhiav kev hloov pauv rau cov khoom lag luam pom zoo saum toj no.

Los ua ke

Kev sib dhos ntawm cov khoom siv xav tau yog qhov ncaj. Ntxig lub microphone, daim npav SD, lub khoos phis tawj wireless (yog tias koj muaj), micro-USB cable, ethernet cable, thiab hais lus rau hauv Raspberry Pi. USB phab ntsa them tus nqi hluav taws xob tau pom zoo kom siv hluav taws xob, ua khoom siv ib leeg.

Cov ethernet cable yuav siv los nkag rau pi los ntawm lub khoos phis tawj thaum lub sijhawm teeb tsa software. Tom qab teeb tsa, yog tias koj xav siv kev sib txuas wireless, cov kab no tuaj yeem raug tshem tawm.

Kev Sib Txuas Internet

Raws li tau hais los saum no, lub wireless adapter yog nyob ntawm yeem. Nws ua haujlwm tau zoo ntawm kev txuas xov tooj (ntawm ethernet), yog li koj tuaj yeem xaiv ntawm ob qho kev teeb tsa nyob ntawm seb yam twg ua haujlwm zoo tshaj rau koj.

Kauj Ruam 2: Kev teeb tsa OS ntawm Raspberry Pi

Kev teeb tsa OS ntawm Raspberry Pi
Kev teeb tsa OS ntawm Raspberry Pi

Taw qhia

Raspberry Pi yog credit card qhov loj me micro processor muaj nyob hauv cov qauv sib txawv nrog kev ua haujlwm sib txawv pib los ntawm 700 MHz. Txawm hais tias koj muaj tus qauv B lossis tus qauv B+, lossis cov laus heev, cov txheej txheem teeb tsa tseem zoo ib yam. Cov tib neeg uas tau txheeb xyuas cov nom Raspberry Pi lub vev xaib, tej zaum yuav tau pom lawv pom zoo "NOOBS" lossis "NOOBS LITE" Operating System (aka "OS") rau cov pib tshiab. Tab sis siv Pi yog qhov yooj yim heev thiab los ntawm kev pib ua, ib tus yuav tig mus rau hauv tsis muaj sijhawm. Yog li, nws zoo dua mus nrog lub zog muaj zog thiab muaj txiaj ntsig zoo OS, Raspbian. Qhov laj thawj tseem ceeb vim li cas Raspbian nrov heev yog tias nws muaj ntau txhiab lub tsev tsim ua ntej los ua ntau txoj haujlwm thiab ua kom zoo dua OS. Qhov no ua kom tau txais txiaj ntsig zoo thaum tsim cov ntawv thov.

Rub tawm Raspbian thiab Duab sau

Rub tawm qhov tseeb version ntawm Raspbian los ntawm no. Koj tuaj yeem rub nws ncaj qha lossis ntawm torrents.

Raspbian page

Raspbian OS Download link

Koj yuav xav tau tus kws sau duab los sau lub rub tawm OS rau hauv daim npav SD (daim npav micro SD thaum Raspberry Pi B+ qauv). Yog li rub tawm "win32 disk imager" los ntawm no.

Sau daim duab

Ntxig daim npav SD rau hauv lub khoos phis tawj/pc thiab khiav tus sau daim duab. Thaum qhib, xauj thiab xaiv cov duab Raspbian rub tawm. Xaiv lub cuab yeej raug, uas yog tus tsav sawv cev rau SD daim npav. Yog tias tus tsav (lossis khoom siv) xaiv sib txawv ntawm daim npav SD ces lwm qhov kev xaiv tsav yuav dhau los ua tsis ncaj. Yog li ceev faj.

Tom qab ntawd, nyem rau ntawm "Sau" khawm hauv qab. Ua piv txwv, saib daim duab hauv qab no, qhov twg daim npav SD (lossis micro SD) tsav tau sawv cev los ntawm tsab ntawv "G: \"

Thaum sau tiav, tshem tawm daim npav SD thiab ntxig nws rau hauv Raspberry Pi thiab qhib nws. Nws yuav tsum pib khau raj.

Teeb tsa Pi

Thov nco ntsoov tias tom qab pib Pi, tej zaum yuav muaj xwm txheej thaum tus neeg siv daim ntawv pov thawj zoo li "tus username" thiab tus password yuav raug nug. Raspberry Pi los nrog lub npe siv tsis raug thiab tus lej nkag thiab yog li ib txwm siv nws thaum twg nws tau nug. Cov ntaub ntawv pov thawj yog:

login: pib

lo lus zais: raspberry

Thaum Pi tau pib ua thawj zaug, lub vijtsam teeb tsa hu ua "Setup Options" yuav tsum tshwm thiab nws yuav zoo li cov duab hauv qab no.

Yog tias koj tau plam qhov "Setup Options" screen, nws tsis yog teeb meem, koj ib txwm tuaj yeem tau txais nws los ntawm kev ntaus cov lus txib hauv qab no hauv lub davhlau ya nyob twg.

sudo raspi-teeb tsa

Thaum koj ua tiav cov lus txib no "teeb tsa kev xaiv" lub vijtsam yuav los raws li qhia hauv daim duab saum toj no.

Tam sim no qhov teeb tsa Kev Xaiv qhov rai tau nce, peb yuav tau teeb tsa ob peb yam. Tom qab ua tiav txhua qib hauv qab no, yog nws thov rov pib Pi, thov ua li ntawd. Tom qab rov pib dua, yog tias koj tsis tau txais "teeb tsa Kev Xaiv" tshuaj ntsuam, tom qab ntawv ua raws cov lus txib tau hais los saum toj no kom tau txais lub vijtsam/lub qhov rai.

Thawj qhov ua:

xaiv thawj qhov kev xaiv hauv daim ntawv teev cov kev xaiv teeb tsa qhov rai, uas yog xaiv lub

Nthuav Filesystem

xaiv thiab ntaus tus yuam sij nkag. Peb ua qhov no txhawm rau siv txhua qhov chaw tam sim no ntawm SD daim npav raws li kev faib tag nrho. Txhua yam no ua yog, nthuav OS kom haum rau txhua qhov chaw ntawm SD daim npav uas tom qab ntawd tuaj yeem siv los ua lub cim xeeb cia rau Pi. Qhov thib ob ua:

xaiv qhov kev xaiv thib peb hauv cov npe ntawm cov kev xaiv teeb tsa qhov rai, uas yog xaiv "Enable Boot To Desktop/Scratch" xaiv thiab ntaus tus yuam sij nkag. Nws yuav coj koj mus rau lwm lub qhov rais hu ua "xaiv khau raj xaiv" lub qhov rai uas zoo li cov duab hauv qab no.

Hauv qhov "xaiv khau raj xaiv qhov rai", xaiv qhov kev xaiv thib ob, uas yog, "Desktop Nkag mus rau hauv raws li tus neeg siv 'pi' ntawm lub tshuab duab duab" thiab ntaus lub pob nkag. Thaum ua tiav koj yuav raug coj rov qab mus rau nplooj ntawv "Teeb Kev Xaiv", yog tias tsis xaiv lub pob "OK" nyob hauv qab ntawm lub qhov rais no thiab koj yuav raug coj rov qab mus rau lub qhov rais yav dhau los. Peb ua qhov no vim tias peb xav tau khau raj rau hauv lub desktop ib puag ncig uas peb paub zoo. Yog tias peb tsis ua cov kauj ruam no ces Raspberry Pi khau rau hauv lub davhlau ya nyob twg txhua lub sijhawm uas tsis muaj GUI xaiv. Ib zaug, ob kauj ruam tau ua tiav, xaiv lub pob "ua tiav" nyob hauv qab ntawm nplooj ntawv thiab nws yuav tsum rov pib dua. Yog tias nws tsis yog, siv cov lus txib hauv qab no hauv lub davhlau ya nyob twg kom rov pib dua.

sudo rov pib dua

Hloov kho lub firmware

Tom qab rov pib dua los ntawm cov kauj ruam dhau los, yog txhua yam mus zoo, tom qab ntawd koj yuav xaus rau ntawm lub desktop uas zoo li cov duab hauv qab no.

Thaum koj nyob ntawm lub desktop, qhib lub davhlau ya nyob twg thiab nkag mus rau cov lus txib hauv qab no txhawm rau hloov kho lub firmware ntawm Pi.

sudo rpi-hloov tshiab

Kev hloov kho lub khoos phis tawj yog qhov tsim nyog vim qee cov qauv ntawm Pi yuav tsis muaj txhua qhov kev cia siab uas yuav tsum tau ua kom zoo lossis nws yuav muaj qee qhov kab. Qhov tseeb firmware yuav muaj kev txhim kho rau cov kab no, yog li nws tseem ceeb heev uas yuav hloov kho nws thaum pib nws tus kheej.

nov yog qhov link video muaj:

Txhim kho thiab teeb tsa Raspbian Jessie Operating System ntawm Raspberry Pi (nyem qhov txuas)

Kauj Ruam 3: Teeb VNC ntawm Raspberry Pi rau Kev Tswj Chaw Nyob

Teeb VNC ntawm Raspberry Pi rau Kev Tswj Chaw Nyob
Teeb VNC ntawm Raspberry Pi rau Kev Tswj Chaw Nyob

VNC (Kev Sib Txuas Network Virtual)

Qee zaum nws tsis yooj yim los ua haujlwm ncaj qha ntawm Raspberry Pi. Tej zaum koj xav ua haujlwm ntawm nws los ntawm lwm lub cuab yeej los ntawm kev tswj chaw taws teeb.

VNC yog lub khoos phis tawj sib qhia duab uas tso cai rau koj los tswj kev sib txuas ntawm lub desktop ntawm ib lub computer (khiav VNC Server) los ntawm lwm lub khoos phis tawj lossis lub xov tooj ntawm tes (khiav VNC Viewer). VNC Viewer xa cov keyboard thiab nas lossis kov cov xwm txheej rau VNC Server, thiab tau txais cov hloov tshiab rau lub vijtsam rov qab.

Koj yuav pom lub desktop ntawm Raspberry Pi sab hauv lub qhov rais ntawm koj lub khoos phis tawj lossis lub xov tooj ntawm tes. Koj yuav tuaj yeem tswj nws zoo li koj tau ua haujlwm ntawm Raspberry Pi nws tus kheej.

VNC Txuas los ntawm RealVNC suav nrog Raspbian. Nws suav nrog ob VNC Server, uas tso cai rau koj los tswj koj li Raspberry Pi nyob deb, thiab VNC Viewer, uas tso cai rau koj los tswj lub khoos phis tawj desktop nyob deb ntawm koj li Raspberry Pi yog koj xav tau.

Koj yuav tsum pab kom VNC Server ua ntej koj tuaj yeem siv nws: cov lus qhia rau qhov no tau muab hauv qab no. Los ntawm lub neej ntawd, VNC Server muab rau koj nkag mus rau lub koos pij tawj duab uas tab tom khiav ntawm koj li Raspberry Pi, zoo li koj tau zaum ntawm nws xub ntiag.

Pab kom VNC Server

Ntawm koj tus Raspberry Pi, khiav cov lus txib hauv qab no kom ntseeg tau tias koj muaj qhov hloov tshiab kawg ntawm VNC Txuas:

sudo apt-tau hloov tshiab

sudo apt-tau nruab realvnc-vnc-server realvnc-vnc-viewer

Tam sim no qhib VNC Server. Koj tuaj yeem ua qhov no los ntawm kab lus txib.

Pab kom VNC Server teeb duab

Ntawm koj tus Raspberry Pi, khau raj rau hauv lub duab duab.

Xaiv cov ntawv qhia zaub mov> Nyiam> Raspberry Pi Configuration> Interfaces.

Xyuas kom VNC tau qhib. Pab kom VNC Server ntawm kab hais kom ua

Koj tuaj yeem pab VNC Server ntawm kab hais kom ua siv raspi-config:

sudo raspi-teeb tsa

Tam sim no, pab VNC Server los ntawm kev ua cov hauv qab no:

Coj mus rhaub rau Interfacing Options

Scroll cia thiab xaiv VNC> Yog. Txuas nrog koj li Raspberry Pi nrog VNC Viewer

Muaj ob txoj hauv kev txuas rau koj li Raspberry Pi. Koj tuaj yeem siv ib lossis ob qho tib si, nyob ntawm seb yam twg ua haujlwm zoo tshaj rau koj.

Tsim kom muaj kev sib txuas ncaj qha

Kev sib txuas ncaj qha yog qhov yooj yim thiab yooj yim muab koj tau koom nrog tib lub network ntiag tug ib yam li koj li Raspberry Pi. Piv txwv, qhov no yuav yog xov tooj lossis wireless network hauv tsev, tom tsev kawm ntawv, lossis hauv chaw ua haujlwm).

Ntawm koj tus Raspberry Pi (siv lub qhov rai dav hlau lossis ntawm SSH) siv cov lus qhia no lossis khiav ifconfig txhawm rau nrhiav koj tus IP tus kheej.

ifconfig

Ntawm lub cuab yeej koj yuav siv los tswj, rub tawm VNC Viewer. Kom tau txais txiaj ntsig zoo tshaj plaws, siv daim ntawv thov sib xws los ntawm RealVNC.

Nkag mus rau koj tus Raspberry Pi tus IP ntiag tug chaw nyob rau hauv VNC Viewer:

Tsim kom muaj kev sib txuas huab

Koj muaj cai siv RealVNC cov kev pabcuam huab dawb, muab tias kev nkag mus deb yog rau kev kawm lossis tsis yog lag luam lub hom phiaj nkaus xwb.

Kev sib txuas huab tau yooj yim thiab encrypted kawg-rau-kawg. Lawv tau pom zoo kom txuas rau koj li Raspberry Pi hauv is taws nem. Tsis muaj firewall lossis router teeb tsa dua tshiab, thiab koj tsis tas yuav paub tus IP chaw nyob ntawm koj li Raspberry Pi, lossis muab ib qho zoo li qub.

Sau npe rau tus as khauj RealVNC ntawm no: nws dawb thiab nws tsuas yog siv ob peb feeb.

Ntawm koj tus Raspberry Pi, kos npe rau hauv VNC Server siv koj li peev txheej RealVNC tus account tshiab:

Ntawm lub cuab yeej koj yuav siv los tswj, rub tawm VNC Viewer. Koj yuav tsum siv lub app sib xws los ntawm RealVNC

Nkag mus rau hauv VNC Viewer siv tib yam RealVNC tus lej pov thawj, thiab tom qab ntawd coj mus rhaub lossis nyem txuas rau koj li Raspberry Pi:

Kev lees paub rau VNC Server

Txhawm rau ua kom tiav ncaj qha lossis huab sib txuas, koj yuav tsum txheeb xyuas qhov tseeb rau VNC Server.

Yog tias koj txuas nrog los ntawm VNC Viewer app sib xws los ntawm RealVNC, sau tus neeg siv lub npe thiab tus lej zais uas koj ib txwm siv los nkag rau hauv koj tus lej siv ntawm Raspberry Pi. Los ntawm lub neej ntawd, cov ntawv pov thawj no yog pi thiab raspberry.

Yog tias koj tab tom txuas los ntawm qhov tsis-RealVNC Viewer app, koj yuav tsum xub txo qis VNC Server qhov kev txheeb xyuas qhov tseeb, qhia tus password tshwj xeeb rau VNC Server, thiab tom qab ntawd nkag mus rau qhov ntawd. Txhawm rau ua qhov no, qhib VNC Server sib tham ntawm koj li Raspberry Pi, xaiv Cov Ntawv Qhia> Xaiv> Kev Nyab Xeeb, thiab xaiv VNC tus password los ntawm Kev Pov Thawj.

Txhawm rau qhib qhov tshwj xeeb no:

Ntawm koj tus Raspberry Pi, qhib VNC Server sib tham.

Nkag mus rau Ntawv qhia zaub mov> Xaiv> Troubleshooting thiab xaiv Pab kom sim sim ncaj qha hom kev ntes.

Ntawm lub cuab yeej koj yuav siv los tswj, khiav VNC Viewer thiab txuas.

Nco tseg: cov kev sib txuas uas twb muaj lawm yuav tsum tau rov pib dua kom cov kev hloov pauv no siv tau.

Yog tias kev ua haujlwm zoo li tsis muaj zog, sim ua cov kauj ruam daws teeb meem no, lossis qhia rau RealVNC paub.

Tsim lub desktop virtual

Yog tias koj lub Raspberry Pi tsis muaj lub taub hau (piv txwv li tsis tau ntsaws rau hauv lub saib) lossis tswj tus neeg hlau, nws tsis zoo li yuav tsum tau siv lub duab duab.

VNC Server tuaj yeem tsim lub desktop virtual rau koj, muab cov duab nraaj rau koj siv tau ntawm qhov xav tau. Lub desktop virtual no tsuas muaj nyob hauv koj li Raspberry Pi lub cim xeeb:

Txhawm rau tsim thiab txuas rau lub desktop virtual:

Ntawm koj tus Raspberry Pi (siv Terminal lossis ntawm SSH), khiav vnc server. Nco tseg tus IP chaw nyob/tus lej xov tooj uas VNC Server yuav luam tawm rau koj lub Terminal (piv txwv li 192.167. **. **).

Ntawm lub cuab yeej koj yuav siv los tswj, sau cov ntaub ntawv no rau hauv VNC Viewer. Txhawm rau rhuav tshem lub desktop virtual, khiav cov lus txib hauv qab no:

vncserver -tua:

Qhov no tseem yuav tso tseg ib qho kev sib txuas uas twb muaj lawm rau lub desktop virtual no.

Kauj Ruam 4: Lub Koob Yees Duab Kho

Lub Koob Yees Duab Kho
Lub Koob Yees Duab Kho

Teeb lub koob yees duab kho vajtse

Ceeb Toom: Cov koob yees duab nkag siab zoo li qub. Lub ntiaj teb koj tus kheej ua ntej tuav PCB. Lub dab dej los yog qhov zoo sib xws yuav tsum txaus yog tias koj tsis muaj cov hlua hauv av.

Lub koob yees duab pawg thawj coj saib txuas nrog Raspberry Pi ntawm 15-txoj kev ribbon kab. Tsuas muaj ob txoj kev sib txuas los ua: cov hlua kab xav tau txuas nrog lub koob yees duab PCB, thiab rau Raspberry Pi nws tus kheej. Koj yuav tsum tau txais txoj hlua txoj hauv kev kom zoo, lossis lub koob yees duab yuav tsis ua haujlwm. Ntawm lub koob yees duab PCB, xiav thaub qab ntawm kab ntawv yuav tsum tig ntsej muag ntawm PCB, thiab ntawm Raspberry Pi nws yuav tsum tig mus rau Ethernet txuas (lossis qhov twg Ethernet txuas yuav yog yog koj siv tus qauv A).

Txawm hais tias cov txuas ntawm PCB thiab Pi sib txawv, lawv ua haujlwm zoo ib yam. Ntawm Raspberry Pi nws tus kheej, rub cov tab ntawm txhua qhov kawg ntawm qhov txuas. Nws yuav tsum xaub tau yooj yim, thiab tuaj yeem hloov pauv me ntsis. Ua tib zoo ntxig daim kab xev rau hauv qhov, kom ntseeg tau tias nws tau teeb tsa ncaj, tom qab ntawd maj mam nias lub tab kom kaw nws rau hauv qhov chaw. Lub koob yees duab PCB txuas tseem xav kom koj rub cov tab kom deb ntawm lub rooj tsavxwm, maj mam ntxig rau kab ntawv, tom qab ntawd thawb cov tab rov qab. PCB txuas tuaj yeem ua tau txawv txawv me ntsis dua li ntawm ntawm Pi nws tus kheej.

Teeb lub koob yees duab software

Ua raws cov lus qhia hauv qab no ntawm kab hais kom rub tawm thiab teeb tsa qhov tseeb ntsiav, GPU firmware, thiab daim ntawv thov. Koj yuav xav tau internet txuas rau qhov no kom ua haujlwm raug.

sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

Tam sim no koj xav tau los pab txhawb lub koob yees duab siv

raspi-teeb tsa

program koj yuav tau siv thaum koj xub teeb tsa koj li Raspberry Pi.

sudo raspi-teeb tsa

Siv tus cursor yuam sij txav mus rau lub koob yees duab xaiv, thiab xaiv 'pab'. Thaum tawm ntawm raspi-teeb tsa, nws yuav thov kom rov pib dua. Qhov kev xaiv ua haujlwm yuav ua kom ntseeg tau tias ntawm kev rov pib kho qhov tseeb GPU firmware yuav tau ua haujlwm nrog lub koob yees duab tsav tsheb thiab kho dua, thiab GPU lub cim xeeb sib faib yog txaus kom tso cai rau lub koob yees duab kom tau txais lub cim xeeb txaus los khiav kom raug.

Yog tias nws tsis tau qhib, qhib nws thiab rov pib dua koj Pi kom pib

Txhawm rau sim tias lub kaw lus tau teeb tsa thiab ua haujlwm, sim cov lus txib hauv qab no:

raspistill -v -o test.jpg

Cov zaub yuav tsum pom tsib-thib ob saib ua ntej los ntawm lub koob yees duab thiab tom qab ntawd thaij duab, khaws cia rau hauv cov ntawv xeem.jpg, thaum tso tawm ntau yam xov xwm.

RASPIVID

Raspivid yog kab hais kom ua cuab yeej rau kev yees duab nrog lub koob yees duab module.

Nrog lub koob yees duab module txuas thiab qhib, kaw cov vis dis aus siv cov lus txib hauv qab no:

raspivid -o vid.h264

Nco ntsoov siv

-ib hf

thiab

-vf ua

kom tig cov duab yog xav tau, zoo li nrog

raspistill

Qhov no yuav khaws 5 daim vis dis aus thib ob rau txoj hauv kev uas tau muab ntawm no raws li vid.h264 (lub sijhawm pib lub sijhawm).

Qhia meej qhov ntev ntawm cov vis dis aus

Txhawm rau txheeb xyuas qhov ntev ntawm cov vis dis aus, hla hauv -t tus chij nrog tus lej milliseconds. Piv txwv li:

raspivid -o video.h264 -t 10000

Qhov no yuav kaw 10 vib nas this ntawm cov vis dis aus.

MP4 yees duab hom

Tus Pi ntes cov vis dis aus ua raw H264 video kwj. Ntau tus neeg tshaj xov xwm yuav tsis kam ua nws, lossis ua si nws ntawm qhov tsis raug, tshwj tsis yog nws "qhwv" hauv cov thawv uas haum zoo ib yam li MP4. Txoj hauv kev yooj yim kom tau txais cov ntawv MP4 los ntawm

raspivid

hais kom ua siv MP4Box.

Nruab MP4Box nrog cov lus txib no:

sudo apt -tau nruab -y gpac

Capture koj cov video nyoos nrog raspivid thiab qhwv nws hauv lub thawv MP4 zoo li no:

# Capture 30 vib nas this ntawm cov yeeb yaj kiab ntawm 640x480 thiab 150kB/s ntsis tus nqi rau hauv pivideo.h264 cov ntaub ntawv:

raspivid -t 30000 -w 640 -h 480 -fps 25 -b 1200000 -p 0, 0, 640, 480 -o pivideo.h264 # Qhwv cov ntaub ntawv raw nrog lub thawv MP4 MP4Box -add pivideo.h264 pivideo.mp4 # Tshem tawm lub hauv paus cov ntaub ntawv nyoos, tawm qhov seem pivideo.mp4 ua si rm pivideo.h264

Xwb, qhwv MP4 ib ncig ntawm koj qhov kev tso tawm tam sim no, zoo li no:

MP4Box -ntxiv video.h264 video.mp4

Kauj Ruam 5: Kev teeb tsa thiab teeb tsa

Ua raws cov lus qhia no tsuas yog koj xav sau koj cov software los ntawm kos. Cov hauv qab no cov kauj ruam yog qhov tsim nyog thiab pom zoo raws li qhov ua tau zoo ib yam ntawm kev teeb tsa ntawm koj li Raspberry pi.

Txhim kho qhov kev vam khom

Txhim kho Sphinxbase/Pocketsphinx

Ua ntej, koj yuav tsum nruab Pocketsphinx. Yog tias koj siv Debian Sid (tsis ruaj khov) lossis Jessie (kuaj), koj tuaj yeem ua tau:

sudo apt-tau hloov tshiab

sudo apt-tau nruab pocketsphinx

Pib los ntawm kev txhim kho qee qhov kev vam khom:

sudo apt-tau nruab subversion autoconf libtool automake gfortran g ++-yog

Tom ntej no, txav mus rau hauv koj lub tsev (lossis Jasper) phau ntawv teev npe txhawm rau txheeb xyuas thiab teeb tsa CMUCLMTK:

svn co

cd cmuclmtk/

./autogen.sh && ua && sudo teeb tsa

cd ua..

Tom qab ntawd, thaum koj tau tawm ntawm CMUCLTK phau ntawv teev npe, rub tawm cov tsev qiv ntawv hauv qab no:

Txhim kho Phonetisaurus, m2m-aligner thiab MITLM

Txhawm rau siv Pocketsphinx STT cav, koj kuj yuav tsum teeb tsa MIT Language Modeling Toolkit, m2m-aligner thiab Phonetisaurus (thiab yog li OpenFST).

Yog tias koj tsis siv Debian, ua cov theem no:

#-Original:

# wget

#-new:

wget

wget

wget

wget

Tshem tawm cov downloads:

tar -xvf m2m-aligner-1.2.tar.gz

tar -xvf openfst -1.3.4.tar.gz

tar -xvf is 2013 -conversion.tgz

tar -xvf mitlm -0.4.1.tar.gz

Tsim OpenFST:

cd openfst-1.3.4/

sudo./configure --enable-compact-fsts --enable-const-fsts --enable-far --enable-lookahead-fsts --enable-pdt

sijhawm sudo ua nruab # rov qab los tom qab lub sijhawm ntev tiag tiag

cd ua..

tiag 66m38.394s

neeg siv 64m42.620s

sib 1m2.150s

df -h /

Cov Ntaub Ntawv Cov Ntaub Ntawv Loj Siv Avail Siv% Mounted rau /dev /hauv paus 14G 4.4G 8.3G 35% /

Tsim M2M:

cd m2m-aligner-1.2/ cov

sudo ua

cd ua..

Tsim MITLMT:

cd mitlm-0.4.1/

sudo./configure

sudo ua kom nruab

cd ua..

Tsim Phonetisaurus:

cd yog 2013-hloov dua siab tshiab/phonetisaurus/src

sudo ua

ua cd

Tsiv ib co ntawm cov ntaub ntawv tso ua ke:

sudo cp ~/m2m-aligner-1.2/m2m-aligner/usr/zos/bin/m2m-aligner

#-Original:

# sudo cp ~/phonetisaurus-0.7.8/phonetisaurus-g2p/usr/local/bin/phonetisaurus-g2p

#-Yuav tsum yog:

sudo cp ~/is2013-hloov dua siab tshiab/bin/phonetisaurus-g2p/usr/local/bin/phonetisaurus-g2p

Nco tseg txoj kev hloov pauv rau kev ua haujlwm.

Tau thiab tsim tus qauv Phonetisaurus FST

wget

tar -xvf g014b2b.tgz

cd g014b2b/

./compile-fst.sh

cd ua..

Thaum kawg, hloov npe cov npe hauv qab no kom yooj yim:

mv ~/g014b2b ~/phonetisaurus

Thaum cov kev teeb tsa tiav, rov pib dua koj Pi.

Ua raws cov lus qhia los ntawm

Kuv kuj ntxiv (tshiab) cov ntaub ntawv `/etc/modprobe.d/alsa-base.conf` nrog cov ntsiab lus no:

# Qhov no teeb tsa tus lej ntsuas ntawm daim npav tab sis tsis rov ua dua.

xaiv snd_usb_audio index = 0

xaiv snd_bcm2835 index = 1

# Puas yog reordering

xaiv snd slots = snd_usb_audio, snd_bcm2835

kom ntseeg tau tias kev xaj kom raug ntawm cov cuab yeej suab (tsis paub tseeb tias qhov no xav tau tiag tiag, txawm li cas los xij)

Ua tiav nrog kev teeb tsa - qee qhov debugging tom ntej…

Sim pib jasper:

pi@AVIV: ~ $./jasper/jasper.py

Traceback (hu tsis ntev los no dhau los):

Cov ntaub ntawv "./jasper/jasper.py", kab 12, los ntawm cov neeg siv khoom ntshuam tts, stt, jasperpath, txheeb xyuas Cov Ntaub Ntawv "/home/pi/jasper/client/tts.py", kab 41, hauv ntshuam kuaj xyuas cov ntaub ntawv "/ home/pi/jasper/client/diagnose.py ", kab 9, hauv ntshuam pip.req Cov Ntaub Ntawv" /usr/lib/python2.7/dist-packages/pip/_init_.py ", kab 74, hauv los ntawm pip. vcs import git, mercurial, subversion, bazaar # noqa File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", kab 9, los ntawm pip.download ntshuam path_to_url File "/usr/ lib/python2.7/dist-packages/pip/download.py ", kab 25, los ntawm kev thov.compat ntshuam Tsis tiav Sau NyeemError: tsis tuaj yeem ntshuam lub npe IncompleteRead

Tsau nrog:

sudo easy_install -U pip

Teeb meem tom ntej:

pi@AVIV: ~ $./jasper/jasper.py

*******************************************************

*JASPER - LUB TALKING COMPUTER**(c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis****************************** ************************** ERROR: hauv paus: Yuam kev tshwm sim! Rov qab (hu xov tooj tsis ntev los no): Cov ntaub ntawv "./jasper/jasper.py", kab 143, hauv app = Jasper () Cov ntaub ntawv "./jasper/jasper.py", kab 88, hauv _init_ stt_engine_class = stt.get_engine_by_slug (stt_engine_slug) Cov ntaub ntawv "/home/pi/jasper/client/stt.py", kab 648, hauv get_engine_by_slug "dependencies, thiab lwm yam)") % slug)

Qhov Tsis Zoo: STT cav 'sphinx' tsis muaj (vim tsis muaj kev vam khom, tsis muaj kev vam khom, thiab lwm yam)

sim

sudo apt-tau nruab -y nab hab sej-pocketsphinx

Txhim kho txoj hauv kev `../ phonetisaurus/g014b2b.fst` kom yog`/home/pi/phonetisaurus/g014b2b.fst` hloov (hauv `.jasper/profile.yml`)

pi@AVIV: ~ $./jasper/jasper.py

*******************************************************

*JASPER - LUB TALKING COMPUTER**(c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis****************************** ************************** ERROR: client.stt: hmm_dir '/usr/local/share/pocketsphinx/qauv/hmm/en_US/hub4wsj_sc_8k 'tsis muaj! Thov nco ntsoov tias koj tau teeb tsa qhov tseeb hmm_dir hauv koj qhov profile.

Txhim kho/qhib txoj hauv kev rau qhov no hauv `profile.yml` ntxiv rau:

hmm_dir: '/usr/qhia tawm/pocketsphinx/qauv/hmm/en_US/hub4wsj_sc_8k' #optional

(nco tseg qhov tsis muaj "hauv zos" hauv txoj kev)

Ib nrab kev vam meej -:

pi@AVIV: ~ $./jasper/jasper.py

*******************************************************

*JASPER - LUB TALKING COMPUTER**(c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis****************************** ************************** ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM daim npav.pcm.center_lfe ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM cards.pcm.side ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM daim npav.pcm.hdmi ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM daim npav.pcm.modem ALSA lib pcm.c: 2239: (snd_pcm_open_nou.pou_nou).modem ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM daim npav.pcm.phoneline ALSA lib pcm.c: 2239: (snd_pcm_open_noupdate) Tsis paub PCM daim npav.pcm.phoneline ALSA lib mem tes.c: 243: (mem tes_connect): Tsis tuaj yeem txuas: Kev sib txuas tsis kam ALSA lib pulse.c: 243: (pulse_connect) PulseAudio: Tsis tuaj yeem txuas: Kev sib txuas tsis kam Tsis tuaj yeem txuas mus ua haujlwm r socket err = Tsis muaj cov ntaub ntawv lossis cov npe Tsis tuaj yeem txuas rau server thov channel jack server tsis ua haujlwm lossis tsis tuaj yeem pib nthuav tawm 'paInvalidSampleRate' ua tsis tiav hauv 'src/hostapi/alsa/pa_linux_alsa.c', kab: 2048 Qhia 'PaAlsaStreamComponent_InitialConfigure (& tus kheej -> ntes, inParams, tus kheej-> primeBuffers, hwParamsCapture, & realSr) 'ua tsis tiav hauv' src/hostapi/alsa/pa_linux_alsa.c ', kab: 2719 Kev nthuav tawm' PaAlsaStream_Configure (kwj, inputParameters, outputParameters, piv txwv, tus lej, tus lej & cov zis, & hostBufferSizeMode) 'ua tsis tiav hauv' src/hostapi/alsa/pa_linux_alsa.c ', kab: 2843 Traceback (feem ntau hu tsis ntev los no): Cov ntaub ntawv "./jasper/jasper.py", kab 148, hauv app.run () Cov Ntaub Ntawv "./jasper/jasper.py", kab 118, nyob rau hauv kev sib tham.handleForever () Cov ntaub ntawv "/home/pi/jasper/client/conversation.py", kab 31, hauv kev tuav lub sijhawm pib, sau tseg = tus kheej.mic.passiveListen (self.persona) Cov ntaub ntawv "/home/pi/jasper/client/mic.py", kab 110, hauv passiveListen frames_per_buffer = CHUNK) Cov ntaub ntawv "/usr/lib/python2.7/dist-packages/pyaudio.py", kab 747, hauv qhib kwj = Stream (tus kheej, *args, ** kwargs) File "/usr/lib/python2.7/dist -packages/pyaudio.py ", kab 442, hauv _init_ self._stream = pa.open (** kev sib cav) IOError: [Errno Invalid sample rate] -9997

OK, kho RATE thiab CHUNK zoo li qhov no zoo li tau txais ntxiv:

diff --git a/client/mic.py b/client/mic.py

index 401cddb..dee49fe 100644

--- a/tus neeg siv khoom/mic.py

+++ b/client/mic.py

@@ -93, 8 +93, 8 @@ chav kawm Mic:

"""

THRESHOLD_MULTIPLIER = 1.8

NOS = 16,000

PIB = 1024

RATE = 44100 # 16000

+ CHUNK = 4096 # 1024

# tus naj npawb ntawm vib nas this los tso cai rau pib qhov pib

THRESHOLD_TIME = 1

Kauj Ruam 6: OUTPUT Screenshots

Pom zoo: