Cov txheej txheem:

ForgetMeNot - Ntse Tsev Qhia Ntawv Platform: 14 Cov Kauj Ruam (nrog Duab)
ForgetMeNot - Ntse Tsev Qhia Ntawv Platform: 14 Cov Kauj Ruam (nrog Duab)

Video: ForgetMeNot - Ntse Tsev Qhia Ntawv Platform: 14 Cov Kauj Ruam (nrog Duab)

Video: ForgetMeNot - Ntse Tsev Qhia Ntawv Platform: 14 Cov Kauj Ruam (nrog Duab)
Video: Dab neeg yawg tooj ntawg tua dab phim nyuj vais 15/1/2020 2024, Hlis ntuj nqeg
Anonim
ForgetMeNot - Ntse Tsev Ceeb Toom Platform
ForgetMeNot - Ntse Tsev Ceeb Toom Platform

Raws li cov tub ntxhais kawm tsis khoom hauv tsev kawm qib siab, khiav ib ncig ntawm cov chav kawm, txoj haujlwm thiab tsev neeg lub luag haujlwm, peb zoo li tsis nco qab txog yam me me. Ib lub hnub yug los thiab mus yam tsis muaj kev ceeb toom rau peb, hnub kawg tseem ceeb tau ploj vim tsis nco qab thiab qee zaum, tsuas yog qee zaum, hluav taws tawg thiab hlawv koj chav vim koj tsis nco lub tshuab cua sov.

Tsis txhob txhawj xeeb, cov phooj ywg zoo - peb los cawm.

ForgetMeNot yog Smart Home Notification Platform, tsim tawm ntawm qhov xav tau tiag tiag peb tau ntsib hauv peb lub neej txhua hnub (thiab, yog tias peb ua siab ncaj tag nrho, tsav me ntsis los ntawm qhov haujlwm kawg hauv chav kawm Computer Science).

Hauv qhov tseem ceeb, nws yog kev sib xyaw ntawm hardware thiab software. Nws ua kom ntseeg tau tias koj paub (thiab tuaj yeem ua!) Ntawm yam uas koj tsis nco qab ua thaum tawm hauv tsev.

Remix?

Thaum peb tsuas yog siv ob peb lub ntsuas ntsuas (yam uas pom) thiab tus ua haujlwm (yam uas ua), qhov dav dav ntawm txhua qhov kev tiv thaiv ua rau nws haum rau ntau qhov kev siv nrog tsawg kawg kho vajtse thiab software hloov pauv. Qhia rau peb paub yog tias koj rov kho qee qhov (lossis tag nrho!) Ntawm txoj haujlwm - peb vwm txog kev sib koom tes!

Who?

Zoo siab tsim los ntawm (ib pawg ntawm) pab pawg Red Panda los ntawm IDC Herzliya hauv McCann Valley, Mizpe Ramon. Lub hnab ntawv ntawm kev txaus siab mus rau Zvika Markfeld, ntawm ForRealTeam, rau kev mus nrog peb mus rau suab puam los tsim cov khoom zoo nyob hauv nruab nrab ntawm qhov zoo nkauj tshaj plaws ntawm peb lub tebchaws.

Ua tsaug tshwj xeeb

Txog cov neeg ntawm Random Nerd Tutorials rau lawv qhov tsis muaj qhov kawg ntawm qhov nthuav, cov ntsiab lus tshiab peb tuaj yeem sim nrog Node-RED thiab peb ESP8266s, tshwj xeeb hauv no.

Khoom siv

Woah, muaj ntau yam…

Qhov no yog qhov haujlwm loj heev, thiab peb tau xaiv qee qhov kev tsim qauv thaum ntxov raws li kho vajtse, software thiab lwm yam khoom zoo uas peb siv.

Thaum peb pom zoo cov npe hauv qab no yog tias koj npaj yuav ua raws, ntau qhov tuaj yeem hloov pauv rau cov khoom tau yooj yim dua. Ib qho piv txwv yog WeMos cov laug cam - xijpeem pheej yig version ntawm lub rooj tsavxwm uas koj tau zaum ib puag ncig, koj tuaj yeem ua rau nws ua haujlwm yam tsis muaj kev hloov pauv ntau.

Ib qho piv txwv ntawm lwm yam sib txawv yog lub casing rau Smart Outlet. Thaum zoo nkauj thiab khov kho, ib lub thawv (tsis-hlau) yuav ua. Peb nyuam qhuav tshwm sim kom muaj kev nkag mus rau lub tshuab txiav laser, thiab txhua tus neeg uas tau nkag mus rau lub tshuab txiav laser tam sim ntawd muaj ntau, ntau qhov siv rau kev txiav laser. TXHUA YAM. Tib yam mus rau peb qhov 3D-Luam tawm ntu.

Yog li - tsuas yog pob zeb koj tus kheej lub iav, thiab tawm lus tawm hauv qab no yog tias koj xav tau kev pab nrog hloov qee feem rau lwm qhov.

Micro-Controllers, cov laug cam thiab cov thaiv

  • 4 x ESP8266 cov laug cam (peb siv LoLin tsim WeMos D1 minis)
  • 1 x D1 Mini Relay Shield
  • 1 x L293N Hbridge (siv rau Qhov Rooj Activator DC lub cav)

