Cov txheej txheem:

IDC2018IOT Khib Nyiab Can-Online: 7 Kauj Ruam
IDC2018IOT Khib Nyiab Can-Online: 7 Kauj Ruam

Video: IDC2018IOT Khib Nyiab Can-Online: 7 Kauj Ruam

Video: IDC2018IOT Khib Nyiab Can-Online: 7 Kauj Ruam
Video: 1 tsug 13 hnub _part#2_phees lauj fullmusic MV 2022-2023 2024, Kaum ib hlis
Anonim
Image
Image
Yuav Tsum Muaj
Yuav Tsum Muaj

Taw qhia

Txhua leej txhua tus paub tias muaj dab tsi tshwm sim thaum peb tso cov thoob khib nyiab pov rau hauv lub thoob khib nyiab ntev dhau lawm yam tsis tshem nws tawm. Zoo, qhov pom tseeb tshaj plaws yog tias tsis muaj chaw seem rau cov thoob khib nyiab ntau dua, tab sis nws kuj pib hnov tsw, thiab nws tsis txaus siab heev.

Nrog txoj haujlwm no, peb lub hom phiaj pab koj saib xyuas koj lub thoob khib nyiab ib puag ncig lub tsev / chaw ua haujlwm / thiab lwm yam, yog li koj tuaj yeem ib txwm paub thaum lawv puv, thiab tuaj yeem ua tam sim los ntawm kev tshem cov thoob khib nyiab.

Lub kaw lus yuav ceeb toom koj los ntawm xov tooj ceeb toom lossis ceeb toom ceeb toom uas koj yuav tsum tso cov thoob khib nyiab pov tseg. Lub kaw lus yuav suav nrog qib puv ntawm cov thoob khib nyiab, tab sis kuj ntsuas qhov kub thiab av noo ntsuas hauv nws. Peb txhua tus paub txog qhov nrawm ntawm kev ntim cov thoob khib nyiab hauv hnub kub thiab ntub …

Nta Tseem Ceeb

  1. Saib xyuas Dashboard:

    • Tshooj Lus Tseem Ceeb:

      • Qib siab ntawm txhua lub thoob khib nyiab.
      • Kub thiab av noo ntawm txhua lub thoob khib nyiab.
    • Txheeb cais Tshooj:

      • Lub thoob khib nyiab puv nkaus.
      • Cov khib nyiab kub tshaj plaws.
  2. Kev Ceeb Toom & Kev Ceeb Toom:

    • Cov xwm txheej hauv qab no raug txhawb nqa:

      • Lub thoob khib nyiab puv lawm.
      • Ib qho yuam kev sensor tshwm sim.
    • Kev ceeb toom tag nrho yuav tsum suav nrog qib puv ntawm cov thoob khib nyiab, tab sis kuj tseem ntsuas kub thiab av noo ntawm cov thoob khib nyiab.
    • Kev ceeb toom tuaj yeem xa los ntawm kev ceeb toom xov tooj thiab ceeb toom ceeb toom.
    • Txhua qhov kev ceeb toom tuaj yeem qhib thiab tawm ntawm lub dashboard.
  3. Scalability:

    • Siv lub pob ntsuas ntsuas, nws tuaj yeem hloov kho qhov system mus rau cov thoob khib nyiab sib txawv nrog cov peev txheej sib txawv.
    • Nws muaj peev xwm ntxiv cov thoob khib nyiab ntau yooj yim dua. Ib tus tuaj yeem sib sau ua ke tib yam ntawm lub thoob khib nyiab tshiab, teeb lub thoob khib nyiab tuaj yeem ID thiab ntsuas nws (thawb lub pob). Muaj ntau dua 3 lub thoob khib nyiab yuav xav tau txuas ntxiv Dashboard (txoj haujlwm yooj yim los ua).

Peb yog leej twg?

