Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Teeb (tsis muaj taub hau) Raspberry Pi W
- Kauj Ruam 2: Nruab Nruab Xov Tooj Cua Xov Tooj Cua
- Kauj Ruam 3: Txhim Kho Software Ntxiv
- Kauj Ruam 4: Nrhiav Xov Tooj Cua Xov Tooj Cua
- Kauj Ruam 5: Tsim Circuit Court
- Kauj Ruam 6: Xeem Nws
- Kauj Ruam 7: Muab Rau Hauv Qhov Chaw Ruaj Ntseg
- Kauj Ruam 8: Teeb Txoj Haujlwm Kom Ua Haujlwm Thaum Pib
Video: Senior Radio - Raspberry Pi: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Qhov Kev Tshaj Lij Tshaj Lij Tshaj Lij yog qhov qhib tau siv tau tsim cov xov tooj cua internet uas muaj cov khoom siv kho vajtse thiab software. Nws yog npaj los siv rau cov neeg siv paub nrog kev tswj hwm lub xov tooj cua hauv hnab tshos qhov twg hu xov tooj tswj lub ntim thiab xaiv lub xov tooj cua chaw nres tsheb. Txoj haujlwm tau tsim nrog tus neeg siv-tus qauv tsim, tsom mus rau tus neeg siv uas xav tau qhov loj me thiab kev tswj hwm raws li tus qauv xov tooj cua.
Nws tau tsim los kom ua tiav cov kev xav tau ntawm kev tso cai rau cov tib neeg tsis muaj peev xwm tuaj yeem mloog ntau txhiab qhov sib txawv hauv Is Taws Nem cov ntsiab lus uas feem ntau tsuas yog ib txwm muaj nyob hauv internet browser. Coob leej neeg tsis muaj peev xwm siv cov cuab yeej zoo li no tau yooj yim, yog li qhov kev tsim qauv no ua kom muaj kev paub zoo rau kev siv thev naus laus zis niaj hnub no.
Cov haujlwm tseem ceeb yog nyob ntawm Github, khaws cia hauv nab hab sej 3.7.3 qhov program hu ua seniorRadio.py. Nws nyeem thiab sau json cov ntaub ntawv txhawm rau khaws lub xeev ntawm xov tooj cua, yog li thaum koj tua nws nws yuav nco txog qib suab tam sim no thiab xaiv chaw nres tsheb. Ib qho ntxiv, nws nyeem cov ntawv online json uas koj tuaj yeem hloov pauv! Qhov no tso cai rau koj hloov kho cov xov tooj cua nyob deb yog tias koj muab qhov no rau lwm tus.
Tam sim no nws tau tsim los txuas rau tus hais lus bluetooth, tab sis tuaj yeem ua tau yooj yim los ua tawm ntawm tus neeg hais lus sab hauv ib yam.
Tus tsim cov cuab yeej no zoo li tsis yog tus siv, thiab xav tau yam tsawg kawg qee qhov kev paub nrog khoom siv hluav taws xob thiab kev paub ua haujlwm yooj yim. Kev paub Linux kuj tseem muaj txiaj ntsig zoo.
Rau tus neeg siv, kev ua haujlwm yog yooj yim:
Ntawm lub zog nws yuav ua lub chaw nres tsheb zaum kawg uas tau xaiv dua lub cuab yeej siv lub suab. Sab laug hu tswj lub chaw nres tsheb, qhov twg ob peb nias ntawm lub xov tooj hloov mus rau qhov URL tshiab. Nws yuav yob dua tom qab nkag los zaum kawg lossis thawj zaug. Txoj cai hu xov tooj tswj lub suab. LED qhia tias txoj haujlwm tau ua. Thiab lub laub khawm nres lossis "tua" lub xov tooj cua. Yog li thaum siv lub zog, tus neeg siv tuaj yeem nias lub pob kom ncua/ua si, lossis "tua/qhib", xov tooj cua thiab ob lub xov tooj los tswj nws.
Khoom siv
Txuas ntawm txhua yam khoom yog qhov tshwj xeeb uas kuv tau siv. Nqi kuv li $ 60 tag nrho nrog rau cov khoom siv seem!
Kev paub siv hluav taws xob yooj yim thiab linux - rau kev sib dhos thiab debugging
Raspberry Pi Zero W (Xoom WH muaj lub taub hau ua ntej muag thiab yuav muaj txiaj ntsig)
MicroSD daim npav -8 GB+ thiab muaj peev xwm o
MicroUSB 5V lub zog hloov pauv - Txuas kuj suav nrog microHDMI adapter thiab microUSB OTG rau USB A adapter rau teeb tsa yog tias koj xav tau
Hais lus Bluetooth
M/F thiab M/M jumper cables
2 Teb encoder - txuas tib yam li saum toj no
Cov ntawv me me
Pushbutton
LED (xaiv tau) - yuav LED + laub khawm saum toj no
Lub thawv rau ntim
Kauj Ruam 1: Teeb (tsis muaj taub hau) Raspberry Pi W
Peb yuav tsum teeb tsa lub operating system ntawm raspberry pi uas yuav ua haujlwm software. Tsis muaj ib yam tshwj xeeb rau txoj haujlwm no. Txog kev debugging, Kuv xav kom teeb tsa nws kom koj tuaj yeem nkag tau nws hauv hom tsis muaj hau. Qhov no txhais tau tias koj nkag mus rau pi hla koj li WiFi network los ntawm GUI lossis lub davhlau ya nyob twg SSH thiab tsis xav tau keyboard, nas, thiab saib xyuas kom siv nws txhua lub sijhawm. Koj tuaj yeem ua qhov no yam tsis tas yuav txuas mus rau tus saib xyuas/nas/keyboard puas tau yog tias koj muaj txuj ci ntau dua. Qee cov lus qhia piv txwv ntawm no. Txawm li cas los nws yog qhov ncaj ncaj rau pem hauv ntej, thiab hauv qab no yog lwm txoj hauv kev los teeb tsa nws.
Thawj zaug no koj yuav xav tau:
- Raspberry Pi W.
- MicroSD rau SD daim npav adapter [sau OS mus rau SD daim npav]
- MicroSD daim npav (~ 8 GB+) [khaws OS thiab peb txoj haujlwm]
- MicroUSB zog (5V)
- MicroUSB rau USB A [rau nas/keyboard]
- Mini HDMI rau HDMI adapter [rau tso zis]
- Keyboard
- Nas
- Saib xyuas
Ua ntej, koj yuav tsum tau nyem lub kaw lus ua haujlwm mus rau rPi micro SD daim npav.
Kuv siv raspian buster, koj rub qhov no mus rau lub khoos phis tawj nrog daim npav SD nyeem/sau ntawv thiab tom qab ntawd nyem qhov raspian OS mus rau SD card. BalenaEtcher yog software yooj yim los ua qhov no
Tom ntej no muab daim npav SD tso rau hauv tus lej pi, txuas tus saib xyuas, keyboard thiab lub zog. Ua mus ntxiv los ntawm cov txheej txheem teeb tsa uas raspian hais kom koj ua, suav nrog txuas nws mus rau koj li Wi -nkaus network thiab txuas koj lub bluetooth hais lus los ntawm GUI. Kev xyaum zoo yuav yog hloov kho nws siv cov lus txib hauv qab no
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
Yog tias koj xav suav nrog cim koj tus pi tsis muaj lub taub hau, peb yuav tsum tau tuav tus pi tus IP chaw nyob ua ntej. Los ntawm lub davhlau ya nyob twg koj tuaj yeem pom nws los ntawm
ifconfig
hais kom ua Tom qab ntawd koj yuav tsum pab kom SSH thiab VNC hla cov kev xaiv cuam tshuam hauv
sudo raspi-teeb tsa
Tom qab rov pib dua, tam sim no koj tuaj yeem sim nkag mus rau pi hla SSH lossis VNC. SSH tsuas yog lub davhlau ya nyob twg interface, thiab koj tuaj yeem pom nws yooj yim dua siv GUI los ua ke tus hais lus bluetooth. Koj tuaj yeem siv qhov program zoo li VNC txuas kom nkag tau yooj yim rau koj pi ntawm lub khoos phis tawj cais ntawm koj lub network. Koj tuaj yeem siv qhov program zoo li putty rau SSH rau hauv.
Ib qho ntxiv, koj tuaj yeem teeb tsa VNC tus account huab kom koj tuaj yeem nkag mus rau lub cuab yeej tawm network yog xav tau
Kauj Ruam 2: Nruab Nruab Xov Tooj Cua Xov Tooj Cua
Qhov no tuaj yeem ua tiav los ntawm lub qhov rai dav dav ntawm raspberry pi. Ua ntej tshaj kom ntseeg tau tias koj tau teeb tsa git
sudo apt-tau nruab git
Nyob ntawm seb lub operating system twg koj tau teeb tsa, cov kauj ruam no yuav txawv raws li koj yuav xav tau teeb tsa pob ntxiv, lub kaw lus yuav qhia koj yog tias muaj. Ua ntej peb xav tau rub tus lej xov tooj cua laus los ntawm github. https://github.com/Bunborn/seniorRadio Qhov zoo tshaj, koj tau ua peb tus kheej repo yog li koj tuaj yeem hloov pauv thiab hloov pauv xov tooj cua tau yooj yim ib yam li kuv ua. Diav lub repo yog tias muaj
Txawm li cas los xij, koj tuaj yeem siv tib yam li kuv tsis muaj teeb meem yog tias koj xav tuav koj lub xov tooj cua json cov ntaub ntawv hauv lwm qhov chaw
Tom qab ntawd clone qhov repo hauv qhov chaw twg koj xav kom nws ua. Cov ntawv teev npe tsis raug yog qhov zoo. Tau txais qhov URL uas github repo koj xav tau los ntawm tsoo lub pob zeb ntsuab lossis rub tawm khawm.
Rov qab rau hauv lub davhlau ya nyob twg qhov rai, git clone
Tam sim no koj yuav tsum pom cov npe ntxiv npe seniorRadio thaum saib siv ls. Zoo heev!
Txoj cai txhais tau tias yog ua tus kheej cov ntaub ntawv, ua tib zoo saib nws yuav muaj txiaj ntsig. Tshwj xeeb tshaj yog rau lub hom phiaj debugging thiab yog tias koj tab tom hloov pauv qhov system.
Kauj Ruam 3: Txhim Kho Software Ntxiv
Ua ntej peb txav mus rau hauv Circuit Court thiab sim nws tawm, peb kuj yuav tsum rub tawm VLC thiab nab hab sej api rau nws. Tej zaum koj twb muaj VLC teeb tsa lawm. Thawj ob lo lus txib yuav hloov kho pi, thiab ob lo lus txib kawg hauv qab no yuav teeb tsa VLC thiab tom qab ntawd nab hab sej api
sudo apt-tau hloov tshiab
sudo apt-tau hloov tshiab
sudo snap nruab VLC
sudo apt-tau nruab vlc-python
Ib qho ntxiv, kuj nruab gpiozero, uas peb yuav siv los cuam tshuam nrog pi tus GPIO pins. Tej zaum koj twb tau teeb tsa nws nyob ntawm koj lub operating system.
sudo apt-tau nruab gpiozero
Kauj Ruam 4: Nrhiav Xov Tooj Cua Xov Tooj Cua
Tom ntej no, ib qho ntawm qhov lom zem tshaj plaws! Lub sijhawm los xaiv cov kwj dej uas koj xav tau.
Hauv kuv cov ntaub ntawv internetStations.json koj tuaj yeem pom kuv cov kwj txuas, feem ntau yog xov xwm thiab nkauj. Tab sis muaj ib tuj ntawm cov ntsiab lus tuav tawm muaj. Qhov tseem ceeb ntawm no yog txhawm rau nrhiav ncaj qha kwj URL qhov chaw nyob. Piv txwv li, BBC xov xwm thiab chaw nres tsheb nkauj tuaj yeem pom ntawm no ntawm blog no. Cov kwj dej ncaj qha no yuav tsis muaj cov duab sib cuam tshuam thiab yuav cia li ua si kwj los ntawm koj tus browser media player. Nov yog cov URL uas peb xav tau kom VLC tuaj yeem nyeem lawv! Koj tuaj yeem sim txhua qhov txuas nrawm hauv koj lub vev xaib broswer, lossis hla VLC ntawm koj lub khoos phis tawj ib txwm kom ntseeg tau tias nws yuav ua haujlwm ntawm pi.
Txhawm rau nrhiav cov chaw nres tsheb no, koj tuaj yeem nrhiav ncaj qha hauv online yog tias cov kev pabcuam cuam tshuam nws. Txoj hauv kev nrawm kuj tseem tuaj yeem ua kwj dej, nyem rau ntawm qhov browser thiab ntaus "tshuaj xyuas ntu". Nkag mus rau lub network tab thiab nws yuav tsum qhia cov kwj dej 'ncaj qha' URL. Daim vis dis aus youtube no qhia txog qhov no. Hloov kho nplooj ntawv nrog qhib tab yuav tsum pab.
Thaum koj muaj koj cov chaw nres tsheb, koj xav muab tso rau hauv online yog li koj cov lausRadio nab hab sej txoj haujlwm tuaj yeem nqa lawv. Muaj ntau txoj hauv kev los ua qhov no, koj tuaj yeem siv cov vev xaib zoo li Github, bitbucket, lossis txawm tias sourceforge. Lub hom phiaj tseem ceeb ntawm kev tuav cov npe hauv online no yog li tus neeg siv teeb tsa nws tuaj yeem hloov pauv cov npe hauv online nyob deb.
Thaum pib ntawm qhov kev pab cuam nab nab muaj qhov sib txawv hu ua url, hloov pauv qhov no kom yog qhov URL ntawm koj cov ntaub ntawv json nrog cov chaw nres tsheb URL txuas
Koj tuaj yeem ua raws tib hom ntawv zoo li kuv cov ntaub ntawv internetStation.json. Yog tias koj xav tau kuj siv github, koj tuaj yeem yooj yim raus kuv tus kws sau xov xwm seniorRadio, thiab kho koj tus kheej cov ntaub ntawv internetStation.json thiab taw tes rau qhov ntawd "raw" URL. Koj tuaj yeem pom qhov hauv qab no hauv Github GUI thaum koj nyem rau ntawm cov ntawv.
Kauj Ruam 5: Tsim Circuit Court
Tam sim no peb yuav tsum teeb lub Circuit Court. Qhov no yuav hloov pauv raws koj cov cuab yeej siv, tab sis hauv qab no yog qhov kuv teeb tsa kuv li cas.
pinout.xyz/ rau kev siv ntawm tus pin yog leej twg. Txij li thaum peb siv lub tsev qiv ntawv gpiozero, peb txhawj xeeb nrog BCM tus lej tus lej nkaus xwb. Nco ntsoov tias kuv yuav ob peb ntxiv KY040 cov cav nkag teb chaws - cov xov tooj - los ntsuas lawv vim tias lawv txhua tus tsis yog txhua tus muaj qhov raug tib yam. Txhua tus yuav muaj qee qhov "thaws rov los", lossis tsuas yog tso tawm tsis raug, yog li kuv tau xaiv qhov zoo tshaj plaws ntawm ob qhov kuv muaj. Hauv cov cai koj yuav nco ntsoov muaj qee cov kauj ruam los txwv qhov kev sib tw no ib yam.
Kuv txuas kuv lub laub khawm rau BCM tus pin 17 thiab hauv av
Kuv LED mus rau 1k ohm resistor ces BCM tus pin 27 thiab hauv av
Kuv KY040 rotary encoders muaj + coj mus rau 5V, GND rau hauv av thiab SW txuas nrog. Cov no tau txuas nrog lub khob cij me me
Chaw nres tsheb teb encoder dt tus pin txuas nrog BCM tus pin 21
Chaw nres tsheb rotary encoder clk tus pin txuas nrog BCM tus pin 20
Qib suab teb encoder dt tus pin txuas nrog BCM tus pin 19
Qib suab teb encoder clk tus pin txuas nrog BCM tus pin 16
Yog tias koj hloov cov pins no, tsuas yog hloov tus lej hauv qhov kev pab cuam nab nab thiab qhov uas nws teeb tsa tus tuav
Kuv siv daim ntawv me me ua kom yooj yim dua. Kuv siv M/M thiab M/F jumper xov tooj ib yam los pab txhawb lub interface. Kuv tau siv qee lub jumper hlau coj mus rau tus pin ntawm lub laub khawm/LED Kuv tau yuav ua ntej. Txhawm rau tsis xeb, koj tuaj yeem tau txais cov laub khawm thiab LEDs uas twb muaj cov hlua hlau txuas lossis yuav yooj yim txuas rau ib qho.
Kauj Ruam 6: Xeem Nws
Tam sim no, koj yuav tsum muaj lub kaw lus ua haujlwm! Wb sim nws tawm. Nkag mus rau daim nplaub tshev nrog qhov kev pab cuam nab nab, zoo li:
cd seniorRadio
python3 seniorRadio.py
Tam sim no, muaj qhov ncua sijhawm thib ob 45 ntawm qhov pib ntawm txoj haujlwm los muab sijhawm rau nws los nrhiav tus hais lus bluetooth ntawm lub zog. Koj tuaj yeem tawm tswv yim tawm kab no yog tias koj tsis xav tau nws thaum ntsuas. Qhov kev zov me nyuam yuav qhia koj tias koj xav tau los nruab pob ntxiv, mus tom ntej yog tias muaj. Tej zaum kuj yuav tsum tau teeb tsa ib qho tshiab ntawm Python.
sudo apt-tau nruab nruab sej 3.7
Qee qhov teeb meem tuaj yeem txawm tias qhov haujlwm ua haujlwm:
Kuv tsis hnov suab
Xyuas kom tus neeg hais lus nyob thiab xaiv hauv koj li raspberry pi. Los ntawm GUI koj yuav tsum muaj peev xwm ua khub nws thiab tom qab ntawd xaiv nws raws li koj lub cuab yeej tso tawm suab. Ib qho ntxiv, txheeb xyuas koj lub suab tsav tsheb. Ib qho teeb meem tshwm sim yog koj yuav xav tau rov nruab pob pulseaudio
Suab choppy lossis txiav hauv thiab tawm
Sim txav lub cuab yeej kom ze rau koj li WiFi router. Ib qho ntxiv, nco ntsoov tias tus hais lus bluetooth nyob ze. Tseem tuaj yeem yog qhov teeb meem tsav tsheb
Kauj Ruam 7: Muab Rau Hauv Qhov Chaw Ruaj Ntseg
Ntxiv mus, muab nws tso rau hauv ib lub thawv lossis cov cuab yeej zoo sib xws rau nws kom nyob tau mus tas li. Kuv pom zoo kom muaj ib qho uas koj tuaj yeem nkag mus tau tom qab tseem rau kev debugging. Kuv tau txais lub thawv ntoo me me ntawm lub khw muag khoom rau $ 2, thiab txuas nws ntawm nplooj ntawv khoom siv. Kuv ib tus phooj ywg tau pom zoo rau lub thawv luam yeeb.
Tom qab ntawd kuv txiav tawm qhov nyob rau sab xub ntiag rau lub laub khawm thiab cov hloov pauv hloov, thiab siv lub qhov nyob tom qab ntawm lub thawv rau lub microUSB fais fab qaum.
Kuv tau sim lub mount thiab ua kom ntseeg tau tias nws ua haujlwm, thiab voilà!
Thaum kawg, Kuv siv super kua nplaum los tuav lub laub khawm. Kuv daim ntawv qhia zaub mov muaj cov nplaum rau hauv qab uas kuv txuas rau ib feem ntawm lub thawv. Kuv siv daim kab xev me me txhawm rau txhawm rau sab nraub qaum ntawm lub npov rau hauv lub npov, yog li nws tuaj yeem txav tom qab yog xav tau.
Kauj Ruam 8: Teeb Txoj Haujlwm Kom Ua Haujlwm Thaum Pib
Thaum kawg, koj yuav xav tau qhov kev pab cuam nab nab los khiav ntawm kev pib ntawm raspberry pi yog li koj tsis tas yuav ua nws tus kheej. Muaj ntau txoj hauv kev los ua qhov no uas koj tuaj yeem pom hauv online.
Tus kheej, Kuv teeb tsa nws siv ob txoj hauv kev ntawm SparkFun nyeem no:
Ntawm no, nws tos rau lub kaw lus nkag mus rau lub khoos phis tawj duab ua ntej ua haujlwm qhov program. Tom qab ntawd nws tau ncua los ntawm qhov kev pab cuam nab nab rau 45 vib nas this los muab sijhawm rau lub kaw lus rov txuas rau lub mloog pob ntseg. Yog tias koj siv tus hais lus sib xyaw, koj tuaj yeem tshem qhov kev ncua no. Nco ntsoov tias tus hais lus bluetooth yuav tsum yog thawj zaug! (rau kev daws teeb meem bluetooth)
Tam sim no koj tuaj yeem sim tua lub zog thiab rov ua kom muaj zog ntawm koj tus pi! Tom qab li 90 vib nas this koj tus pi yuav tsum pib ua si hauv xov tooj cua ib zaug ntxiv. Thaum tsoo lub laub khawm nws yuav ncua/ua si. Nco tseg ntawm cov reboots nws rov nyeem dua tias internetStations json cov ntaub ntawv yog li yog tias koj hloov koj cov chaw nres tsheb koj yuav tsum rov pib dua lub cuab yeej rau lawv ua haujlwm. Nrog koj zoo siab!
Yog tias koj ua qhov no, lossis hloov kho qhov project, thov qhia rau kuv paub!
Github nplooj ntawv:
Pom zoo:
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom - Cov Kauj Ruam ntawm Kauj Ruam: 4 Kauj Ruam
Arduino Tsheb Rov Qab Chaw Nres Tsheb Ceeb Toom | Cov kauj ruam ib kauj ruam: Hauv txoj haujlwm no, kuv yuav tsim qhov yooj yim Arduino Tsheb Rov Qab Tsheb Nres Tsheb Nres Sensor Siv Arduino UNO thiab HC-SR04 Ultrasonic Sensor. Qhov no Arduino raws Lub Tsheb Rov Qab ceeb toom tuaj yeem siv rau Kev Tshawb Fawb Txog Tus Kheej, Robot Ranging thiab lwm yam
Tsev Automation Kauj Ruam ntawm Kauj Ruam Siv Wemos D1 Mini Nrog PCB Tsim: 4 Kauj Ruam
Tsev Automation Kauj Ruam Ib Leeg Siv Wemos D1 Mini Nrog PCB Tsim: Tsev Automation Kauj Ruam los ntawm Kauj Ruam siv Wemos D1 Mini nrog PCB Tsim cov tub ntxhais kawm ntawv qib siab. Tom qab ntawd ib tus ntawm peb cov tswv cuab tuaj
RC Taug Qab Neeg Hlau Siv Arduino - Kauj Ruam Ib kauj ruam: 3 Kauj Ruam
RC Tracked Robot Siv Arduino - Kauj Ruam Ib Nrab: Hav guys, Kuv rov qab los nrog lwm tus neeg hlau txias chassis los ntawm BangGood. Vam tias koj tau dhau los ntawm peb cov phiaj xwm yav dhau los - Spinel Crux V1 - Tus Cwj Pwm Tswj Tus Neeg Hlau, Spinel Crux L2 - Arduino Xaiv thiab Muab Neeg Hlau nrog Robotic caj npab thiab Badland Braw
Kawm Yuav Ua Li Cas Kos Tus Tswm Ciab - Kauj Ruam Ib Kauj Ruam: 6 Kauj Ruam
Kawm Yuav Ua Li Cas Thiaj Li Tswmciab - Kauj Ruam Ib kauj ruam: Cov tswm ciab no siv sijhawm 10 feeb los kos yog tias koj ua raws kuv cov kauj ruam ua tib zoo
HAUJ LWM HAM - TUAJ HANDHELD RADIO INTO MOBILE RADIO: 6 Kauj Ruam
HAP CHAM - HNUB HANDHELD RADIO INTO MOBILE RADIO: Txawb xov tooj cua ham ntawm pob nyiaj siv nruj? Yog, Nws tuaj yeem ua tiav nrog qee qhov kev muaj tswv yim. Muaj plethora ntawm pheej yig Suav tes xov tooj cua tawm muaj. Cov xov tooj cua tshiab uas pheej yig no tau tig rov los txo tus nqi ntawm kev siv cov iav zoo. Lwm qhov uas ntxiv