Fais fab

  • 50 x Arduino-style jumper cables (nyob ntawm lub rooj tsav xwm koj tab tom siv, koj yuav xav tau poj niam-txiv neej lossis txiv neej ntau dua-txiv neej. Tsuas yog tau txais pawg ntawm txhua, lawv ib txwm tuaj yeem siv tau)-nco ntsoov tias qee qhov lawv yuav yuav tsum hle rau Tus Kws Ua Haujlwm Qhov Rooj
  • 3 x 10 Ohm resistors
  • 1 x Xuanshi XS-XB6 16A ~ 250v max. 3500W fais fab sawb + txuas txuas txuas ntxiv (ib qho txuas txuas ntxiv + txuas rau 220V lub qhov rooj yuav tsum ua) - nco ntsoov tias nws yuav raug hle rau Smart Outlet
  • 3 x Micro-USB Cables
  • 3 x USB phab ntsa Chargers
  • 1 x DY-0120200 (Cov tswv yim: 100-240V, 50-60Hz tso zis: 12V --- 2A) AC/DC Adapter nrog DC chim txiv neej lub taub hau (lossis sib npaug adapter)
  • 1 x poj niam DC chim chim
  • 1 x 220V mus rau 5V hloov pauv (rau muab lub zog rau Smart Outlet board ncaj qha los ntawm lub hwj huam hluav taws xob, tsis muaj lub zog ntxiv)

Sensors

  • 1 x LDR Teeb Sensor
  • 1 x Reed Relay (ua lub ntsuas pa rau lub qhov rais)
  • 1 x DHT Kub sensor

Tsav tsheb

  • 1 x DC lub cev muaj zog (peb siv lub cav hlau tsis txhuam cov hlau, tab sis txhua lub cav uas haum koj li 3D-luam qhov rooj qhib qhov rooj yuav ua)
  • 1 x Servo motor (txhua qhov loj me me tej zaum yuav ua tau, tab sis nco ntsoov siv lub zog txaus kom ntxeev qhov hloov pauv uas xav tau)

Laser-Txiav Qhov

1 x Smart Outlet Box

3D-Luam Qhov Chaw

1 x Qhov rooj qhib qhov rooj

Txawb xov tooj

Cov ntawv qhia no tau tsim nrog Android xov tooj hauv siab, thiab rau tam sim no nws zoo li Integromat tsis txhawb nqa iOS cov khoom siv. Yog li ntawd, hmoov tsis, qhov kev qhia no xav tau lub xov tooj Android.

Software

  • Arduino IDE (Kev Txhim Kho Ib Leeg Ib puag ncig - ib puag ncig zoo nkauj tus khoos phis tawj)

    • Kom koj lub rooj tsav xwm thauj khoom hauv IDE kom yooj yim rub tawm
    • Saib cov duab kos txuas rau txhua lub tsev qiv ntawv cuam tshuam
  • Node-RED Integration Platform

    Peb siv cov khoom lag luam feem ntau, nrog rau qee qhov kev zam - saib txuas ntxiv rau txhua qhov ntawm cov cuam tshuam

  • Integromat.com (kev pabcuam txuas, tso cai txuas rau ntau qhov kev pabcuam ua ke - hauv peb qhov xwm txheej, thiab Android app thiab peb Node -RED server)

    Peb siv cov qib dawb, uas yuav tsum txaus rau kev siv niaj hnub ntawm lub platform

  • PushBullet.com (thawb ceeb toom kev pabcuam)

    Peb siv cov dawb version, uas yuav tsum txaus rau kev siv niaj hnub ntawm lub platform

  • ngrok (kev pabcuam nyab xeeb hauv qhov av)

    Peb siv cov cuab yeej pub dawb no nthuav tawm qhov txuas los ntawm peb lub dashboard khiav hauv zos mus rau lub ntiaj teb, yog li peb tuaj yeem nkag mus rau ntawm lub dashboard los ntawm URL Hauv qhov kev ceeb toom thawb

  • Mosquitto MQTT Broker

    MQTT yog cov txheej txheem siv los hloov cov lus ntawm peb cov khoom siv sib txuas thiab Node-RED. Txij li Node-RED tsis muaj MQTT server ua, peb yuav tsum siv sab nraud

Kauj Ruam 1: Nkag Siab Qhov Flow

Image
Image

Tham nrog cov vis dis aus saum toj no rau qhov ua piv txwv ntawm cov kab ke. Nco ntsoov tias qhov dav dav ntawm qhov system (tom qab uas Node-RED ntws tau tsim) yog raws li hauv qab no:

  1. Koj tawm ntawm koj lub tsev
  2. Koj lub xov tooj txuas ntawm koj lub tsev WiFi
  3. Integromat tau txais lo lus, thiab ceeb toom Node-RED
  4. Node-RED tshuaj xyuas seb dab tsi yog qhov xwm txheej ntawm lub ntsuas cua hauv koj lub tsev thiab cov hloov pauv hauv koj lub dashboard
  5. Yog tias muaj dab tsi sab laug lossis qhib, nws ceeb toom PushBullet
  6. PushBullet xa ntawv ceeb toom rau koj lub xov tooj, nrog txuas Node-RED Dashboard
  7. Koj tuaj yeem mus rau Dashboard thiab kaw/tua yam uas cuam tshuam

Hauv qhov tseeb, peb muab txoj hauv kev nruab nrab los tswj hwm ntau yam khoom hauv koj lub tsev thiab txheeb xyuas qhov tseeb tias lawv nyob hauv qhov xwm txheej raug thaum koj tawm hauv koj lub tsev.

Hauv kev xyaum, peb muaj lub peev xwm hauv qab no hauv txoj haujlwm no:

  1. Qhov xwm txheej ntawm Qhov rai - qhib/kaw (qhia los ntawm Reed Relay xwm txheej)
  2. Cov xwm txheej ntawm Teeb - qhib/tawm (qhia los ntawm LDR xwm txheej)
  3. Cov xwm txheej ntawm Chaw Rhaub Dej - qhib/tawm (qhia los ntawm DHT qhov ntsuas kub)
  4. Tus Qhib Qhov Rooj-qhib/kaw (kev cai ua 3D-casing rau lub tshuab DC)
  5. Smart Outlet Activator - qhib/tua (lub D1 txuas nrog txuas rau lub zog txuas)
  6. Hloov Xovxwm Activator - qhib/tawm (Servo txuas nrog lub rooj tsavxwm)