Txoj haujlwm no tau tsim (nrog kev hlub thiab mob siab rau!) Los ntawm Rom Cyncynatus thiab Daniel Alima - Cov tub ntxhais kawm ntawm IDC Herzliya ua qhov haujlwm kawg rau peb chav kawm IoT. Peb vam tias koj yuav pom peb txoj haujlwm muaj txiaj ntsig, thiab txaus siab siv nws!

Kauj Ruam 1: Yuav Tsum Muaj

Txhawm rau tsim lub kaw lus, koj yuav tau txais cov khoom hauv qab no thiab ntu:

  1. Cov khib nyiab tuaj yeem (nyiam dua nrog lub hau): Qhov no yuav siv rau … zoo.. koj paub tias peb yuav ua dab tsi nrog qhov no, eh?;)
  2. Breadboard: Txhawm rau txuas txhua yam ntawm cov khoom sib txawv yam tsis tau siv cov khoom siv soldering.
  3. NodeMCU (ESP-8266): Tus saib xyuas kev nyeem cov cim thiab xa cov ntaub ntawv mus rau huab.
  4. Nyob nrug IR Sensor - Ntse 0A41SK: Lub ntsuas cua no yuav ntsuas cov thoob khib nyiab (qib puv) sab hauv.
  5. Kub & Vaum Sensor - DHT11: Lub ntsuas cua no yuav ntsuas qhov kub thiab av noo hauv cov thoob khib nyiab.
  6. Momentary Hloov: Yuav siv los ntsuas qhov ntsuas qhov deb raws li qhov loj ntawm cov thoob khib nyiab.
  7. Aluminium Ntawv Nyiaj: Yuav siv los tsim lub ntsuas rau lub hau xwm txheej - txawm tias nws tau qhib lossis kaw.
  8. Jumper xov hlau: Tau txais ntau, thiab ntawm qhov ntev sib txawv thiab xim. Yuav txuas txhua yam ua ke.
  9. Daim Kab Xev: Peb yuav tau muab cov khoom tso rau hauv qhov chaw.
  10. Micro-USB Cable: Txhawm rau txuas NodeMCU rau koj lub khoos phis tawj rau kev ua haujlwm, thiab tom qab ntawd rau lub zog siv.
  11. USB Lub Hwj Chim (lub xov tooj them nyiaj them lub xov tooj): Yuav muab lub zog rau NodeMCU thaum teeb tsa ntawm lub thoob khib nyiab.

Kauj ruam 2: Txuas & Sib dhos

Teeb & Sib dhos
Teeb & Sib dhos
Teeb & Sib dhos
Teeb & Sib dhos
Teeb & Sib dhos
Teeb & Sib dhos

Thaiv

Muab NodeMCU tso rau ntawm lub khob cij kom nws yuav yooj yim dua muab nws tom qab rau koj lub thoob khib nyiab, thiab txuas USB cable rau nws. Tom qab ntawd, sab laj cov duab kab duab kab lus saum toj no txhawm rau txuas cov khoom sib txawv rau NodeMCU. Nco ntsoov siv cov xov hlau ntev rau cov ntsuas hluav taws xob thiab cov xov xwm xwm txheej yog li nws yuav yooj yim rau nruab qhov system thiab siv cov thoob khib nyiab nrog nws.

  • Nyob nrug IR Sensor - Ntse 0A41SK:

    • Vin (Liab) Vin
    • GND (Dub) GND
    • Vout (Daj) A0
  • Kub & Vaum Sensor - DHT11:

    • Vin (Liab) 3V3
    • GND (Dub) GND
    • DATA (Daj) D4
  • Momentary Hloov:

    • Pin 1 D 3
    • Pin 2 GND
  • Kab xwm txheej (qhib / kaw) xov hlau:

    • Hlau 1 D2
    • Hlau 2 GND

Los ua ke

Sib sau ua ke ntawm lub thoob khib nyiab tuaj yeem yooj yim heev. Muab daim Breadboard tso rau hauv lub thoob khib nyiab, zoo dua nyob ze ntawm lub hau. Siv daim kab xev lossis kab hlua khi kom ruaj khov rau hauv qhov chaw. Tom qab ntawd:

  1. Muab qhov IR nrug deb nrug nruab nrab ntawm lub hau (los ntawm sab hauv!). Xyuas kom ruaj ntseg kom zoo, lossis koj yuav pom cov ntawv tsis raug!
  2. Muab qhov ntsuas kub thiab av noo qhov chaw tso rau hauv lub thoob khib nyiab. Ruaj ntseg nrog kab xev.
  3. Npog ib sab ntawm lub hau thiab qhov taub ntawm cov thoob khib nyiab tuaj nrog cov ntawv txhuas. Xyuas kom muaj kev sib cuag zoo thaum lub hau kaw. Qhov no yuav qhia lub kaw lus tias lub thoob khib nyiab tau qhib lossis kaw. Tom qab ntawd lo txhua lub hau kab xwm txheej nyob hauv ib qho ntawm cov ntawv txhuas, thiab ruaj ntseg nrog kab xev.

Kauj Ruam 3: Teeb MQTT, Node-RED thiab IFTTT

Teeb MQTT, Node-RED thiab IFTTT
Teeb MQTT, Node-RED thiab IFTTT
Teeb MQTT, Node-RED thiab IFTTT
Teeb MQTT, Node-RED thiab IFTTT
Teeb MQTT, Node-RED thiab IFTTT
Teeb MQTT, Node-RED thiab IFTTT

Feem ntau ntawm qhov project logic tau ua tiav hauv huab. NodeMCU xa cov ntaub ntawv mus rau MQTT server, thiab Node-RED siv nws thiab siv nws cov laj thawj rau nws (ntau ntxiv txog kev tsim qauv ntxiv tom ntej). Thaum kawg, txhawm rau xa cov ntawv ceeb toom thawb (ceeb toom) rau peb lub xov tooj, peb siv IFTTT.

Peb yuav siv CloudMQTT thiab FRED kev pabcuam huab ua peb li MQTT thiab Node-RED servers feem, thiab peb yuav siv IFTTT rau thawb ceeb toom.

  1. Sau npe rau CloudMQTT nrog txoj kev npaj pub dawb. Nco tseg koj cov ntaub ntawv pov thawj rau MQTT server (username thiab password).
  2. Sau npe rau IFTTT. Tsim tshiab applet ntawm "Webhooks IFTTT app ceeb toom". Siv "Xov Tooj Ntawm Tes Xov Tooj" ua WebHookds lub npe txheej xwm. Tham nrog cov duab saum toj no rau cov lus qhia ntxaws. Nco ntsoov koj tus tsim API tus yuam sij.
  3. Rub tawm IFTTT app rau koj lub xov tooj thiab kos npe nrog koj daim ntawv pov thawj. Qhov no yuav tso cai rau koj kom tau txais cov ntawv ceeb toom thawb.
  4. Sau npe rau FRED nrog txoj kev npaj pub dawb.
  5. Thaum koj muaj FRED piv txwv li thiab khiav, ntshuam cov ntawv txuas rau hauv nws (3 Bars khawm Ntshuam Los ntawm cov ntawv teev cia). Tsuas yog muab cov ntsiab lus ntawm txhua cov ntaub ntawv (widgest.json, alerts.json, statistics.json) thiab ntshuam nws.
  6. Kho ib qho ntawm MQTT cov nodes (ib qho txaus) los hloov kho koj li CloudMQTT cov ntaub ntawv pov thawj.
  7. Kho qhov IFTTT ntawm qhov hloov kho koj li IFTTT txiag API qhov tseem ceeb.

Kauj Ruam 4: Ua Haujlwm NodeMCU thiab Khib Nyiab Muaj Peev Xwm Muaj Peev Xwm

Thaum peb muaj txhua yam txuas nrog, peb yuav tsum tau teeb tsa NodeMCU nrog cov software tsim nyog (kos duab) kom nws thiaj li siv tau txhua yam khoom uas txuas nrog nws, thiab sib tham nrog internet.

  1. Rub tawm thiab teeb tsa Arduino IDE los ntawm no.
  2. Nruab thiab teeb tsa NodeMCU pawg thawj coj saib raws li tau piav qhia thaum pib ntawm cov lus qhia hauv qab no.
  3. Nruab ib lub tsev qiv ntawv hauv qab no (Sketch Include Library Manage Libraries…):

    1. Adafruit MQTT Library (los ntawm Adafruit)
    2. DHT sensor tsev qiv ntawv (Los ntawm Adafruit)
    3. SharpIR (los ntawm Giuseppe Masino)
    4. EEPROMAnyob dab tsi - piav qhia ntawm no.
  4. Qhib cov ntawv GarbageCanOnline.ino, thiab hloov kho cov hauv qab no:

    1. Koj li ntaub ntawv pov thawj WiFi (WLAN_SSID, WLAN_PASS)
    2. Koj li CloudMQTT cov ntaub ntawv pov thawj (MQTT_USERNAME, MQTT_PASSWORD)
    3. Yog tias qhov no yog lub thoob khib nyiab thib ob lossis ntau dua, hloov cov thoob khib nyiab ID (GARBAGECAN_ID)
  5. Rub tawm daim duab hloov tshiab rau koj NodeMCU.
  6. Qhib lub qhov rai saib xyuas qhov ntsuas (Ctrl+M) thiab xyuas kom tseeb tias nws tswj kom tshaj tawm cov ntaub ntawv ntsuas mus rau CloudMQTT.
  7. Tam sim no, thaum lub hau raug kaw thiab lub thoob khib nyiab tsis muaj dab tsi, ntev-nias lub ntsuas ntsuas kom ntsuas lub thoob khib nyiab tuaj yeem muaj peev xwm.
  8. Lub thoob khib nyiab tau teeb tsa tag nrho. Koj tuaj yeem txiav nws los ntawm koj lub khoos phis tawj, thiab txuas nws hauv nws qhov chaw tshwj xeeb uas siv lub zog USB.

Kauj Ruam 5: Siv Qhov System

Siv Qhov System
Siv Qhov System
Siv Qhov System
Siv Qhov System
Siv Qhov System
Siv Qhov System

Yog tias koj tau mus txog qhov deb no, txhua yam yuav tsum tau nce thiab khiav. Cia peb ua qhov txheej txheem sai ntawm qhov sib txawv ntawm kev siv ntawm lub system.

Peb xav tias koj tsuas muaj ib lub thoob khib nyiab tuaj yeem txuas nrog, tab sis nws yooj yim ntxiv ntxiv tom qab!

Ua ntej tshaj, ceeb toom rau lub dashboard tseem ceeb. Koj yuav tsum nyob hauv lub vijtsam hauv tsev, pom cov thoob khib nyiab tuaj yeem puv, qhov kub thiab txias. Koj tuaj yeem tswj hwm lub xov tooj ceeb toom thiab ceeb toom Dashboard siv cov hloov pauv ntawm sab laug.

Thaum cov thoob khib nyiab sab hauv cov thoob khib nyiab tuaj yeem hloov pauv, koj yuav pom qhov ntsuas tau hloov pauv raws li. Qhov no kuj yog rooj plaub rau qhov ntsuas kub thiab av noo.

Thaum qib puv mus txog 85% -90% (qhov pib raug yog nyob ntawm qhov ntsuas kub thiab av noo), lossis qhov ntsuas tsis raug tshwm sim, koj yuav tau txais kev ceeb toom ntawm koj txoj kev nyiam (s). Koj yuav tau txais ntawv ceeb toom ib zaug txhua txhua teev ntawm cov thoob khib nyiab.

Hauv Kev Txheeb Xyuas pom, koj yuav tuaj yeem pom cov thoob khib nyiab tam sim no, thiab qhov kub tshaj plaws. Lub npe tsis zoo, yog tias peb tuaj yeem hais …

Kauj Ruam 6: Nkag Siab Qhov Flow

Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej
Nkag Siab Cov Dej

Raws li koj tau pom dhau los tam sim no, cov kab ke muaj ntau qhov "txav chaw". Peb yuav sim piav qhia seb yam khoom cuam tshuam rau ib leeg li cas.

Ua ntej, peb muaj peb cov thoob khib nyiab nrog NodeMCU thiab nws cov ntsuas. Peb tuaj yeem muaj ntau ntawm cov no - tsuas yog "luam" ntawm ib leeg.

NodeMCU ntsuas cov ntsuas sib txawv tso rau hauv lub thoob khib nyiab, thiab tshaj tawm cov ntaub ntawv mus rau MQTT server (MQTT raws tu qauv). Koj tuaj yeem xav txog MQTT server ua cov ntaub ntawv pauv loj, tias ntau lub thoob khib nyiab tuaj yeem tshaj tawm lawv cov ntaub ntawv rau.

Lwm qhov chaw uas txuas rau MQTT server yog Node-RED. Node-RED mloog cov lus sib txawv los ntawm cov thoob khib nyiab tuaj yeem nqa cov ntaub ntawv nkag siab, thiab siv nws cov laj thawj rau nws. Nws ua haujlwm los ntawm kev siv "ntws" ntawm cov ntaub ntawv. Txhua lub sijhawm tau txais cov lus, raws li nws hom (MQTT lub ncauj lus), nws nkag mus rau cov saw tshwj xeeb ntawm kev ua haujlwm uas xaus rau kev qhib qhov sib txawv ntawm cov kab ke (hloov kho lub dashboard, xa ntawv ceeb toom, thiab lwm yam) Nws yuav yog qhov raug heev los hais tias Node-RED yog "lub hlwb" ntawm qhov system. Nws paub txog txhua yam uas tshwm sim txhua qhov chaw, thiab tuaj yeem ua raws li qhov ua tau.

Sab hauv Node-RED peb tau tsim 3 qhov tseem ceeb ntawm cov ntaub ntawv:

  1. Widgets - Cov ntaub ntawv nkag siab nkag tau rau hauv Node -RED yog tom qab ntawd tso tawm ntawm lub dashboard ntawm cov ntsuas thiab kab teeb.
  2. Kev ceeb toom - Cov ntaub ntawv nkag siab tau ua tiav los txiav txim siab seb puas yuav tsum tau ceeb toom (ntawm lub dashboard lossis rau lub smartphone app). Cov qib puv, nrog rau qhov ntsuas kub & av noo tau muab coj los txiav txim siab los qhia rau tus neeg siv tias lub thoob khib nyiab tuaj yeem puv. Tsis tas li ntawd, qhov tsis nkag siab tau raug tshaj tawm los ntawm tib qhov ntws.
  3. Txheeb cais - Cov ntaub ntawv nkag siab tau sau ua ke los tso saib cov thoob thoob thiab kub tshaj plaws.

Txhawm rau Node-RED xa kev ceeb toom thawb, nws txuas rau cov kev pabcuam hu ua IFTTT (los ntawm HTTP raws tu qauv). Nws qhib qee qhov IFTTT qhov xwm txheej nrog cov ntawv ceeb toom cuam tshuam, thiab IFTTT xa ntawv ceeb toom rau peb lub xov tooj (HTTP & XMPP cov txheej txheem).

Tham nrog cov duab saum toj no kom nkag siab zoo dua (a) cov qauv dav dav ntawm cov kab ke, thiab (b) 3 cov ntaub ntawv sib txawv ntws hauv Node-RED

Kauj Ruam 7: Cov teeb meem, Kev txwv thiab phiaj xwm rau yav tom ntej…

Kev sib tw

Cov teeb meem tseem ceeb hauv txoj haujlwm no feem ntau yog tuav MQTT thiab Node-RED cov kev pabcuam. Peb xub siv AdafruitIO, tab sis nws qhov kev cai MQTT siv tsis zoo rau peb. Nws tsis yooj yim los ua haujlwm nrog nws "txau" hauv Node-RED. Yog li ntawd thaum kawg peb tau xaiv rau CloudMQTT, uas yog raws li Mosquitto MQTT server, thiab yog tus qauv ntau dua. Tom qab ntawd peb tau txav mus los txhawm rau Node-RED, uas nyuaj heev, feem ntau vim tias Node-RED yog tsiaj nyaum. Piv txwv li, nws muaj kev paub ntau dua thiab muaj txuj ci ntau dua li IFTTT hauv peb qhov kev xav. Peb yuav tsum tau hloov kho thiab kawm paub siv nws li cas raws li kev tsim qauv los tsim peb cov yam ntxwv xav tau ntawm lub kaw lus. Ntxiv mus, ib qho ntawm nws qhov txiaj ntsig zoo tshaj plaws yog kev txhawb nqa javascript code, tab sis nws tau siv ib pliag kom siv tau zoo li peb tsis yog javascript programmers. Txawm hais tias txhua qhov ntawd, peb yeej txaus siab ua haujlwm nrog cov cuab yeej tshwj xeeb no, thiab peb pom nws yog qhov nthuav heev thiab muaj txiaj ntsig.

Txwv

Hauv kev hais txog cov kev txwv, thawj qhov yuav yog qhov tseeb tias peb siv cov kev pabcuam dawb nkaus xwb, thiab lawv yuav tsis tso cai ua qhov ntsuas tag nrho. CloudMQTT txoj phiaj xwm pub dawb yuav tsis tso cai muaj ntau dua 5 qhov sib txuas sib txuas, txhais tau tias peb tuaj yeem muaj tsuas yog 4 lub thoob khib nyiab thiab Node-RED. FRED Node-RED txoj kev npaj pub dawb tsuas yog tso cai 24 teev ntawm kev siv ncaj qha, tom qab uas koj yuav tsum tau nkag mus rau hauv tus kheej thiab rov pib lub sijhawm. Txawm li cas los xij, cov teeb meem no daws tau yooj yim los ntawm kev khiav cov kev pabcuam no hauv ib cheeb tsam, lossis them nyiaj ntxiv me ntsis kom tshem qhov txwv. Qhov kev txwv thib ob yog qhov tseeb tias thaum ib qho ntxiv plaub lub thoob khib nyiab tuaj yeem thiab mus rau tom ntej, nws yuav tsum tau kho tus kheej cov cuab yeej ntws hauv Node-RED ntxiv nws cov cuab yeej tsim nyog.

Cov phiaj xwm rau yav tom ntej

Peb muaj qee cov tswv yim los txuas ntxiv txhim kho peb cov kab ke thiab txuas ntxiv nws:

  1. Txav mus rau cov kev pabcuam huab tsis pub dawb. (ib hnub ua haujlwm).
  2. Ntxiv ib lub thoob khib nyiab rau hauv lub thoob khib nyiab, yog li txo qhov nquag tso nws. (4 lub hlis ua haujlwm)
  3. Ua haujlwm nrog cov nroog thiab cov thoob khib nyiab pov tseg kom txhim kho kev ua haujlwm ntawm cov tsheb loj hauv nroog uas tuav cov thoob khib nyiab hauv nroog. Qhov no yuav txhais tau zoo heev txhawm rau txhim kho lub dashboard thiab cov ntawv ceeb toom kom cov tsav tsheb thauj khoom tuaj yeem npaj lawv txoj kev zoo dua thaum tuav cov thoob khib nyiab. (6 lub hlis ua haujlwm).
  4. Ntxiv cov peev txheej rov ua dua tshiab rau hauv cov thoob khib nyiab, zoo li muaj peev xwm nchuav tshwj xeeb kev daws teeb meem lom rau hauv cov thoob khib nyiab thiab pab rov siv dua thaum nws tseem nyob hauv cov thoob khib nyiab. Qhov no tuaj yeem siv sab hauv tsev piv txwv los tsim cov chiv rau lub vaj, tab sis tuaj yeem siv tau meej hauv cov kaus poom ntim khoom ib yam. (6 lub hlis ua haujlwm).

Pom zoo: