Cov txheej txheem:
- Kauj Ruam 1: Teeb Azure IoT Hub
- Kauj ruam 2: Teeb Raspberry Pi
- Kauj Ruam 3: Tsim Cov Khoom Siv hauv Azure IoT Hub
- Kauj Ruam 4: Siv Txoj Cai ntawm Raspberry Pi thiab Txuas Nrog Azure IoT Hub
- Kauj Ruam 5: Saib Cov Ntaub Ntawv Telemetry hauv Azure IoT Hub
Video: Kev Teeb Raspberry Pi Nrog Azure IoT Hub: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Lub hom phiaj ntawm cov lus qhia no yog kom tau txais kev coj ua ntawm kev nthuav tawm rau lub peev xwm ntawm Azure IoT Hub. Kab lus npog kev kos npe rau Azure IoT Hub, teeb tsa Raspberry Pi, thiab txuas Pi nrog Azure IoT Hub xa xov tooj cua.
Yam koj yuav tau txais:
- Ua haujlwm Raspberry Pi nrog Node.js program xa cov ntaub ntawv xov tooj cua mus rau Azure IoT Hub
- Azure IoT Hub tau txais cov ntaub ntawv xov tooj cua
Leej twg yog tus nyob hauv lub vaj tsiaj:
Raspberry Pi: Raspberry Pi yog qhov kev sib cav nrov tshaj plaws hauv computer txhua lub sijhawm. Nws yog me me, pheej yig thiab yooj yim rau teeb. Kab lus ua haujlwm nrog Raspberry Pi 3+ version.
Azure IoT Hub: IoT Hub yog huab-tswj kev pabcuam uas nyob nruab nrab ntawm IoT cov cuab yeej thiab cov txheej txheem rov qab tshuaj xyuas/ua haujlwm. Kev tswj hwm kev siv xov tooj cua thiab cov ntaub ntawv los ntawm coob tus IoT cov cuab yeej, tswj hwm lub xeev cov cuab yeej thiab ua kom muaj kev nyab xeeb thiab ntseeg tau yog qhov nyuaj hauv IoT-kev daws teeb meem nthuav dav. Azure IoT Hub daws qhov teeb meem no los ntawm kev ua lub hauv ntej-kab cuam tshuam rau ntau lab ntawm cov cuab yeej los txuas rau nws ntseeg tau thiab nyab xeeb, thiab tom qab ntawd nws tso cai rau xa cov ntaub ntawv, cov cim thiab xov tooj cua rau kev ua rau hauv qab huab-raws li backend system. Kab lus no ua rau siv Microsoft muab cov qauv piv txwv hauv GitHub.
Kauj Ruam 1: Teeb Azure IoT Hub
- Sau npe rau * dawb * Azure tus lej sim los ntawm kev mus saib Azure lub vev xaib. Thaum koj tus lej Azure tau nce thiab ua haujlwm, mus rau cov ntawv qhia zaub mov ntawm Tsev Nplooj Ntawv thiab nyem rau ntawm Tsim Cov Khoom.
- Tshawb nrhiav IoT Hub hauv cov npe khoom, xaiv IoT Hub los ntawm cov txiaj ntsig thiab nyem Tsim.
- Nkag mus rau qhov tseem ceeb hauv qab no los teeb tsa Azure IoT Hub thiab nyem rau 'Tshawb Xyuas thiab Tsim'
Kev tso npe: F1 - Tier Dawb
Pab Pawg Pabcuam: qhov no yog sau cov peev txheej. Yog tias koj muaj cov khoom sau tam sim no, xaiv qhov ntawd lossis tsim pab pawg tshiab (nws tsuas yog xav tau lub npe)
Cheeb Tsam: xaiv koj cheeb tsam
IoT Hub lub npe: sau lub npe tshwj xeeb
Lub kaw lus yuav siv ob peb feeb los tsim Azure IoT Hub cov peev txheej tshiab. Thaum npaj txhij, nyem rau nws kom pom cov khoom siv dashboard
Kauj ruam 2: Teeb Raspberry Pi
Txuag Raspbian Buster ntawm SD daim npav los ntawm koj lub Windows lossis Mac tshuab. Ntxig daim npav SD hauv Raspberry Pi thiab khau raj. Thaum lub desktop tshwm, txuas rau Wi-nkaus.
Txog kev daws teeb meem, mus ntsib Raspberry Pi cov ntaub ntawv raug cai.
Kauj Ruam 3: Tsim Cov Khoom Siv hauv Azure IoT Hub
- Rov qab mus rau Azure portal thiab nyem rau ntawm IoT Devices hauv Azure IoT Hub peev txheej nplooj ntawv. Nyem '+TSHIAB' los tsim lub cuab yeej tshiab
- Nkag mus rau Tus Ntaus ID (lub npe paub tau), tawm ntawm thaj chaw uas tsis muaj txiaj ntsig thiab nyem Txuag
- Qhov no yuav tsim cov cuab yeej hauv IoT Hub
- Nyem rau ntawm lub cuab yeej thiab luam thawj txoj hlua txuas
Kauj Ruam 4: Siv Txoj Cai ntawm Raspberry Pi thiab Txuas Nrog Azure IoT Hub
Microsoft tau tshaj tawm cov qauv piv txwv, pib sai thiab qhia hauv GitHub kom pib sai rau IoT Hub cov haujlwm. Peb yuav siv Raspberry Pi qhia. Cov ntawv qhia siv node.js tab sis tsis txhob txhawj, koj tsis xav tau kev paub ua haujlwm ntawm node.js los tsim txoj haujlwm no.
- Txuas rau lub cuab yeej siv SSH tus thov kev pab. Feem ntau hais lus, nws yuav yog PuTTY rau Windows thiab Terminal rau Mac tshuab.
- Txuas rau Raspberry Pi
Txheeb xyuas Node.js version, nws yuav tsum ntau dua 10
node -v
Tau txais qhov chaws los ntawm GitHub rau Raspberry Pi
git clone
Mus rau kab ntawv teev npe thiab teeb tsa
cd azure-iot-sample-node/iot-hub/Tutorials/RaspberryPiApp
npm nruab
- Tom ntej no, peb yuav teeb tsa lub app kom xa 'simulated' cov ntaub ntawv ntsuas kub mus rau Azure IoT Hub. Mus rau hauv daim nplaub tshev thiab hloov kho config.json los ntawm kev hais kom ua lossis Raspberry Pi desktop. Hloov cov ntawv tseem ceeb kom 'muaj tseeb'
- Rov qab mus rau SSH tus neeg siv khoom thiab nkag mus rau yav dhau los theej cov cuab yeej Txuas Kev Sib Txuas los txuas Raspberry Pi mus rau Azure IoT Hub
sudo node index.js 'Cov cuab yeej sib txuas txoj hlua los ntawm Azure IoT Hub'
Kauj Ruam 5: Saib Cov Ntaub Ntawv Telemetry hauv Azure IoT Hub
Txhawm rau saib cov ntaub ntawv xov tooj cua tau txais hauv Azure IoT Hub, peb yuav siv Visual Studio Code. Yog tias koj tsis muaj VS Code twb tau teeb tsa, thov rub tawm los ntawm lub vev xaib.
- Qhib Visual Studio Code thiab nyem rau ntawm Extensions. Nruab Azure IoT Hub txuas ntxiv
- Thaum qhov txuas txuas tau teeb tsa, nyem rau ntawm Azure IoT Hub hauv explorer. Nws yuav nug koj kom nkag mus nkag rau Azure Portal thiab tom qab ntawd yuav qhia Azure IoT Hub cov peev txheej thiab Raspberry Pi ntaus ntawv
- Txoj cai-nias ntawm lub cuab yeej thiab nyem rau ntawm 'Pib Saib Xyuas Built-in Txheej Txheem Qhov kawg'. Qhov no yuav pib qhia cov ntaub ntawv xov tooj cua tau txais los ntawm Raspberry Pi
Ib sab ntawm ib sab saib pom SSH tus thov (xa cov ntaub ntawv mus rau Azure IoT Hub) thiab Visual Studio Code (qhia cov ntaub ntawv xov tooj cua tau txais ntawm Azure IoT Hub).
Vam tias koj pom nws nthuav thiab muaj txiaj ntsig. Xav tias dawb los qhia koj cov lus tawm tswv yim. Zoo siab Raspberry Pi-/ing/
Pom zoo:
Maus Tail Teeb Nrog Cov Teeb Pom Kev Zoo Siv Lub Teeb LED: 4 Cov Kauj Ruam
Maus Tail Teeb Nrog Cov Teeb Pom Kev Zoo Siv Lub Teeb LEDs: Nyob Zoo! Qhov no yog qee qhov yooj yim DIY ntawm yuav ua li cas thiaj li tsim tau qhov kev cai Programmable RGB Tail Teeb (nrog ua ke ntsais muag/ntsuas ntsuas) rau koj lub maus taus lossis tej zaum muaj ib yam dab tsi siv WS2812B (tus kheej qhov chaw nyob leds) thiab Arduinos . Muaj 4 hom teeb pom kev zoo
DIY LED Teeb - Niaj Hnub Teeb Meem Teeb Nrog Cov Chaw Taws Teeb: 8 Kauj Ruam (nrog Duab)
DIY LED Teeb - Niaj Hnub Teeb Mood Teeb Nrog Chaw Taws Teeb: Hauv kab lus no kuv yuav mus hla cov txheej txheem Kuv tau siv los tsim qhov no zoo heev pyramid zoo li tus LED Mood Teeb.Kuv siv maple rau cov qauv tseem ceeb thiab qee qhov mahogany txhav ntxiv rau lub zog. Rau lub teeb Kuv siv RGB LED teeb uas tuaj nyob hauv 16 ko taw
Cov Khoom Siv Teeb Pom Kev Zoo (Cov Kev Tshawb Fawb Technology - TfCD - Tu Delft): 12 Cov Kauj Ruam (nrog Duab)
Cov Teeb Pom Kev Zoo Wearable (Kev Tshawb Fawb Txog Technology - TfCD - Tu Delft): Hauv Cov Lus Qhia no koj yuav kawm paub yuav ua li cas kom ua koj tus kheej lub teeb pom kev uas koj tuaj yeem hnav! Qhov no yog ua tiav los ntawm kev siv EL thev naus laus zis npog nrog cov vinyl decal thiab txuas cov hlua rau nws kom koj tuaj yeem hnav nws ncig koj txhais caj npab. Koj tseem tuaj yeem hloov pauv ib feem ntawm qhov p
LED Teeb Teeb Duab Cwjmem: Cov Cuab Yeej rau Teeb Teeb Doodles: 6 Kauj Ruam (nrog Duab)
LED Teeb Teeb Lub Cwjmem: Cov Cuab Yeej rau Teeb Doodles: Kuv tus poj niam Lori yog tus neeg siv tsis tu ncua thiab kuv tau ua si nrog kev yees duab ntev ntev rau ntau xyoo. Kev tshoov siab los ntawm PikaPika pab pawg teeb pom kev zoo thiab yooj yim ntawm cov koob yees duab digital peb tau siv lub teeb duab kos duab kom pom tias peb tuaj yeem ua dab tsi
Ib qho $ 20 / 20min Kev Lag Luam Zoo Folding Lub Teeb Lub Teeb / Lub Tsev Teeb: 7 Cov Kauj Ruam (nrog Duab)
A $ 20 / 20min Kev Lag Luam Zoo Folding Lub Teeb Lub Teeb / Lub Tsev Teeb: Yog tias koj tau tab tom nrhiav DIY lub thawv rau lub teeb rau cov khoom lag luam lossis kaw cov duab koj twb paub tias koj muaj ntau txoj kev xaiv. Los ntawm cov thawv ntawv thawv rau khaub ncaws hampers koj yuav xav tias txoj haujlwm tau ua tiav kom tuag. Tab sis Tos! Rau $ 20