Qhov no txaus, hauv peb phau ntawv, los qhia lub peev xwm ntawm lub platform. Nws tuaj yeem nthuav dav tau yooj yim (siv Node-RED) ntxiv rau ntau qhov xwm txheej ntsuas / ua haujlwm, yog tias xav tau.

Kauj ruam 2: Qhib

Ngrok
Ngrok

ngrok yog kev pabcuam hauv qhov av. Nws tso cai rau peb nthuav tawm cov kev pabcuam hauv ib cheeb tsam (hauv peb qhov xwm txheej, Node -RED) mus rau ntiaj teb sab nrauv - yam tsis muaj teeb meem teeb tsa server lossis cuam tshuam nrog DNS cov ntaub ntawv. Koj yooj yim khiav Node-RED ntawm koj lub computer, thiab tom qab ntawd khiav ngrok ntawm tib lub chaw nres nkoj Node-RED tau ua haujlwm. Qhov ntawd yog - koj yuav tau txais URL uas koj tuaj yeem siv nkag mus rau Node -RED los ntawm txhua qhov chaw hauv ntiaj teb, tsis hais txog lub network twg nws txuas nrog.

Kev teeb tsa & teeb tsa

  1. Rub tawm ngrok rau koj lub operating system los ntawm no.
  2. Ua raws cov theem ntawm nplooj ntawv rub tawm, kom txog rau thaum "Hluav Taws nws" kauj ruam.
  3. Hauv "Hluav Taws nws nce qib", pauv 80 rau 1880 - zoo li hauv,./ngrok http 1880 lossis ngrok http 1880, nyob ntawm koj lub operating system.
  4. Nco tseg ntawm http URL koj yuav pom hauv koj kab hais kom ua - peb yuav xav tau nws tom qab. Saib daim duab ua piv txwv.

Kauj Ruam 3: Node-RED

Node-RED
Node-RED
Node-RED
Node-RED
Node-RED
Node-RED

Kev teeb tsa & teeb tsa

Lub luag haujlwm tseem ceeb hauv kev tswj hwm ntawm txoj haujlwm, Node-RED yog qhov pom kev ib puag ncig uas tso cai rau koj txuas ntau yam software (thiab kho vajtse!) Cov kev pabcuam ua ke los tsim daim ntawv thov kev koom ua ke. Raws li qhov tau txais txiaj ntsig, nws tso cai tsim cov dashboards zoo nkauj uas tuaj yeem tau txais cov ntaub ntawv los ntawm thiab txawm tias tswj hwm ntau yam kev pabcuam.

Yog tias koj paub nrog Node-RED, tsuas yog tau txais peb qhov ntws los ntawm Gist no, thiab ntxiv koj li ngrok id los ntawm qib 8 hauv qab no.

Yog tias koj tsis paub nrog Node-RED lossis koj tsis tau teeb tsa nws, ua raws cov theem hauv qab no txhawm rau thauj peb Node-RED ntws ntawm koj lub computer hauv zos:

  1. Node-RED xav tau Node.js, uas yog hom lus programming nrog nws tus kheej tshwj xeeb kev txhim kho ib puag ncig. Lob tus installer cuam tshuam rau koj lub operating system los ntawm no, tom qab ntawv ua raws cov lus qhia.
  2. Tam sim no koj tuaj yeem nruab Node-RED nws tus kheej siv cov lus qhia ntawm no. Thov nco ntsoov qhov chaw Node-RED tau teeb tsa, raws li koj xav tau nws rau qib tom ntej.
  3. Tam sim no koj tau Node-RED teeb tsa, khiav nws siv cov lus qhia ntawm cov kauj ruam saum toj no thiab siv tau koj tuaj yeem pom nplooj ntawv khoob. Nws yuav tsum nyob hauv
  4. Tam sim no koj yuav tsum teeb tsa ob peb lub node ntxiv (uas yog Node-RED hu nws txuas ntxiv lossis cov qauv) siv hauv txoj haujlwm no. Thov ua raws cov lus qhia ntawm no thiab ntawm no thiab teeb tsa ob qho ntawm cov qauv no.
  5. Tam sim no tias cov nodes raug teeb tsa, rov pib dua lub node-liab server (yooj yim tua cov kev pabcuam thiab rov pib nws yuav tsum ua qhov dag). Tam sim no koj yuav tsum muaj ob lub hauv paus muaj nyob hauv koj cov dej ntws.
  6. Rub tawm qhov haujlwm no Node-RED ntws los ntawm no, thiab ua raws cov lus qhia ntawm no txhawm rau ntshuam nws rau hauv koj li kev teeb tsa Node-RED.
  7. Xyuas kom koj tuaj yeem pom daim duab ntawm qhov ntws raws li nws zoo li saum toj no hauv koj lub vijtsam.
  8. Nco ntsoov qhov ngrok URL los ntawm cov kauj ruam kawg? Nkag mus rau nws hauv Build Push Notification node. Qhov no yuav tso cai rau peb pom qhov txuas txuas ntawm lub dashboard (uas tau ua haujlwm ntawm peb lub tshuab hauv zos) hauv txhua lub cuab yeej uas peb siv kom tau txais ntawv ceeb toom.

Kev piav qhia ntawm Flow

Daim ntawv ceeb toom cov dej ntws sib cais ua ob ntu - ib qho sab saud yog lub ntsiab lus tseem ceeb, thiab hauv qab ib qho yog cov laj thawj tiv thaiv.

Lub ntsiab lus tseem ceeb saib xyuas seb koj puas tau tawm hauv lub tsev (los ntawm kev tau txais GET thov los ntawm Integromat hauv Integromat WiFi Tawm Hauv Endpoint node), xa rov qab cov lus teb tau zoo (yog li Integromat tsis dai, sab hauv Xa Kev Xa Xov Zoo Rau Integromat), thiab tom qab ntawd ua haujlwm tshuaj xyuas txhua lub ntsuas hluav taws xob thiab tus ua haujlwm txhawm rau txheeb xyuas lawv cov xwm txheej tam sim no (qhov no tshwm sim sab hauv Tsim Push Notification function node, siv thoob ntiaj teb lub khw muag khoom kom tau txais cov ntaub ntawv). Yog tias qhov kev tshuaj xyuas pom tias qee yam tau qhib lossis qhib, nws ua rau PushBullet thawb ceeb toom (nyob rau sab saud-Tshaj Tawm Tshaj Lij Tshaj Tawm ntawm qhov). Qhov qis -feem ntau Xa Push Notification node saib xyuas kev xa cov ntawv ceeb toom tsis raug cai (rau lub tshuab cua sov qhov chaw - saib nws cov kauj ruam kom paub ntau ntxiv ntawm cov laj thawj tom qab nws). Nco ntsoov tias tseem muaj qhov debug ntawm qhov ntawd (hu Ua Tau Thov) uas teev txhua qhov kev thov los ntawm, yog li peb tuaj yeem ntes ib qho teeb meem ntawm Integromat ib sab ntawm lub laj kab.

Cov txheej txheem txheej txheem txheej txheem saib xyuas hloov kho lub ntiaj teb cov khoom lag luam nrog lub xeev ntawm txhua tus ua haujlwm/ntsuas, yog li peb tuaj yeem txiav txim siab dab tsi (yog muaj) cov ntaub ntawv peb xav tau xa hauv peb qhov kev ceeb toom thawb. Nco ntsoov tias muaj ob qhov sib txawv ntawm cov dej no:

Cov Hluav Taws Xob Ua Haujlwm (Hloov Xovxwm/ Qhov Rooj/ Ntse Qhov Hluav Taws Xob) - Cov no yog cov dej ntws uas yuav tsum tau hloov kho lub dasboard tom qab hloov tau tig mus rau hauv lub dashboard + ua qee yam haujlwm hauv ntiaj teb tiag. Tshwj xeeb, ob qho tib si tos rau qhov ua kom tshwm sim ntawm lub dashboard (hauv Hloov nodes), tom qab ntawd tig lub xeev sab hauv Lub Xeev Logic ua haujlwm cov nodes, thiab hloov kho lub dashboard raws li qhov hloov pauv (tig LED rau/tawm hauv Xeev LED cov node, thiab hloov cov ntawv hauv Xeev Qhov Ntsuas Ntsuas). Ib qho ntxiv, tom qab qhov hloov pauv tau xa MQTT cov lus xa mus rau WeMos cov tswj hwm tswj hwm cov neeg ua haujlwm (siv MQTT-tawm Activator nodes) los tsim kev nqis tes ua hauv ntiaj teb lub cev (piv txwv li qhib/kaw lub qhov rooj lossis tua/pab kom ntse Qhov hluav taws xob).

Sensor Flows (Lub Teeb/Qhov rai/Qhov Chaw Rhaub Dej) - Cov no yog cov dej ntws uas yuav tsum tau hloov kho lub dashboard tom qab lub xov tooj sensor tuaj hla MQTT. Tshwj xeeb, ob qho tib si tos MQTT cov lus kom nkag mus (siv MQTT-hauv Sensor nodes), tom qab ntawd txheeb xyuas cov ntaub ntawv thiab ntxeev lub xeev sab hauv Lub Xeev Logic muaj nuj nqi. Tom qab ntawd, lawv hloov kho lub dashboard raws li cov lus nkag (tig LED rau/tawm hauv Lub Xeev LED nodes, thiab hloov cov ntawv hauv Lub Xeev Qhov Ntsuas Ntsuas).

Pom cov hnoos qeev txuas rau txhua qhov tivthaiv? Cov no saib xyuas kev muab qhov tsis zoo rau lub dasboard thaum nws tau tig mus thawj zaug, kom ntseeg tau tias tsis muaj kev lag luam lom zem tshwm sim thawj zaug.

Nco tseg: Node-RED muaj ob hom "qauv": canvas thiab UI. Canvas yog qhov uas koj tsim thiab kho cov nodes (nws nyob ntawm https://127.0.0.1:1880 lossis https://YOUR_NGROK_ID.ngrok.io) thiab UI yog qhov uas koj pom koj cov dashboards (nws nyob ntawm https://127.0.0.1: 1880/ui lossis

Kauj ruam 4: Integromat

Integromat
Integromat
Integromat
Integromat
Integromat
Integromat

Sau Npe

Integromat, piav qhia tus kheej li "Glue of the Internet", yog kev pabcuam uas txuas ntau yam ntawm cov software ua ke hauv txoj kev nthuav. Hauv peb qhov xwm txheej, peb siv nws daim ntawv thov Android los tshuaj xyuas thaum koj txuas ntawm koj lub tsev WiFi, tom qab ntawd ua rau thov HTTP rau peb Node-Red Server. Qhov kev thov no yuav ua rau tag nrho cov kev khiav tawm hauv cov kauj ruam dhau los.

  1. Sau npe rau tus lej Integromat hauv no.
  2. Rub tawm Android app los ntawm no.
  3. Hauv Integromat lub web console (koj yuav tsum pom nws ib zaug koj tau kos npe rau Integromat), qhib Devices tab ntawm sab laug sab tes, hauv nruab nrab.
  4. Ntxiv koj lub cuab yeej los ntawm txhaj "Ntxiv ib lub cuab yeej" nyob rau sab laug saum toj thiab ua raws cov kauj ruam qhia.
  5. Tom qab koj ua tiav tso cai rau app nrog lub vev xaib console, qhib nws thiab mus rau hauv cov chaw hauv qab txoj cai.
  6. Nyem rau WiFi, thiab tom qab ntawd khij (hauv Cov Txheej Txheem) lub thawv rau WiFi qhov kev sib txuas tsis raug. Qhov no yuav tso cai rau app pom thaum koj lub xov tooj tau txuas nrog los ntawm WiFi network.

Tsim Peb Scenario

Cov dej ntws ntawm kev ua hauv Integromat hu ua Scenarios. Peb tab tom yuav tsim qhov xwm txheej uas tos rau ib qho WiFi network kom txiav tawm, tom qab ntawv lim tsuas yog cov uas haum peb lub tsev WiFi network.

  1. Saib daim duab saum toj no rau cov lus piav qhia Scenario.
  2. Tsim ib qho ntawm cov nodes ("npuas") los ntawm txhaj rau hauv qab "+" kos npe ze rau Favorites, thiab ntxiv peb qhov xav tau - Android (WiFi Disconnection), JSON (Tsim JSON) thiab HTTP (Ua Ntawv Thov).
  3. Txuas lub Android node rau JSON node, thiab JSON node rau HTTP node.
  4. Kho lub lim ntawm Android thiab JSON nodes raws li daim duab saum toj no.
  5. Kho txhua lub node raws li cov duab saum toj no. Nco tseg kev siv ngrok URL tsim nyob rau hauv cov kauj ruam dhau los rau HTTP node. Yog tias koj li ngrok URL yog https://ac72hs.ngrok.io, ces koj li ngrok id yog ac72hs.

Kauj ruam 5: Mosquitto

Yoov Tshaj Lij
Yoov Tshaj Lij

Txij li Node-RED tsis muaj nws tus kheej MQTT broker, thiab peb yuav xav tau sib txuas lus nrog peb lub ntsuas cua thiab tus ua haujlwm dhau MQTT, peb yuav siv tus kws tshaj lij MQTT tus tswv. Txij li Node-RED pom zoo Mosquitto, qhov no yog qhov peb yuav siv. Saib ntawm no txhawm rau qee cov ntaub ntawv hais txog MQTT thiab vim li cas nws thiaj siv feem ntau hauv IoT project.

Kev teeb tsa & teeb tsa

  1. Rub tawm Mosquitto los ntawm no thiab nruab nws, txhua yam raws li koj lub operating system.
  2. Feem ntau, koj yuav tsum tau ua raws cov lus qhia ntawm no txhawm rau txuas Node-RED rau Mosquitto. Txawm li cas los xij, yog tias koj siv peb cov ntws, nws twb tau teeb tsa ua ntej rau koj. Tsuav koj txhim kho qhov ntws thiab Mosquitrro kom raug, thiab Mosquitto khiav ntawm chaw nres nkoj 1883 (uas nws khiav los ntawm lub neej ntawd), nws yuav tsum ua haujlwm tawm ntawm lub thawv.
  3. Nco ntsoov tias qhov no txhais tau tias MQTT broker thiab koj Node-RED server khiav ntawm tib lub tshuab. Qhov no muaj txiaj ntsig zoo rau kev sib txuas lus yooj yim hauv cov kab ke. Saib daim ntawv hauv qab no kom paub ntau ntxiv.

Nco tseg txog kev sib tham hauv zos

Txhawm rau kom koj cov cuab yeej ua haujlwm tau zoo nrog Node-RED, koj xav tau lawv kom muaj kev nkag tau mus rau tus broker. Thaum peb tuaj yeem txhais tus sawv cev thiab siv qhov ntawd los sib txuas lus nrog Mosquitto, txhawm rau ua kom muaj teeb meem peb qhia qhov kev daws teeb meem yooj yim: xyuas kom tseeb tias koj lub khoos phis tawj (khiav Node-RED thiab Mosquitto) thiab koj ESP8266 cov laug cam tau txuas nrog tib lub WiFi. Txoj kev ntawd koj li cuab yeej tuaj yeem sib tham nrog koj tus broker ncaj qha, yam tsis muaj tus neeg nruab nrab.

Ib tus yuav nug yog vim li cas tsis siv ngrok rau qhov no, tib yam uas peb siv nws los tshawb xyuas lub dashboard los ntawm lwm lub cuab yeej. Cov lus teb yooj yim yog qhov koj tuaj yeem ua tau - tab sis ngrok raug txwv (hauv cov dawb version) mus rau ib lub qhov los ntawm txhua tus neeg siv. Qhov no txhais tau tias koj tsuas tuaj yeem qhib ib qho chaw nres nkoj rau ntiaj teb sab nraud, uas hauv peb qhov xwm txheej tau siv los nthuav tawm Node-RED. Yog li, es tsis txhob, peb siv kev sib tham hauv zos los hla qhov no.

Qhov no txhais tau tias hauv txhua daim duab koj yuav xav hloov tus IP chaw nyob ntawm tus broker kom haum rau koj lub khoos phis tawj tus IP chaw nyob hauv lub network. Qhov chaw nyob no tuaj yeem nkag tau los ntawm kev khiav ipconfig (ntawm Windows) thiab ifconfig (ntawm Mac / Linux) thiab nrhiav qhov cuam tshuam WiFi cuam tshuam. Nws yuav tsum tau teev nyob rau hauv inet chaw nyob.

Txawm li cas los xij, koj tseem yuav ntsib qee qhov teeb meem MQTT nyob ntawm txoj kev. Vim li ntawd, nws muaj txiaj ntsig los saib xyuas txhua qhov kev nkag thiab tawm MQTT kev mus los.

Saib xyuas MQTT kev mus los

Thaum Mosquitto muab txoj haujlwm no tawm ntawm lub thawv siv mosuitto_sub, rau ntau tus GUI-taw qhia tib neeg tawm muaj cov neeg siv khoom nrog cov duab sib tham yuav yooj yim siv. MQTTfx yog ib qho cuab yeej zoo uas peb tau siv thoob plaws hauv kev ua haujlwm ntawm txoj haujlwm no, thiab peb pom zoo nws los hauv qab peb lub siab. Ua tsaug Jens Deters rau qhov cuab yeej txaus!

Kauj Ruam 6: Pushbullet

Pushbullet
Pushbullet
Pushbullet
Pushbullet

Pushbullet yog qhov kev pabcuam ceeb toom thawb. Nws tso cai rau koj sau npe koj lub cuab yeej rau cov kev pabcuam, thiab tom qab ntawd thawb cov ntawv ceeb toom rau nws raws li ob peb qhov ua tau ua ke. Peb yuav siv nws los ceeb toom rau peb lub cuab yeej thaum ib yam khoom hauv tsev tau tso tseg lossis qhib, thiab ntxiv qhov txuas mus rau lub dashboard yog li peb tuaj yeem kaw lossis tua yam uas peb tsis nco qab saib xyuas ua ntej tawm hauv tsev.

Sau Npe & Kho

  1. Sau npe rau Pushbullet tus lej hauv no siv koj tus lej Google.
  2. Rub tawm Pushbullet Android app los ntawm no.
  3. Tom qab nkag mus rau hauv Pusbullet, nyem qhov no thiab ntxiv koj lub cuab yeej siv lub pob rau sab laug.
  4. Tom qab ntawd mus ntawm no thiab xaiv Tsim Access Token. Nco tseg ntawm tus cim no, peb yuav xav tau nws hauv qib tom ntej.
  5. Mus rau Node-RED, thiab nyem qhov Send Push Notification node.
  6. Hauv lub sidebar (saib daim duab) xaiv "PushBullet Config", thiab tom qab ntawd tus xaum cim.
  7. Ntxiv Access Token los ntawm qib 4 mus rau "API Key" teb.
  8. Tam sim no koj yuav tsum tuaj yeem tau txais cov ntawv ceeb toom thawb ntawm koj lub xov tooj.

Kauj Ruam 7: Arduino IDE

Arduino IDE Cov
Arduino IDE Cov

Peb siv ESP8266 cov laug cam hauv qhov kev qhia no los tswj hwm ntau yam khoom siv uas peb siv. Txhawm rau rub peb cov software rau cov laug cam, peb yuav tsum tau nyem lawv siv USB cable. Cov txheej txheem yog qhov yooj yim heev: Koj txuas lub rooj tsavxwm rau koj lub khoos phis tawj, thiab tom qab ntawd nyem lub pob. Txawm li cas los xij, kom mus txog ntawd, peb yuav tsum tau ua qee qhov teeb tsa ua ntej.

Kev teeb tsa & teeb tsa

  1. Ua raws li phau ntawv qhia no txhawm rau txhim kho Arduino IDE.
  2. Ua raws li phau ntawv qhia no txhawm rau txhim kho qhov cuam tshuam "tsav tsheb" rau ESP8266 cov laug cam rau koj Arduino IDE.
  3. Nco ntsoov tias koj siv lub USB cable kom raug (tsis yog lub zog ib, cov ntaub ntawv ib qho) thaum rub cov duab kos (cov ntaub ntawv.ino) rau koj cov laug cam.

Tshaj tawm cov duab kos rau cov laug cam

Hauv cov kauj ruam tom ntej - uas yuav cuam tshuam nrog txuas cov cuab yeej kho vajtse rau peb cov software software uas twb muaj lawm - peb tsuas yog hais "upload cov duab kos rau lub rooj tsavxwm". Txhawm rau khaws txhua cov theem hauv qab no ntau ntxiv txog kho vajtse thiab tsawg dua txog software, peb tau hais qhia ntxaws txog kev xa tawm ib zaug hauv no:

  1. Txuas lub rooj tsavxwm rau koj lub computer siv USB cable.
  2. Qhib Arudiono IDE.
  3. Qhib daim duab uas koj rub tawm rau cov kauj ruam cuam tshuam.
  4. Hauv "Cov cuab yeej" Ntawv qhia zaub mov, xaiv pawg tswj hwm cuam tshuam hauv qab "Board" xaiv.
  5. Hauv tib cov ntawv qhia zaub mov, nco ntsoov qhov "Chaw nres nkoj" xaiv qhov chaw nres nkoj uas koj pawg thawj coj tau txuas nrog. nws yuav tsum ua li ntawd los ntawm lub neej ntawd, tab sis yog tias tsis yog tsuas yog xyuas kom nws ua tau. Yog tias koj tsis paub meej tias qhov chaw nres nkoj twg hauv koj lub computer yog qhov twg, saib cov kauj ruam tom ntej.
  6. Tshaj tawm daim duab kos rau lub rooj tsavxwm los ntawm txhaj lub pob nyem nyob rau sab xis saum toj ntawm lub vijtsam (sab xis ntawm lub cim cim). Qhov no yuav suav thiab sim xa cov duab kos rau lub rooj tsavxwm.
  7. Yog tias cov kauj ruam hauv qab no ua tsis tiav, sim xaiv lwm qhov chaw nres nkoj lossis lwm lub rooj tsavxwm hauv cov cuab yeej ntawv qhia zaub mov.
  8. Yog tias koj tseem nyam, sim ua tib zoo saib ntawm Quora cov lus teb no rau cov kauj ruam tom ntej.

Kauj ruam 8: Dashboard

Lub Dashboard
Lub Dashboard

Cov duab saum toj no qhia yuav ua li cas lub dashboard qhov kawg yuav zoo li. Nco ntsoov cov keyboards? Lawv qhib ntau yam khoom siv kho vajtse peb yuav teeb tsa hauv cov kauj ruam tom ntej. LEDs yog cov xwm txheej ntsuas uas hloov pauv thaum lub ntsuas tau pom qee qhov kev hloov pauv, ntxiv rau thaum peb tig lub pob hluav taws xob.

Kauj Ruam 9: Lub Teeb Sensor

Lub teeb Sensor
Lub teeb Sensor
Lub teeb Sensor
Lub teeb Sensor
Lub teeb Sensor
Lub teeb Sensor

Qhov ntsuas lub teeb no yuav pab koj qhia seb koj puas tso lub teeb tawm lossis tawm hauv ib chav ntawm koj lub tsev. Thaum ua kom zoo rau hauv ib lub thawv thiab muab ze rau ntawm lub teeb, nws tuaj yeem tsis loj dua ob lub thawv ntawv sib dhos ua ke.

Assmebly + Kev teeb tsa

  1. Hlau xaim hluav taws xob raws li suav nrog Fritzing schematic.
  2. Qhib daim duab, thiab hloov pauv li hauv qab no:

    • mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
    • ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
    • lo lus zais - Lo lus zais ntawm hais tias WiFi network
  3. Tshaj tawm cov duab kos rau hauv koj lub rooj tsavxwm.
  4. Kuaj nws ntawm lub dashboard!

Dashboard Saib ntawm "Lub Teeb" tab's LED - nws yuav qhia seb lub teeb tau qhib lossis tua.

Kauj Ruam 10: Tus Neeg Siv Hluav Taws Xob Ntse

Smart Outlet Activator
Smart Outlet Activator
Smart Outlet Activator
Smart Outlet Activator
Smart Outlet Activator
Smart Outlet Activator

Lub Ntse Hluav Taws Xob siv lub zog txuas ib txwm (nrog rau qhov ntev txuas txuas txuas ntxiv) thiab hloov pauv mus rau hauv Lub Hom Phiaj Ntse-uas yog, Wi-nkaus tso cai txuas tau saib xyuas kev hloov pauv nws thiab tawm nrog nyem lub pob los ntawm Node-RED dashboard. Txoj kev ntawd, yog tias koj tsis nco qab tua qee yam uas tau ntsaws rau hauv lub qhov hluav taws xob, koj yuav tuaj yeem tua nws tus kheej!

Sib dhos + Kho

  1. Txiav lub hwj huam qaum hauv nruab nrab, thiab hle cov xov hlau.
  2. Ntxig cov xov hlau uas tau muab tshem tawm hauv lub dav hlau ntsia hlau raws li Fritzing Schematic.
  3. Qhib daim duab, thiab hloov pauv li hauv qab no:
  4. mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
  5. ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
  6. lo lus zais - Lo lus zais ntawm hais tias WiFi network
  7. Upload tus kos duab rau lub rooj tsavxwm.
  8. Txuas cov ntaub thaiv npog txuas rau lub rooj tsavxwm.
  9. Sib sau ua ke hauv Circuit Court raws li Fritzing schema.
  10. Kuaj nws ntawm lub dashboard!

Cov ntsiab lus ntxiv - Casing

  1. Yog tias koj tuaj yeem ua tau, laser-txiav lub casing siv SmartOutletCasing duab txuas. Yog tias qis dua ntawm cov tshuab txiav laser, nqa lub thawv ntawv thawv, muab daim duab tso rau ntawm ib sab ntawm nws, thiab txiav daim tawm.
  2. Txiav ob lub qhov nyob rau sab ntawm lub thawv, thiab xaub rau hauv lub hwj huam hluav taws xob zoo li hauv daim duab txuas.
  3. Tie tawm qhov kawg ntawm kab txaij hauv lub npov, kom ntseeg tau tias lub voj voog yuav tsis rub los ntawm lub qhov.

Dashboard

Saib ntawm "Smart Outlet" tab's LED - nws yuav qhia seb qhov Smart Outlet tau qhib lossis tua. Ib qho ntxiv, flick qhov hloov pauv rau thiab tawm kom lom zem thiab tau txais txiaj ntsig!

Kauj Ruam 11: Tus Qhib Qhov Rooj

Qhov Rooj Activator
Qhov Rooj Activator
Qhov Rooj Activator
Qhov Rooj Activator
Qhov Rooj Activator
Qhov Rooj Activator

Lub tswv yim zoo no tig tus yuam sij rov qab los, ua rau peb xauv thiab qhib lub qhov rooj. Tshwj xeeb, yog tias koj tso koj lub qhov rooj xauv thaum koj tawm hauv koj lub tsev, koj tuaj yeem kaw nws nyob deb!:)

Sib dhos + Kho

  1. Qhib daim duab, thiab hloov pauv li hauv qab no:
  2. mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
  3. ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
  4. lo lus zais - Lo lus zais ntawm hais tias WiFi network
  5. Muab cov duab kos rau ESP8266 pawg thawj coj saib.
  6. Sib dhos cov Circuit Court raws li cov txheej txheem. Nco ntsoov tias peb siv lub zog sab nraud los tswj hwm (lub zog muaj zog) DC lub cev muaj zog. Qhov no xav tau L298-N HBridge thiab lub zog sab nraud. Peb tsis xav tau kev siv tshuaj yaj yeeb vim tias ob tus poj niam lub tog raj kheej thiab HBridge muaj cov ntsia hlau zoo uas peb tuaj yeem siv tau - peb hle ib qho kawg ntawm ob peb lub jumper cable rau qhov zoo ntawm cov kev sib txuas. Thov kom lawv nyob kaj siab lug.
  7. Kuaj nws ntawm lub dashboard!

Cov Ntsiab Lus Ntxiv - Casing

Peb tau siv tus qauv tsim los ntawm Jack Lew. Yog tias koj tau nkag mus rau lub tshuab luam ntawv 3D, nws yog qhov xwm txheej txaus koj tuaj yeem lo ntawm koj lub qhov rooj thiab khawm nrog cov ntsia hlau lossis cov kua nplaum kub.

Dashboard Saib ntawm "Qhov Rooj" tab's LED - nws yuav qhia seb lub qhov rooj qhib lossis kaw. Ib qho ntxiv, flick qhov hloov pauv rau thiab tawm kom lom zem thiab tau txais txiaj ntsig!

Kauj Ruam 12: Qhov rai Sensor

Qhov rai Sensor
Qhov rai Sensor
Qhov rai Sensor
Qhov rai Sensor
Qhov rai Sensor
Qhov rai Sensor

Tsis txhob cia tus miv tawm! Qhov ntsuas no siv Reed Relay los tshuaj xyuas seb lub qhov rais qhib lossis kaw. Nco ntsoov tias peb tau xaiv lub qhov rai tsuas yog rau qhov piv txwv - nws tuaj yeem siv rau ntau yam ntxiv, suav nrog kuaj xyuas seb lub qhov rooj qhib lossis tsis qhib, suav nrog lub tsev, chav nyob thiab lub qhov rooj tub yees.

Sib dhos & Kho

  1. Sib sau ua ke lub Circuit Court raws li Fritzing schematic saum toj no.
  2. Qhib daim duab, thiab hloov pauv li hauv qab no:
  3. mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
  4. ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
  5. lo lus zais - Lo lus zais ntawm hais tias WiFi network
  6. Upload koj daim duab kos rau lub rooj tsavxwm.
  7. Txuas ib feem ntawm Reed Relay mus rau lub qhov rais sill, thiab lwm qhov rau lub qhov rais nws tus kheej (lossis xijpeem qhib koj tau txiav txim siab xa lub sensor rau).
  8. Kuaj tawm ntawm lub dashboard!

Dashboard

Saib ntawm "Window" tab's LED - nws yuav qhia seb lub qhov rais qhib lossis kaw.

Kauj Ruam 13: Qhov Tshav Kub Kub Sensor

Chaw Rhaub Kub Sensor
Chaw Rhaub Kub Sensor
Chaw Rhaub Kub Sensor
Chaw Rhaub Kub Sensor
Chaw Rhaub Kub Sensor
Chaw Rhaub Kub Sensor

Tawm hauv qhov chaw tso cua sov yog qhov muaj kev nyab xeeb rau hluav taws! Nyob nyab xeeb thiab saib xyuas koj lub rhaub cua sov los ntawm qhov deb, siv qhov Circuit no. Tshwj xeeb, lub ntsuas cua sov ntawm lub ntsuas hluav taws xob saib xyuas cua sov rau lub sijhawm ntev - nyuaj -coded rau 5 feeb rau qhov tsis muaj txiaj ntsig - thiab nws tseem tseem kub hnyiab tom qab lub sijhawm ntawd, ntxeev LED hauv lub dashboard. Qhov no yog ua tiav txhawm rau tiv thaiv kom tsis txhob tshav kub (zoo li tom qab koj tig lub rhaub cua sov tawm) los ntawm kev qhib lub LED thaum muaj xwm txheej.

Sib dhos & Kho

  1. Sib sau ua ke lub Circuit Court raws li txuas Fritzing schematic.
  2. Qhib daim duab, thiab hloov pauv li hauv qab no:
  3. mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
  4. ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
  5. lo lus zais - Lo lus zais ntawm hais tias WiFi network
  6. Upload daim duab txuas rau koj lub rooj tsavxwm.
  7. Muab ze rau qhov chaw tso cua sov, tos 5 feeb thiab tshawb xyuas lub dashboard!

Dashboard

Saib rau ntawm "Chaw Rhaub Dej" tab's LED - nws yuav qhia seb lub tshuab rhaub dej qhib los yog tua.

Kauj Ruam 14: Hloov Xovxwm Activator

Hloov Xovxwm Activator
Hloov Xovxwm Activator
Hloov Xovxwm Activator
Hloov Xovxwm Activator

Qhov no yog lub cav Servo yooj yim heev uas tuaj yeem tig lub cev hloov lossis qhib (hloov lub teeb, hloov dej rhaub dej, hloov lub zog hloov pauv thiab lwm yam). Yog tias koj tso ib qho ntawm cov khoom hloov pauv hauv koj lub tsev nyob - piv txwv li lub teeb lossis lub rhaub dej - koj tuaj yeem hloov nws tawm ntawm qhov chaw deb.

Sib dhos & Kho

  1. Qhib daim duab, thiab hloov pauv li hauv qab no:
  2. mqtt_server - Koj lub khoos phis tawj tus IP chaw nyob (raws li nws tau khiav Mosquitto, MQTT broker)
  3. ssid - Lub npe ntawm WiFi network koj lub khoos phis tawj tau txuas nrog, thiab koj xav kom koj lub rooj sib tham txuas nrog
  4. lo lus zais - Lo lus zais ntawm hais tias WiFi network
  5. Upload cov duab kos rau koj lub rooj tsavxwm.
  6. Sib sau ua ke hauv Circuit Court raws li Fritzing schematic.
  7. Txuas tus Servo mus rau qhov hloov pauv cuam tshuam nrog siv cov kua nplaum lossis lub ntsej muag zoo uas koj tau ua rau koj tus kheej. Xa peb daim duab yog tias koj ua ib qho!
  8. Ntsuam xyuas lub dashboard!

Dashboard

Saib ntawm "Hloov Xovxwm" tab's LED - nws yuav qhia seb lub xov tooj hloov pauv tau qhib lossis tua. Ib qho ntxiv, flick qhov hloov pauv rau thiab tawm kom lom zem thiab tau txais txiaj ntsig!

Pom zoo: