Cov txheej txheem:
- Kauj ruam 1: Txuas Kho Vajtse
- Kauj Ruam 2: Tsim IoT Platform Resources
- Kauj Ruam 3: Tsim Hom Ntaus Ntawv thiab Ntaus Ntawv
- Kauj Ruam 4: Tsim Cov Ntawv Pov Thawj Ua Haujlwm rau Cloudant
- Kauj Ruam 5: Sau npe rau Twilio
- Kauj Ruam 6: Txhim Kho Cov Pob Yuav Tsum Tau Ua ntawm Cov Khoom Saib Xyuas Cog
- Kauj Ruam 7: Teeb Node Red Application for Plant Monitoring Device
- Kauj Ruam 8: Teeb Node Red Application for Server
- Kauj Ruam 9: Teeb Pi Web Server
- Kauj ruam 10: Ntxiv Code rau Cov Ntaub Ntawv hauv Web Server
- Kauj ruam 11: Pib Nws
Video: IoT Kev Saib Xyuas Cog Ntoo (Nrog IBM IoT Platform): 11 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Txheej txheem cej luam
Cov Txheej Txheem Saib Xyuas Kev Tsob Ntoo (PMS) yog daim ntawv thov tsim nrog cov tib neeg uas nyob hauv chav kawm ua haujlwm nrog tus ntiv tes xoo ntsuab hauv siab.
Niaj hnub no, cov tib neeg ua haujlwm ntau dua li yav tas los; txhim kho lawv txoj haujlwm thiab tswj hwm lawv cov nyiaj txiag. Cov sijhawm ua haujlwm tau ntev dua, ua rau cov neeg no muaj sijhawm tsawg dua los ua tej yam uas lawv nyiam.
Qhov no tsim teeb meem rau cov tib neeg uas muaj tus ntiv tes xoo ntsuab, ua haujlwm ntev ntxiv thiab tsis muaj tus pab cuam nyob hauv tsev zoo li lawv cov nroj tsuag.
Yog li, PMS tau tsim los pab cov tib neeg no hauv kev muab kev saib xyuas zoo dua, tab sis tseem ua kom ntseeg tau tias muaj kev loj hlob zoo rau lawv cov nroj tsuag tom tsev thaum lawv ua haujlwm.
Cov ntsiab lus ntawm cov kauj ruam
Nram qab no yog cov ntsiab lus ntawm cov kauj ruam uas yuav ua tiav
- Txuas ntawm kho vajtse
- Teeb tsa IBM Bluemix IoT Platform
- Sau npe rau twilio
- Teeb raspberry pi (Cuab Yeej Saib Xyuas Cuab Yeej) ntawm liab
- Teeb bluemix ntawm redSetup Webserver
Kauj ruam 1: Txuas Kho Vajtse
Yuav tsum tau kho vajtse
- 2 Raspberry Pis
- 1 Cov qhob cij
- 1 GPIO Ribbon Cable
- 1 GPIO Extension Board (T-Cobbler Kit)
- 1 MCP3008 ADC (Analog Digital Converter)
- 1 DHT_11 Sensor
- 2 10k Ohm Resistors
- 1 Lub Teeb Ntsuas Tus Kws Tiv Thaiv
- 1 Cov av noo Sensor (YL-69)
- 1 Dej Qib Sensor
- 26 Cables (16 Txiv neej rau Txiv neej, 10 Txiv neej rau Poj Niam)
Txuas cov ntu
Xa mus rau daim duab thib ob ntawm cov kauj ruam no rau daim duab fritzing thiab txuas cov ntu kom haum
Kauj Ruam 2: Tsim IoT Platform Resources
- Nkag mus rau hauv koj tus lej Bluemix thiab txuas mus rau ntu IoT BoilerPlates Starter Page nplooj ntawv tshiab
- Nkag mus rau koj lub npe app thiab lub npe tos Tos rau Bluemix teeb tsa koj lub app thiab cov xwm txheej qhia tias "Koj lub app tab tom khiav" Yog tias nws tseem tsis tau khiav tom qab 10 feeb, koj yuav tsum rov pib dua koj lub app los ntawm txhaj khawm rov pib dua nyob rau saum toj txoj cai ces kaum
- Los ntawm ib sab bar, nyem rau ntawm "Kev Sib Txuas" Nyem rau ntawm iotf cov kev pabcuam txuas los ntawm cov npe sib txuas Koj yuav raug xa mus rau IOT cov kev pabcuam teeb tsa Nyem rau ntawm "Launch" khawm kom raug xa rov mus rau iotf console
-
Nco ntsoov ntawm qhov txuas uas koj tau xa rov mus rau piv txwv: https://suwdek.internetofthings.ibmcloud.com/dashboard/ 6 tus ntawv sau ua ntej ntawm ".internetofthings.ibmcloud.com/dashboard/" yog koj lub koom haum ID. Nco ntsoov nws.
Kauj Ruam 3: Tsim Hom Ntaus Ntawv thiab Ntaus Ntawv
- Koj yuav tsum yog koj li IOT Platform console.
- Los ntawm sab laug sab laug, nyem rau ntawm lub cuab yeej icon
- Nyem rau ntawm "Ntaus Ntaus" los ntawm sab saum toj
- Nyem rau ntawm "Add Device Type" los ntawm lub kaum sab xis saum toj
-
Sau cov ntaub ntawv hauv qab no:
- Hom: Ntaus
- Lub npe: raspberrypi
- Nqe lus piav qhia: Raspberry Pi
- Nyem rau Next, tom qab ntawd nyem rau Done
- Nyem rau "Xauj" los ntawm sab saum toj
- Nyem rau ntawm "Ntxiv Device"
-
Sau cov ntaub ntawv hauv qab no:
- Xaiv hom ntaus ntawv uas twb muaj lawm: raspberrypi
- Tus nab npawb ID: pms1
- Nyem txuas ntxiv mus kom txog thaum cov ntsiab lus
- Nyem rau ua
- Koj yuav raug xa mus rau nplooj ntawv Cov Ntawv Pov Thawj Ntaus Ntawv. Thov nco ntsoov koj cov ntsiab lus ntaus ntawv. Qhov no tseem ceeb heev vim tias daim ntawv pov thawj kev lees paub tsis tuaj yeem rov qab tau
Kauj Ruam 4: Tsim Cov Ntawv Pov Thawj Ua Haujlwm rau Cloudant
- Rov qab mus rau koj lub bluemix console (https://console.bluemix.net/dashboard/apps)
- Nyem rau ntawm cloudantNoSQLDB cov kev pabcuam hauv qab Kev Pabcuam Huab Cua
- Ntawm sab, nyem rau Daim Ntawv Pov Thawj Ua Haujlwm
- Nyem rau ntawm Daim Ntawv Credential Tshiab
- Nyem Ntxiv
- Nyem Saib Cov Ntawv Pov Thawj hauv kab ntawv Kev ua ntawm koj li kev tsim tshiab kev pabcuam pov thawj
- Nco tseg cov ntawv pov thawj no. Koj yuav xav tau lawv tom qab rau kev hloov kho ntawm app.py code
Kauj Ruam 5: Sau npe rau Twilio
- Sau npe rau tus account twilio tshiab ntawm
- Thaum sau npe, koj yuav raug ceeb toom rau npe ib qhov haujlwm. Hauv kuv qhov xwm txheej, kuv lub npe hu ua Plant Monitoring system.
- Los ntawm lub sidebar, nyem rau ntawm txhua yam khoom thiab kev pabcuam thiab nyem rau ntawm SMS programmable.
- Nyem rau ntawm "Pib Pib" Raws li koj tsis muaj tus lej twilio, nyem rau "Tau txais tus lej"
- Ib qho pop nrog tus lej yuav qhia. Nyem rau "siv tus lej no"
- Nco tseg tus lej twilio no, koj yuav xav tau tom qab.
- Mus rau lub console dashboard
- Nco tseg ntawm koj tus lej SID thiab Tus Thawj Coj Token
Kauj Ruam 6: Txhim Kho Cov Pob Yuav Tsum Tau Ua ntawm Cov Khoom Saib Xyuas Cog
- Nruab Node redsudo npm nruab -g --unsafe-perm node-red
- Nruab pahosudo pip nruab paho-mqtt
- Nruab Watson IoT node rau node redsudo npm i -g node-red-contrib-ibm-watson-iot
-
Nruab BCM2835
- wget
- tar zxvf bcm2835-1.52.tar.gz
- cd bcm2835-1.48
- ./configure
- ua
- sudo ua daim tshev
- sudo ua kom nruab Nruab
- Node DHT-Sensorsudo npm nruab node-dht-sensor
- Nruab Node Pab Txhawb DHT Sensorsudo npm nruab-tsis muaj kev nyab xeeb-perm -g node-red-contrib-dht-sensor
- Pib dua koj lub pisudo reboot tam sim no
Kauj Ruam 7: Teeb Node Red Application for Plant Monitoring Device
Pib koj qhov liab los ntawm qhib Terminal thiab ntaus ntawv
pib-liab pib
Txais tos rau Node-RED ===================
20 Lub Ob Hlis 07:07:34 - [info] Node -RED version: v0.16.2
20 Lub Ob Hlis 07:07:34 - [info] Node.js version: v7.8.0 20 Feb 07:07:34 - [info] Linux 4.4.50 -v7+ arm LE 20 Feb 07:07:36 - [info] Loading palette nodes {MODE: {MODE_0: 0, MODE_1: 1, MODE_2: 2, MODE_3: 3}, CS: {tsis muaj: 64, siab: 4, qis: 0}, ORDER: {msb: tsis tseeb, lsb: muaj tseeb), Spi: [Muaj nuj nqi: Spi]} 20 Lub Ob Hlis 07:07:42 - [cov ntaub ntawv] Cov chaw teeb tsa: /home/pi/.node-red/settings.js 20 Lub Ob Hlis 07:07:42 - [cov ntaub ntawv] Cov neeg siv npe: /home/pi/.node-red 20 Lub Ob Hlis 07:07:42 - [cov ntaub ntawv] Cov ntaub ntawv ntws: /home/pi/.node-red/start 20 Lub Ob Hlis 07:07:42 - [info] Tam sim no neeg rau zaub mov khiav ntawm https://127.0.0.1: 1880/20 Feb 07:07:42 - [info] Pib ntws 20 Feb 07:07:43 - [info] Pib ntws
Qhib koj tus browser thiab txuas rau daim ntawv thov liab
Nyem rau ntawm lub cim hamburger, yuj dua "ntshuam" thiab nyem rau ntawm "ntawv los teev cia" tom qab ntawv muab cov kab ntawv muab hauv qab no tso rau hauv
[{"id": "d9ac3f49.78dc1", "type": "tab", "label": "Flow 1"}, {"id": "9b23dde8.8ae15", "type": "pimcp3008", " z ":" d9ac3f49.78dc1 "," npe ":" MCP3008 "," tus pin ": 0," dnum ": 0," x ": 636.996208190918," y ": 148.48046493530273," xov hlau ":
Nco ntsoov hloov "cov ntaub ntawv" thiab "RecordValues" IoT watson nodes xws li nws tuaj yeem txuas rau koj daim ntawv thov.
Kauj Ruam 8: Teeb Node Red Application for Server
- Nkag mus rau hauv koj tus account bluemix thiab mus rau ntawm lub dashboard (https://console.bluemix.net/dashboard/apps)
- Nyem rau kab ntawv txuas rau koj daim ntawv thov uas tau pom nyob hauv "Txoj Kev" Kab ntawm cov npe ntawm koj li Cloud Foundry Apps
- Koj yuav raug xa rov mus rau lwm nplooj ntawv, nyem rau "mus rau koj lub node liab editor"
Zoo ib yam li cov kauj ruam yav dhau los, nyem rau ntawm lub cim hamburger, yuj dua "ntshuam" thiab nyem rau ntawm "ntawv los teev cia" tom qab ntawv muab cov cai tso rau hauv qab no
[{"id": "5ef69739.4622e8", "type": "tab", "label": "Flow 4", "disabled": tsis tseeb, "info": ""}, {"id": "ff6a8be6.47bb08 "," type ":" ibmiot in "," z ":" 5ef69739.4622e8 "," authentication ":" boundService "," apiKey ":" "," inputType ":" evt "," logicalInterfaceId ": "", "ruleId": "", "deviceId": "", "applicationId": "", "deviceType": "", "eventType": "+", "commandType": "", "format": "json", "npe": "Kuv RaspberryPi Gateway", "kev pabcuam": "sau npe", "allDevices": muaj tseeb, "txhua daim ntawv thov": "", "allDeviceTypes": muaj tseeb, "tag nrho cov xwm txheej": muaj tseeb, "tag nrho cov lus": "", "allFormats": "", "qos": 0, "x": 150, "y": 60, "xov hlau":
Nco ntsoov hloov twilio node kom koj twilio ntawv pov thawj thiab twilio tus lej tau teeb tsa hauv lub node
Kauj Ruam 9: Teeb Pi Web Server
Hauv koj ob RASPBERRY PI…
Nruab cov pob khoom xav tau
Qhib lub davhlau ya nyob twg thiab ntaus cov lus txib hauv qab no:
sudo pip nruab gpiozero
sudo pip nruab flask
sudo pip nruab gevent
sudo pip nruab cloudant
Cov Qauv Ntaub Ntawv
Xa mus rau daim duab ntawm theem no rau cov qauv ntaub ntawv
Rub tawm thiab ntxiv cov ntsiab lus zoo li qub
Txhawm rau kom ntseeg tau tias peb daim ntawv thov web zoo li thiab ua haujlwm raws li tau piav qhia, peb yuav tsum rub tawm thiab ntxiv qee cov ntsiab lus zoo li qub ntxiv rau nws kom ua haujlwm.
- Bootstrap v3.3.7
- FontAwesome v5.0.1
- jQuery v3.1.0https://blog.jquery.com/2016/07/07/jquery-3-1-0-released-no-more-silent-errors/
- Morrisjs v0.5.0https://github.com/morrisjs/morris.js/archive/0.5.0.zip
- Raphael v2.2.0
Bootstrap
- Qhib rub tawm zip file (bootstrap-3.3.7-dist.zip)
- Qhib bootstrap-3.3.7-dist nplaub tshev
- Tshem tawm txhua cov ntsiab lus rau Daim Ntawv Thov/zoo li qub/bootstrap
FontAwesome
- Qhib rub tawm zip file (fontawesome-free-5.0.1.zip)
- Qhib fontawesome-free-5.0.2 nplaub tshev
- Qhib lub vev xaib-fonts-nrog-css
- Tshem tawm txhua cov ntsiab lus rau Daim Ntawv Thov/zoo li qub/font-txaus
jQuery
- Rub tawm jquery-3.1.0.js thiab jquery-3.1.0.min.js
- Muab ob daim ntawv javascript tso rau hauv Daim Ntawv Thov/zoo li qub/jquery
Morrisjs
- Qhib cov ntawv rub tawm zip (morris.js-0.5.0.zip)
- Qhib daim ntawv morris.js-0.5.0
- Tshem tawm txhua cov ntsiab lus rau Daim Ntawv Thov/zoo li qub/morrisjs
Raphael
- Qhib cov ntawv rub tawm zip (raphael-2.2.0.zip)
- Qhib raphael-2.2.0 nplaub tshev
- Tshem tawm txhua cov ntsiab lus rau Daim Ntawv Thov/zoo li qub/raphael
Kauj ruam 10: Ntxiv Code rau Cov Ntaub Ntawv hauv Web Server
Rub tawm cov ntawv hauv qab no thiab ntxiv lawv rau lawv cov npe sib xws hauv pi web server
Nco ntsoov hloov cov ntaub ntawv pov thawj kev pabcuam hauv app.py fileto rau koj li kev lees paub kev pabcuam huab
NCO TSEG: Vim muaj teeb meem nrog kev xa cov ntaub ntawv index.html, Kuv tau muab nws tso ua ntaub ntawv.txt. Thov hloov nws mus rau index.html tom qab rub tawm nws
Kauj ruam 11: Pib Nws
Hauv koj lub web server pi, khiav cov lus txib hauv qab no:
Daim ntawv thov cd
sudo nab hab sej app.py
Pom zoo:
Cov Cog Ntoo Cog Ntoo - Lub Vaj Me: 13 Kauj Ruam (nrog Duab)
Lub Caij Nplooj Ntoos Zeeg - Lub Vaj Me: Kuv yog tub ntxhais kawm los ntawm Multimedia thiab Kev Sib Txuas Lus Technology ntawm Howest Kortrijk. Txog peb txoj haujlwm kawg, peb yuav tsum txhim kho qhov haujlwm IoT ntawm peb tus kheej xaiv. Saib ib puag ncig rau lub tswv yim, Kuv txiav txim siab ua qee yam muaj txiaj ntsig rau kuv niam uas nyiam kev loj hlob
WiFi Tsis Siv Neeg Tsob Nroj Tsiaj Pub Nrog Cov Chaw Tso Dej - Sab Hauv Tsev/Sab Nraud Kev Cog Qoob Loo - Cov Nroj Tsuag Dej Tuaj Nrog Kev Saib Xyuas Chaw Nyob: 21 Kauj Ruam
WiFi Tsis Siv Neeg Cog Tsob Nroj Tsiaj Nrog Cov Chaw Tso Dej - Sab Hauv Tsev/Sab Nraud Kev Cog Qoob Loo - Cov Nroj Tsuag Dej Tuaj Nrog Kev Saib Xyuas Tej Zaum: Hauv qhov kev qhia no peb yuav nthuav qhia yuav ua li cas teeb tsa kev cai nyob sab hauv tsev/sab nraum zoov cog cog cog uas tuaj yeem tso dej nroj tsuag thiab tuaj yeem saib xyuas nyob deb ntawm kev siv Adosia platform
PInt@t10n: Ntse Kev Saib Xyuas Cog Ntoo: 9 Cov Kauj Ruam
PInt@t10n: Smart Plant Monitoring System: PI@nt@t10nThis txoj haujlwm tau tsim los ua kev sim rau ibm iot huab. Peb siv tus esp-8266 xa thiab txais cov ntaub ntawv mus thiab los ntawm ibm huab. Kev sib txuas lus ntawm esp thiab ibm huab tshwm sim los ntawm MQTT.To lis txhua cov ntaub ntawv thiab nthuav tawm
Kev Nyuaj Siab: Kev Saib Xyuas thiab Saib Xyuas Ntxiv rau Kev Teeb Meem: 9 Cov Kauj Ruam
Hard Drive: Kev Saib Xyuas thiab Kev Saib Xyuas Ntxiv Teeb Meem: Daim duab saum toj no yog Hard Drive ib txwm muaj. Cov no yog cov tsav tsheb feem ntau siv niaj hnub no, tab sis tsis tas yuav nrawm tshaj. Tib neeg siv tus tsav no rau nws tus nqi qis dua gigabyte thiab lub neej ntev dua. Phau ntawv qhia no yuav qhia koj txog qhov sib txawv
Cov cog cog zoo tshaj - Cov cog cog uas ntse tshaj plaws uas koj tau pom dua: 6 kauj ruam
Cov cog cog zoo tshaj plaws - Cov cog cog uas ntse tshaj plaws uas koj tau pom dua: Cov cog ntoo no tej zaum yog ib tus cog cog uas koj pom tshaj plaws. Txhua yam nyob hauv nws lub ntsej muag zoo nkauj thiab niaj hnub tsim, tus cog ntoo no khav theeb av uas pom thaum koj cov av qhuav. Thaum nws qhuav, lub twj tso kua mis peristaltic tig rau thiab txiav dej