Cov txheej txheem:

Haib Standalone Home Automation System - Pi, Sonoff, ESP8266 thiab Node -Red: 9 Kauj Ruam (nrog Duab)
Haib Standalone Home Automation System - Pi, Sonoff, ESP8266 thiab Node -Red: 9 Kauj Ruam (nrog Duab)

Video: Haib Standalone Home Automation System - Pi, Sonoff, ESP8266 thiab Node -Red: 9 Kauj Ruam (nrog Duab)

Video: Haib Standalone Home Automation System - Pi, Sonoff, ESP8266 thiab Node -Red: 9 Kauj Ruam (nrog Duab)
Video: DIY Home Automation Intruder Alarm System! || Home Assistant + Raspberry Pi + ESP8266 2024, Hlis ntuj nqeg
Anonim
Haib Tsis Txaus Siab Hauv Tsev Automation System - Pi, Sonoff, ESP8266 thiab Node -Red
Haib Tsis Txaus Siab Hauv Tsev Automation System - Pi, Sonoff, ESP8266 thiab Node -Red

Phau ntawv qhia no yuav tsum tau coj koj mus rau thawj lub hauv paus uas koj tuaj yeem hloov lub teeb lossis khoom siv ntawm/tawm ntawm txhua lub cuab yeej uas tuaj yeem txuas rau koj lub network hauv zej zog, thiab nrog lub vev xaib zoo sib xws tuaj yeem hloov kho. Kev nthuav dav rau kev txuas ntxiv/ ntxiv cov yam ntxwv yog qhov dav, suav nrog xa email, twitter lus, nyeem ntawv ntsuas (piv txwv li kub). Koj tuaj yeem teeb tsa txoj cai yooj yim xws li - yog tias qhov ntsuas kub qis dua 15C thaum 11 teev tsaus ntuj tig rau daim pam hluav taws xob rau 30 feeb. Cov kab ke siv MQTT raws tu qauv nrog TCP uas muaj txiaj ntsig zoo dua li UDP - uas yog qhov xav tsis thoob uas siv los ntawm qee lub tsev lag luam khoom siv hauv tsev. Thaum qhov ua haujlwm nyuaj ntawm teeb tsa lub kaw lus, piav qhia ntawm no, ua tiav kev lom zem tuaj yeem pib. Node Red muab cov neeg siv zoo heev cuam tshuam uas yog siv tau, nrawm thiab yooj yim teeb tsa, thiab muab peev xwm zoo kawg.

Qhov txiaj ntsig yog lub zog siv hluav taws xob hauv tsev muaj zog uas muaj kev tswj hwm tus kheej thiab tag nrho ntawm lub network hauv ib cheeb tsam. Ntau ntawm cov kab ke qhia ntawm Instructables ua haujlwm nrog huab raws cov servers thiab yog li muaj kev pheej hmoo kev nyab xeeb thiab tuaj yeem xav tau kev tso npe. Cov no yog teeb tsa tau yooj yim dua tab sis muaj kev pheej hmoo nyab xeeb siab dua thiab muaj feem yuav raug nqi ntau dua. Kuv yuav tsum ntxiv tias ib tus tuaj yeem teeb tsa VPN (virtual ntiag tug network) rau Pi kom muaj kev ruaj ntseg txuas mus rau lub tsev network/kab ke yog tias nkag los sab nraud yuav muaj txiaj ntsig (Google Pi OpenVPN rau cov lus qhia).

Cov kab ke no xav kom rov sau dua cov cuab yeej Sonoff nrog rau qhov qhib qhov system hu ua Sonoff-Tasmoda. Qhov no tuaj yeem ua tiav siv kev teeb tsa tshwj xeeb Arduino thiab USB rau hloov pauv hloov. Sonoff cov cuab yeej siv ESP8266 Wi-Fi nti yog li koj kuj tseem tuaj yeem tsim koj tus kheej cov cuab yeej siv ESP8266 cov qauv lossis haum lawv rau lwm yam khoom kom xa kev sib txuas wireless.

Txoj haujlwm loj tshaj yog teeb tsa Raspberry Pi ua lub hauv paus. Qhov no khiav MQTT broker (lossis server) uas tswj kev sib txuas lus nrog cov khoom siv sib txuas. Tus Pi kuj tseem siv lub kaw lus hu ua Node-Red uas tuaj yeem cuam tshuam cov lus thiab cov ntaub ntawv thiab cov lus txib tso tawm-xws li thaum yuav qhib hluav taws xob. Node-Red kuj tseem muaj kev cuam tshuam los pab rau lub vev xaib uas koj tuaj yeem nkag mus rau ntawm lub xov tooj smartphone/ntsiav tshuaj/PC/Laptop, kom pom dab tsi tshwm sim thiab pab kom hloov phau ntawv teeb thiab ntxiv rau.

Kuv lub hom phiaj nrog cov lus qhia no yog muab txhua kauj ruam hauv cov ncauj lus kom ntxaws uas cov neeg tshiab tuaj yeem ua haujlwm tau zoo.

Cov kauj ruam yog:

  • Thauj khoom Pi nrog Rasbian Stretch
  • Hloov kho thiab ntxiv cov yam ntxwv rau Node-Red
  • Nruab Mosquitto MQTT broker
  • Teeb tsa Arduino ib puag ncig rau kev tshaj tawm Sonoff-Tasmota firmware
  • Rov ua haujlwm dua Sonoff hloov
  • Teeb tsa Node-Red interface
  • Xeem nws ua haujlwm.

Kho vajtse koj yuav xav tau:

  • Raspberry Pi thiab lub zog siv hluav taws xob (thiab cov keyboard thiab saib xyuas rau qhov pib teeb tsa) (qauv B siv ntawm no)
  • Sonoff Hloov
  • USB Serial converter
  • Yeem tau - ESP pawg thawj coj txhim kho xws li NodeMCU.

Kuv qhov kev paub nrog Raspberry Pi yog qhov teeb tsa txhua yam zoo li cuam tshuam ntau qhov mob ntau dua li ib qho tuaj yeem xav txog qhov ua tau nrog cov khoom tsis ua haujlwm lossis raug daig ntawm qee qib tsis tseem ceeb uas qhov kev piav qhia yuav zoo dua. Cov rooj sab laj tsis tas yuav tau txais cov lus qhia uas ua haujlwm! Kuv pom ntau txoj hauv kev uas yooj yim tsis ua haujlwm rau ib qho lossis lwm qhov. Qhov no raug nqi 3 hnub! Kuv mam li so txhua yam thiab pib tshiab thiab ua tiav hauv tsawg dua ib hnub (ntev). Qhov no txawm li cas los siv tus laus Raspian Jessie. Tom qab qhov no kuv pom txoj hauv kev siv tam sim no thiab nyuam qhuav tso tawm version (Stretch) thiab tau ua txhua yam ntxiv. Phau ntawv qhia no ua rau luam thiab muab cov lus qhia tso rau hauv Pi. Yog li koj yuav tsum tau ua tiav hauv ob peb teev. Xijpeem kuv vam tias qhov no ua rau koj sai dua txoj kev kawm nkhaus thiab nrog mob ntau dua. Ntseeg kuv nws tsim nyog rau qhov kawg.

Kauj Ruam 1: Thauj Tus Pi Nrog Rasbian Stretch

Qhov no yuav tsum yooj yim heev. Pib nrog daim npav 8Gb lossis 16Gb SD. Download tau qhov tseeb version ntawm:

www.raspberrypi.org/downloads/

Cov xov tseem ceeb ntawm no xav tias tag nrho cov ntawv raug thauj khoom. Txawm li cas los xij koj tuaj yeem siv cov ntawv Lite kom txuag chaw. Yog tias siv Raspbian Stretch Lite ua tiav los ntawm cov kauj ruam no thiab tom qab ntawd mus rau Kauj Ruam 9 thaum kawg.

Unzipping cov ntawv rub tawm muab lub nplaub tshev nrog cov ntawv.img. 7Zip raug pom zoo rau Windows (thiab Unarchiver Mac). Cov duab yuav tsum tau hlawv mus rau SD daim npav - tab sis ib qho haujlwm tshwj xeeb yuav tsum tau siv raws li cov ntaub ntawv kaw lus tsis sib xws nrog Windows. Cov software pom zoo hu ua Etcher thiab tuaj yeem rub tawm los ntawm:

etcher.io/

Cov lus qhia rau Etcher nyob ntawm lawv lub vev xaib thiab tsis tuaj yeem yooj yim dua. Xaiv cov duab thiab tsav thiab nyem Flash.

Tam sim no nrog peb daim npav SD flashed nrog tuaj yeem ua rau Pi khiav.

Yog tias koj paub tus IP chaw nyob uas koj Pi siv lossis zoo siab pom nws los ntawm kev nkag mus rau koj lub router ces koj tuaj yeem zam qhov xav tau keyboard thiab saib xyuas thiab siv SSH tam sim ntawd. Tsuas yog ntxiv cov ntaub ntawv uas tsis muaj npe hu ua SSH rau hauv daim npav SD, ntxig, txuas rau Ethernet thiab txuas lub zog. Txwv tsis pub ua raws li phau ntawv qhia hauv qab no.

Txuas tus Pi mus rau internet, tshuaj ntsuam, nas thiab keyboard thiab txuas rau lub zog. Thawj qhov peb yuav ua yog pab kom SSH yog li peb tuaj yeem ua feem ntau ntawm kev teeb tsa los ntawm kev nplij siab hauv PC. Nws tuaj yeem ua tiav ncaj qha tab sis nws pab tau zoo kom muaj peev xwm ua raws phau ntawv qhia no ntawm tib lub cuab yeej ua ib tus tsav tsheb Pi thiab siv daim ntawv theej thiab muab tshuaj txhuam rau feem ntau ntawm cov lus qhia. Tsis tas li hauv kuv qhov xwm txheej kuv lub PC ua haujlwm tau zoo thiab xis nyob tab sis tsis loj txaus rau pi ib yam.

Muaj cov lus qhia rau kev ua haujlwm tau zoo ntawm YouTube video. Nov yog qhov kuv pib. Koj tuaj yeem khiav cov vis dis aus nrog ua raws cov lus qhia no. Txawm li cas los xij thaum kuv tab tom hla cov txheej txheem dua thaum sau ntawv no kuv pom nws yooj yim dua tsuas yog ua raws cov lus qhia ntawm no. Muaj qee qhov kev hloov pauv tseem ceeb. Kuj tseem muaj qee ntu uas kuv tau qhia ua raws cov vis dis aus ntau dua li teev cov kauj ruam ntawm no. Txawm li cas los xij kuv yuav pom zoo saib nws kom nkag siab txog MQTT, Node-Red thiab txheej txheem teeb tsa dav. Cov vis dis aus ntev 38 feeb yog li ua rau koj tus kheej xis nyob. Cov vis dis aus pib nrog qhia dab tsi Node Red tuaj yeem ua tau, thiab tom qab ntawd npog Pi teeb tsa thiab teeb tsa, tom qab ntawd hloov kho Node Red thiab kawg txhim kho Mosquitto. Lub sijhawm tseem ceeb yog tias koj xav rov qab mus rau ntu:

00:00 Taw qhia rau Video

03:00 Node Red ua qauv qhia

14:14 Importing dashboard khoom rau hauv Node Red

21:05 Pi pib teeb tsa, suav nrog SSH

23:35 Kev teeb tsa ntawm Node Red txhawb txoj cai

27:00 Taw qhia rau MQTT

29:12 Mosquitto (MQTT) teeb tsa (Nco tseg tsuas yog ua haujlwm rau Raspian Jessie)

33:00 Node Red piv txwv

Kuv yuav teev cov lus txib hauv cov ntawv qaij (tsis yog siv ""). Hom ntawv no tsis quav ntsej thaum koj luam thiab muab tso rau hauv Pi.

Kev taw qhia rau Node Red yuav muab tswv yim rau koj tias lub kaw lus tuaj yeem ua dab tsi thiab muab daim duab ntawm qhov chaw peb yuav xaus.

Cov vis dis aus YouTube yog ntawm:

Ua raws cov txheej txheem teeb tsa los ntawm 21:05 txog 23:35. Nco ntsoov lub neej ntawd tus ID nkag mus yog tus siv: pi thiab password: raspberry. Ua ntej rov pib dua nrhiav tus pi tus IP chaw nyob. Tog twg los nyem qhov 'nce+nqis xub' icon hauv lub desktop saum toj bar lossis nkag mus rau cov lus qhia hauv qab no hauv lub davhlau ya nyob twg/davhlau ya nyob twg:

sudo ifconfig chaw nyob

Tom qab ntawd nco ntsoov tus IP chaw nyob tom qab: inet addr:. Nws yuav nyob hauv daim ntawv 192.168.x.y

Nco ntsoov qhov chaw nyob no thiab rov pib dua (sau: sudo kaw tam sim no)

Qhov tseem ceeb ntawm qhov no yog tias SSH tau qhib thiab ib tus tuaj yeem teeb tsa qhov txuas mus rau Pi los ntawm PC (Mac thiab Linux suav nrog SSH cuam tshuam). Ib txoj haujlwm zoo los ua qhov no yog rub tawm dawb hu ua PuTTY uas tseem tuaj yeem siv ua ntu ntu thiab tuaj yeem ua Telnet. Putty yog muaj los ntawm:

www.chiark.greenend.org.uk/~sgtatham/putty…

Rub tawm thiab teeb tsa PuTTY.

Tam sim no, nrog Pi rov pib dua, pib PuTTY thiab nkag mus rau tus IP chaw sau tseg ua ntej. Saib piv txwv hauv qab no:

Tam sim no nyem Qhib

Tom qab ID nkag mus li: nkag mus pi

Tom qab ntawd sau koj tus password.

Tam sim no ua raws cov lus qhia ntawm no thiab xaiv tau pib cov vis dis aus los ntawm 23:35. Feem ntau koj tuaj yeem luam thiab muab tshuaj txhuam. Nyeem cov ntawv thiab siv ctrl+C los theej. Tom qab ntawv nyem rau hauv PuTTY kom muab tshuaj txhuam. Qee zaum cov ntawv tsis tshwm tam sim ntawd tos ob peb feeb. Yog tias koj nkag ob zaug siv backspace tshem tawm qhov nkag thib ob. Nias sau kom ua tiav txhua qhov kev qhia.

sudo raspi-hloov tshiab

Kuv tau txais cov lus txib tsis pom thiab tsis quav ntsej qhov no thiab cov lus qhia hauv qab no kaw/rov pib dua:

sudo kaw -r tam sim no

sudo apt -tau -y hloov tshiab

sudo apt -tau -y txhim kho

Qhov no yuav siv sijhawm me ntsis ….

sudo apt-tau tshem tawm autoremove

sudo apt -tau -y hloov tshiab

sudo kaw -r tam sim no

Txog tam sim no peb muaj Pi operating system thauj khoom thiab hloov kho tshiab, npaj rau theem tom ntej.

Kauj Ruam 2: Hloov kho thiab Ntxiv Nta rau Node-Red

Kev sib txuas PuTTY yuav ploj los ntawm kev rov pib dua thaum kawg ntawm cov kauj ruam dhau los. Yog li kaw PuTTY thiab tom qab tos rau Pi rau khau raj, Nkag mus rau ib zaug ntxiv ua ntej.

Kuv tau hloov mus rau txoj kev yooj yim dua thiab ntseeg tau dua los thauj Node-Red-ua raws txoj hauv kev ntawm https://nodered.org/docs/hardware/raspberrypi. Qhov no siv tsab ntawv thiab yuav teeb tsa lossis hloov kho Node-Red-yog li txoj hauv kev yog tib yam ua haujlwm los ntawm tag nrho lossis cov ntawv nyeem ntawm Raspbian Stretch. Yog li nkag mus:

bash <(curl -sL

Sau Y thaum hais kom ua (ob zaug). Tsab ntawv no tseem thauj cov ntaub ntawv xav tau los pab kom pib pib ntawm Node-Red.

Yog li ntawm qhov no peb muaj peb pi thauj khoom thiab hloov kho thiab nrog qhov hloov tshiab xav tau rau Node Red. Nws tsis muaj kev phom sij los rov pib ua ntej qib tom ntej.

sudo kaw -r tam sim no

Kauj Ruam 3: Mosquitto MQTT Installation

Yog tias koj tseem tsis tau ua li ntawd nws tsim nyog saib cov vis dis aus qhia rau MQTT ntawm cov vis dis aus thaum 27:00.

Nov yog qhov uas peb yuav tsum taug txoj kev sib txawv. Cov txheej txheem tau hais tseg hauv daim vis dis aus tsuas ua haujlwm rau Jessie tus laus dua ntawm Raspian. Muaj kev sib tham ntawm qhov chaw mositto tab sis tsis muaj qhov tshwm sim pom tseeb thiab yog li yuav ua raws txoj hauv kev yooj yim dua thiab nyab xeeb dua.

Yog li nkag mus siv PuTTY thiab sau cov hauv qab no:

sudo apt-tau hloov tshiab

sudo apt-tau nruab mosquitto mosquitto-cov neeg siv khoom

Y

sudo /etc/init.d/mosquitto nres

sudo /etc/init.d/mosquitto pib

Ob qhov kev qhia tom ntej no nres thiab pib ua mositto thiab qhia tias peb tus broker MQTT ua haujlwm.

Rau qhov kev sim nrawm qhib ob ntu PuTTY ntxiv thiab nkag mus rau txhua qhov.

Koj yuav paub tam sim no tias MQTT ua haujlwm los ntawm lub cuab yeej xav tau cov ntaub ntawv sau npe mus rau 'ncauj lus'. Tus broker yuav xa cov ntaub ntawv nrog tib 'lub ncauj lus'. Tom qab ntawd lub cuab yeej xav xa cov ntaub ntawv/kev qhia tshaj tawm qhov no rau tus tswv lag luam siv tib 'ncauj lus'.

Yog li hauv ib ntu PuTTY nkag mus:

mosquitto_sub -d -t nyob zoo/ntiaj teb

Nov yog cov lus qhia txhawm rau sau npe rau lub ncauj lus: nyob zoo/ntiaj teb.

Hauv lwm qhov nkag mus:

mosquitto_pub -d -t nyob zoo/ntiaj teb -m "Nyob zoo los ntawm Terminal qhov rai 2!"

Nov yog tshaj tawm kev qhia nrog tib lub ncauj lus nrog cov lus. Cov ntawv: “Nyob zoo los ntawm Terminal qhov rai 2!” yuav tsum tam sim no tshwm sim hauv lwm lub davhlau ya nyob twg.

Ua tau zoo kom deb li no. Tam sim no peb muaj Pi thauj khoom thiab hloov kho tshiab nrog cov hloov tshiab xav tau rau Node-Red thiab nrog yoov tshaj cum MQTT tus tswv lag luam teeb tsa thiab sim. Txij no mus lub neej tau yooj yim dua lom zem dua. Kaw ob ntu PuTTY siv rau kev xeem MQTT.

Kauj Ruam 4: Teeb Node Red Interface

Ua ntej peb yuav tsum pib Node Red. Sau cov lus qhia:

node-red-pi --max-old-space-size = 256

Tos kom nws tau khiav thiab koj pom cov ntawv 'Pib ntws'.

Tam sim no qhib qhov browser, Kuv siv Chrome, thiab nkag mus rau tus IP chaw nyob sau ua ntej los ntawm: 1880 piv txwv li qee yam xws li 192.168.0.8:1880

Tam sim no koj yuav tsum muaj Node Red programming nplooj ntawv pom hauv qab no:

Tam sim no koj tuaj yeem ua raws Node Red piv txwv pib ntawm 33:00 lossis txav ncaj mus rau qhov me me ntawm kev teeb tsa ntxiv thiab thauj thawj qhov ntws uas yuav qhia qhov txuas rau MQTT thiab npaj kom tsav peb qhov hloov pauv.

Kev teeb tsa ntxiv xav tau yog ntxiv cov khoom dashboard uas ua rau lub web interface.

Cov no tau qhia hauv video ntawm 14:14.

Ua raws cov lus qhia txhawm rau txhawm rau node-red-dashboard.

Tam sim no peb tuaj yeem ua si me ntsis thiab qhia MQTT ua haujlwm thiab raug tsav los ntawm Node-Red. Qhov no tsis nyob hauv video tab sis yog tus yuam sij rau txoj haujlwm no. Koj tuaj yeem ua raws kuv cov lus qhia thiab/lossis ntshuam cov dej ntws los ntawm NRtest1.txt cov ntawv txuas nrog.

Ua ntej tshaj tawm cov tshuaj tawm ntawm cov node thiab cov zis mqtt node thiab txuas lawv ua ke.

Ob npaug nias qhov txhaj tshuaj (uas pib tau sau daim ntawv teev sijhawm). Hauv seem Payload siv twiddly hloov mus rau txoj hlua thiab nkag mus: Nyob zoo los ntawm kuv. Cia cov ncauj lus tsis muaj dab tsi raws li peb tuaj yeem nkag rau qhov no hauv MQTT node. Nyem Ua tiav

Tam sim no ob npaug nias rau MQTT ntawm. Nyem rau tus xaum cim rau sab xis ntawm ntu Server. Qhov no qhib qhov kev sib tham tshiab. Nkag mus: localhost hauv ntu Server. Nyem Ntxiv Tam sim no, rov qab rau hauv Kho kom raug mqtt tawm ntawm qhov, nkag mus rau peb cov ncauj lus hauv ntu Topic: nyob zoo/ntiaj teb. Set QoS to 1. Nyem Ua tiav. Tam sim no nyem Deploy. Koj yuav tsum pom lub ntsej muag ntsuab thiab 'txuas nrog' hauv qab mqtt node.

Tam sim no ntxiv ob qho ntxiv - nkag mqtt thiab debug cov zis, thiab txuas cov no ua ke. Tam sim no ob npaug nyem rau qhov nkag mqtt node thiab nkag mus nyob zoo/ntiaj teb hauv ntu nqe lus. Tus neeg rau zaub mov yuav tsum qhia pom localhost: 1883. Set QoS to 1. Nyem Ua tiav. Tom qab ntawd nyem Deploy thiab nyem qhov debug tab ntawm sab xis ntawm lub pane. Tam sim no nyem lub xwmfab grey nyob rau sab laug ntawm 'Nyob zoo los ntawm kuv' txhaj rau qhov. Qhov no xa cov ntawv xa nyiaj mus rau MQTT broker nrog cov ncauj lus nyob zoo/ntiaj teb. Tus tswv lag luam paub tias mqtt input node tau cuv npe rau tib lub ncauj lus thiab yog li xa mus rau qhov them nyiaj. Lub mqtt input node ces xa qhov no mus rau qhov debug tab (RHS) thiab cov ntawv 'Nyob zoo los ntawm kuv' yuav tsum tshwm sim.

Qhov no zuam lwm lub thawv raws li peb muaj Node Red tham nrog peb MQTT broker. Nco ntsoov tias Node Red tsuas yog tus neeg siv rau tus tswv lag luam - zoo li Sonoff cov cuab yeej peb yuav txuas tom qab. Txawm li cas los nws ua rau cov cuab yeej siv tau yooj yim dua qub thiab muab cov neeg siv zoo siv.

Tam sim no peb tuaj yeem ua ob peb qhov kev hloov pauv me me thiab teeb tsa cov dej ntws rau peb Sonoff hloov.

Yog li rho tawm cov tshuaj nkag mus rau qhov (nyem rau qhov tseem ceeb thiab nyem qhov tseem ceeb rho tawm). Tam sim no ntxiv qhov hloov pauv los ntawm ntu dashboard thiab txuas nws mus rau mqtt cov zis. Ob npaug nias hloov. Nyem mem xaum ntawm sab xis ntawm Pawg. Nkag mus rau Lub Npe: Teeb. Tom qab ntawv nyem tus xaum xaum mus rau sab xis ntawm Tab thiab nkag mus rau Lub Npe ntu: Lounge. Nyem Ntxiv/Hloov tshiab thiab Ntxiv/Hloov tshiab. Tam sim no, rov qab rau hauv Kho kom raug hloov pauv, teeb rau thiab tawm Payloads. Siv twidlys los xaiv txoj hlua thiab nkag rau ON rau ntawm On payload thiab OFF rau qhov OFF payload. Nyem Ua tiav

Tam sim no mus rau txhua qhov ntawm mqtt nodes thiab hloov Cov Ntsiab Lus rau cmnd/sonoff/POWER. Yog tias luam thiab muab tshuaj txhuam, kos koj tsis suav nrog qhov chaw nyob thaum kawg. Nov yog cov ncauj lus sib txawv thiab yuav tsis ua haujlwm nrog Sonoff. Nrhiav qhov chaw tsis raug tuaj yeem siv sijhawm ib teev lossis ntau dua - ntseeg kuv! Kuv kuj tau mus rau ntawm lub dashboard> Ntsiab lus thiab xaiv: Tsaus. Nyem Deploy thiab xaiv qhov debug tab.

Tam sim no qhib qhov browser tshiab sib tham hauv lub qhov rai tshiab thiab loj nws zoo li lub xov tooj ntawm tes hla Node Red session. Nkag mus rau qhov chaw nyob: koj tus IP chaw nyob: 1880/ui/#/0 piv txwv li qee yam xws li 192.168.0.8:1880/ui/#/0. Koj yuav tsum pom lub vijtsam nrog Lounge thiab Lub Teeb thiab hloov. Nyem qhov hloov rau thiab tom qab ntawd tua. Lub qhov rai debug yuav tsum qhia ON thiab OFF payloads. Tam sim no yog tias koj xav tau nkag mus ntawm lub xov tooj ib yam nkaus. Nco ntsoov tias txoj haujlwm hloov pauv tau ua tiav. Nws tsis muaj teeb meem uas peb Sonoff tseem tsis tau txuas nrog. Thaum nws yog, los ntawm kev sau npe rau Lub Xeem, nws yuav khaws cov lus/them nyiaj thiab ua rau nws.

Kauj ruam me ntsis kawg yog ua Node Red pib txiav tom qab Pi khau looj plab hlaub.

Node Red muaj phau ntawv qhia ntawm:

Txawm li cas los xij cov ntaub ntawv xav tau twb tau rub tawm lawm yog li tsis xav tau kev teeb tsa.

Txhawm rau kom Node-RED khiav tau zoo ntawm txhua lub khau raj thiab thaum sib tsoo nkag (qhib PuTTY ntu):

sudo systemctl pab kom nodered.service

Yog tias koj ib txwm xav tau xiam qhov no nkag mus:

sudo systemctl lov tes taw nodered.service

Tam sim no kaw lub pi nrog sudo kaw tam sim no thiab tshem tawm lub zog.

Qhov no tam sim no muaj peb Pi xauv thiab thauj khoom npaj rau kev nqis tes ua. Peb muaj peb lub PC/xov tooj ntawm tes txuas rau Node Red thiab qhov no tham nrog peb MQTT server. Qhov no tau ua ntev thiab tsim nyog tau txais ib qho loj ntawm sab nraub qaum. Ua tau zoo Kuv pom qhov txuas ntxiv, Arduino me ntsis, kev pom zoo yooj yim dua!

Kauj Ruam 5: Teeb tsa Arduino System rau Kev Rov Kho Dua Sonoff Devices

Txhua cov ntaub ntawv los ua qhov no yog ntawm Sonoff-Tasmota GitHub. Tsuas yog ib feem uas kuv muaj teeb meem nrog yog Cov Ntsiab Lus - tab sis kuv tau ua kom koj nkag mus rau qhov no lawm!

Mus rau

Koj yuav pom cov lus qhia teeb tsa ntawm Wiki tab hauv ntu Upload cuab yeej ntu:

Ntau dua li hla txhua kauj ruam kuv tsuas yog yuav pom qhov tseem ceeb uas kuv xav tias tseem ceeb lossis tau nyam.

Cov lus qhia yog qhov zoo tab sis yuav tsum tau ua tib zoo saib xyuas kom ntxaws. Kuv tau raug tsoo los ntawm qhov xav tau ESP8266 nplaub tshev hauv daim nplaub tshev uas nyob hauv lwm daim nplaub tshev npe ESP8266 thiab vim li no ploj mus ob qib.

Kuv ua raws cov lus pom zoo rau kev teeb tsa cais Arduino nkaus xwb. Kuv tsim daim nplaub tshev tshiab hu ua 'ArduinoSonoff' uas yog cais rau kuv phau ntawv Arduino uas twb muaj lawm. Kev teeb tsa tau zoo heev thiab yog li khaws nws cais yog lub tswv yim zoo heev. Yog tias qhov no yog koj thawj Arduino teeb tsa kom ntseeg tau tias koj teeb tsa nws zaum thib ob hauv 'Arduino' lossis lwm daim nplaub tshev rau lwm txoj haujlwm Arduino, suav nrog ua haujlwm ntawm ESP8266s.

Rub tawm qhov tseeb Arduino IDE los ntawm https://www.arduino.cc/en/Main/Software. Unzip cov ntawv rau hauv koj daim nplaub tshev tshiab.

Cov lus qhia suav nrog rub tawm Sonoff-Tasmoda system los ntawm https://github.com/arendst/Sonoff-Tasmota nplooj ntawv tseem ceeb ntawm: Clone lossis Download> Download ZIP. Unzip cov ntawv rau hauv koj daim nplaub tshev tshiab.

Ua raws li cov lus qhia ua tib zoo. Kuv tsis tau ua Qhov Kev Xaiv: Npaj rau OTA upload ntu. Peb yuav tso qhov no rau lwm hnub.

Tam sim no pib Arduino IDE (ob npaug nias arduino.exe). Thauj lub Sonoff-Tasmota kos duab los ntawm Cov Ntaub Ntawv> Sketchbook> sonoff. Tsis tas yuav hloov kho. Txhua qhov kev teeb tsa tau ua tiav los ntawm kev txuas txuas tom qab lub firmware tau rub tawm. Cov no tau khaws cia hauv EEPROM. Li no lub firmware tuaj yeem hloov kho thiab txhua qhov chaw khaws tseg. Qhov no yog cov khoom ntse heev. Txawm li cas los xij koj tuaj yeem zam qhov xav tau ob peb kauj ruam ntawm no los ntawm kev mus rau tus neeg siv-teeb tsa.h cov ntaub ntawv thiab nkag mus rau koj li wifi SSID thiab password thiab MQTT_HOST (hloov 'domus1'– thib ob siv, nrog koj tus IP chaw nyob). Tom qab ntawd koj yuav xav nkag mus rau MQTT tus neeg siv thiab tus lej nkag ib yam. Ua ntej rub tawm txheeb xyuas lub rooj teeb tsa hauv qab Cov Cuab Yeej. Cov no yuav xav tau ob peb qhov kev hloov pauv kom tau raws li qhov yuav tsum tau teev tseg hauv Wiki. Tam sim no nyem sau (cim cim). Nws yuav tsum tau sau ua ke OK. Yog tias nws tsis yog lossis yog tias lub rooj tsav xwm xav tau teeb tsa tsis muaj ces rov qab mus thiab txheeb xyuas txhua kauj ruam ntawm kev teeb tsa.

Kauj Ruam 6: Rov Kho dua Sonoff Hloov

Tam sim no peb tau npaj los rub tawm. Nyob rau theem no ib tus tuaj yeem mus ncaj ua ntej thiab nyem lub Sonoff hloov lossis ib tus tuaj yeem xub nyem ESP8266 tus qauv. Kuv tau ua qhov kawg, ib nrab vim tias kuv cov hloov pauv tseem tsis tau los txog (tsuas yog tuaj txog thaum kuv ntaus qhov no!) Kuv paub. Kuv muaj ob peb ntawm NodeMCU cov laug cam. Cov no yog qhov txuas tau yooj yim, muaj lawv lub on-board USB rau hloov pauv. Txawm li cas los xij nodemcu pib txoj hauv kev tsis ua haujlwm nrog cov kab ke no. Yog li tawm ntawm Cov Cuab Yeej> Rov Pib Txoj Haujlwm teeb tsa rau "ck". Ua qhov kev teeb tsa phau ntawv ib txwm siv los tuav lub khawm nyem (GPIO 0 rau hauv av) thaum nias thiab tso tawm Pib dua (Pib dua rau hauv av). Kuv tsis paub tseeb tias qhov no muaj sijhawm tas los lossis tej zaum kuv tsis tuav GPIO 0 qis rau qhov ntev txaus tab sis kuv xav tau ntau qhov kev sim, suav nrog ua qhov no thaum Arduino IDE tau suav sau!

Yog tias koj xav tshuaj xyuas cov lus teb - cov khoom xa tawm yog D6 ntawm NodeMCU cov laug cam. Ntawm ESP12 qhov no yog GPIO 12. Cov zis LED yog D7 (NodeMCU) lossis GPIO 13 (ESP12's).

Sonoff hloov.

CEEB TOOM: Kuv yuav tsum hais tias "tsis txhob txuas rau lub ntsiab lus hauv txhua qhov xwm txheej uas lub qhov rooj qhib". Nco ntsoov tias PCB (tsawg kawg ntawm Sonoff Basic (hloov pauv hauv kab) tsuas muaj 'ib leeg nyob ib leeg' nrug deb ntawm ntu qis hluav taws xob thiab lub zog. Tasmota GitHub qhia pom kev sib txuas ntawm qhov ntsuas kub thiab av noo mus rau Sonoff S20. Kuv yuav tsis ua qhov no vim yog kev txhawj xeeb ntawm kev cais tawm. los yog lub zog hauv av.

Sonoff S20 plug-in hloov yog qhov pib zoo vim nws tsis xav tau ib qho txuas hluav taws xob. Qhov no tuaj yeem qhib tau los ntawm kev tshem tawm ib lub hau ntswj (hauv qab kev ruaj ntseg foob) thiab txiav txim siab rooj plaub qhib. Daim duab hauv qab no qhia qhov twg cov ntawv cim npe nyob. Nyem rooj plaub ntawm cov ntsiab lus no pab.

USB serial converter

Qhov kuv nyiam tshaj yog FTDI version. Txawm li cas los xij qhov no tsis muaj peev xwm txaus los muab Sonoff 3.3v xav tau. FTDI qhov tshwj xeeb hais tias siab tshaj 50ma. Qhov kev xaiv zoo tshaj tom ntej yog ib qho siv CP2102 nti. Qhov no txawm li cas los xij muaj 100ma txwv uas tseem tsis txaus. Kom meej meej ntau tus siv qhov kev hloov pauv no ncaj qha tab sis kuj tseem muaj cov ntawv ceeb toom ntawm kev thauj khoom tsis tiav. Kuv yuav txwv lub sijhawm nws txuas nrog vim nws yuav sov li hauv qab lub nra. Ua qhov no ntawm koj tus kheej txoj kev pheej hmoo. Qhov kev daws teeb meem zoo tshaj plaws yog kom muaj 3.3v tus tswj hwm ib yam nkaus, xws li AMS1117 3.3. Kuv tau tsim PCB me me los pab ua qhov no. Saib Programmer rau Sonoff cov cuab yeej.

Kuv ntu rau kev ua haujlwm yog raws li hauv qab no:

Qhib Arduino IDE.

Hauv Cov Cuab Yeej tshawb xyuas cov teeb tsa zoo li ntawm Wiki.

Ua ib qho kev hloov kho xav tau rau user_config.h. Kuv teeb Wifi SSID thiab tus password thiab MQTT tus tswv chaw nyob thiab lub sijhawm khaws tseg/nruab hnub qhia meej.

Nyem 'txheeb xyuas' txhawm rau txheeb xyuas nws ua ke OK.

Txuas lub USB serial converter (ntawm nws tus kheej) rau lub PC. Nco ntsoov Tus Naj Npawb Port.

Tam sim no txuas lub USB txuas txuas ntawm lub PC thiab txuas nws mus rau Sonoff hloov. Txheeb xyuas hauv av thiab 3v3 kev sib txuas yog txoj hauv kev ib puag ncig (hauv av txuas nrog lub dav hlau hauv av ntawm Sonoff PCB).

Tuav tus programmer kom cov neeg muaj kev nyab xeeb thaum tseem nyem lub pob.

Tam sim no ntsaws USB coj mus rau hauv PC, txheeb xyuas tus lej chaw nres nkoj yog qhov raug (hauv Cov Cuab Yeej), tom qab ntawd nyem download.

Kuv txuas ntxiv tuav lub pob thoob plaws hauv txoj haujlwm vim tias kuv tsis xav cuam tshuam kev sib txuas.

Thaum ua tiav koj yuav tsum pom ib qho screen raws li hauv qab no:

Duab
Duab

Sonoff xav tau ob peb yam ntawm cov ntaub ntawv txhawm rau txuas rau peb cov kab ke: hauv zos network wifi SSID thiab password, thiab Pi IP chaw nyob. Muaj ntau txoj hauv kev los ua qhov no, ib qho yog hloov kho cov ntaub ntawv config.ino raws li tau hais ua ntej. Yog tias koj muaj lub xov tooj smartphone koj tuaj yeem (tom qab rov hloov dua tshiab) nias lub pob Sonoff 4 zaug ncaj ncees kom muab tso rau hauv hom web-server. LED yuav nyem. Kuv yuav tsum tau sim ob peb zaug kom qhov no ua haujlwm. Tom qab ntawd, ntawm koj lub xov tooj smartphone saib rau Sonoff network tshiab thiab txuas. Ib lub vev xaib yuav tshwm nyob qhov twg koj tuaj yeem teev cov ntaub ntawv xav tau. Pi IP chaw nyob mus rau hauv lub npe hostname. Kuv kuj tau hloov SSID thib ob thiab tus password rau qee yam ntev thiab siv tsis tau.

Xwb, nws tuaj yeem teeb tsa los ntawm kev txuas txuas tom qab thauj khoom. Qhib Arduino Serial Monitor (hauv Cov Cuab Yeej).

Cov lus txib kom nkag mus:

SSId yourWiFiSSID

Lo lus zais koj tus Wi -FiPassword

MqttHost 192.168.x.y (PI IP chaw nyob)

Koj kuj tseem tuaj yeem nkag mus rau SSId1 thiab Password1 ua raws qee yam ntev thiab siv tsis tau los ua qhov tsis zoo.

Tam sim no koj tuaj yeem ntim lub Sonoff hloov, qhib Node-Red thiab Node-red dashboard thiab nyem lub pob hloov thiab saib ntawm qhov debug tab uas yuav tsum tam sim no suav nrog cov lus teb los ntawm Sonoff. Yog li peb muaj lwm cov kauj ruam tseem ceeb ua tiav - peb thawj qhov hloov pauv tau tsav los ntawm PC/smartphone.

Txog tam sim no peb tsis tau hais txog kev nyab xeeb. Muaj peev xwm siv kev sib txuas lus encrypted. Qhov no yog qhov nyuaj heev los teeb tsa thiab tej zaum yuav tsim nyog dua qhov twg siv huab raws tus broker tau siv. Kuj tseem muaj qhov kev xaiv ntxiv cov npe siv thiab tus lej nkag rau txhua lub khoom siv sib txuas thiab tsis pub cov neeg siv tsis qhia npe. Qhov no yog qhov yooj yim zoo nkauj los teeb tsa. Thiab tam sim no mus rau Kev Ruaj Ntseg.

Kauj Ruam 7: Ruaj Ntseg

MQTT tso cai siv cov npe thiab tus lej nkag rau txhua tus neeg siv khoom. Qhov no yooj yim rau teeb. Tej zaum nws yooj yim dua rau npe ua ntej txhua lub cuab yeej thiab tom qab ntawd teeb lawv cov npe siv thiab tus lej nkag. Qhov no tuaj yeem ua tiav ntawm MQTT cov lus txib, thiab Node-Red yog tej zaum txoj hauv kev yooj yim tshaj plaws los xa cov no. Ua ntej txiav txim siab txog lub npe kev pom zoo. Ib qho kev xaiv yog los sau cov npe ntawm qhov chaw thiab ua haujlwm. Tom qab ntawd koj yuav xav sau lub npe (Cov ncauj lus) lub npe siv thiab tus lej zais nrog rau cov ncauj lus rov qab. Nco tseg kuj tseem muaj 'kev xaiv rov pib dua' txhawm rau teeb tsa Sonoff teeb tsa mus rau qhov rub tawm thawj zaug (saib Wiki Siv> Button Functionality).

Fais fab pi thiab tom qab ob peb feeb qhib qhov browser rau Node-Red (IP chaw nyob: 1880).

Hauv Node-Red teeb tsa kev txhaj tshuaj thiab txuas qhov no mus rau mqtt cov zis thiab teeb tsa mqtt server rau localhost. Tawm cov ncauj lus, tus neeg siv thiab tus lej zais tsis muaj dab tsi li peb yuav teeb tsa cov no hauv qhov chaw txhaj tshuaj. Kuj teeb tsa mqtt cov tswv yim nkag thiab txuas qhov no rau qhov debug ntawm qhov kom peb tuaj yeem pom cov lus teb. Teeb mqtt cov ntawv sau tseg rau hauv localhost (yuav tsum tau teeb tsa) thiab nkag mus+/+/+rau lub ncauj lus kom nws ntes tau txhua lub tsheb.

Nkag mus rau kab ntawv hauv qab no ntawm kev teeb tsa hauv qhov chaw txhaj tshuaj.

Thawj qhov txuas txuas nrog

Ntsiab lus: cmnd/sonoff/Status

Lus: 6

nyem qhov 'Txhaj tshuaj ib zaug thaum pib'. Tso. Peb yuav tsum pom debug suav nrog 7 kab ntawm cov ntaub ntawv los ntawm stat/sonoff/STATUS6

Nkag mus rau Xam Xaj: cmnd/sonoff/Cov ncauj lus thiab Xov Xwm: loungelight. Tso. Qhov no hloov pauv lub npe los ntawm sonoff rau loungelight

Lub debug tab yuav tsum qhia lub cuab yeej rov pib dua nrog nws lub npe/ntsiab lus tshiab

Ntsiab lus: cmnd/loungelight/MqttUser

Lus: loungelight

Nyem deploy. Kev debug yuav tsum pom los ntawm stat/loungelight/RESULT nrog {"MtqqUser": "loungelight"}

Ntsiab lus: cmnd/loungelight/MqttPassword

Lus: loungelightPW (nco ntsoov xav ntau dua qhov no!)

Tshem qhov debug tab thiab Deploy.

Kev teb yuav tsum pom los ntawm stat/loungelight/RESULT nrog {"MqttPassword": "loungelightPW"}

Tam sim no nkag mus NodeRed thiab NodeRedPW ua lub npe siv thiab tus lej nkag mus hauv mqtt tawm ntawm qhov. Qhov no yog hla tus neeg rau zaub mov mem hluav cim thiab kev nyab xeeb tab hauv lub qhov rai uas qhib. Qhov no tau txais theej tawm mus rau lwm qhov MQTT nodes.

Txheeb xyuas dua nrog

Ntsiab lus: cmnd/loungelight/Status and Message: 6. Tso.

Thiab hais tias cov lus teb raug xa.

Yog li ntawm qhov no peb tau hloov pauv peb Sonof ntaus ntawv yog li nws yuav mloog cmnd/loungelight/…… ntsiab lus thiab yuav nkag mus rau MQTT sever nrog lub npe siv lub hnub qub thiab lo lus zais loungelightPW. Peb kuj tau teeb lub npe siv thiab tus lej nkag rau Node-Red.

Tom ntej no peb yuav tsum qhia yoov MQTT server kom tsuas lees txais cov neeg siv nrog lub npe siv thiab sau cov npe siv thiab tus lej nkag mus kom raug lees txais.

Cov txheej txheem yog:

  • Tsis txhob yoov tshaj cum
  • Tsim tus kheej cov ntaub ntawv
  • Kho cov ntaub ntawv teeb tsa
  • Tsim cov ntaub ntawv tus password
  • Ntxiv cov neeg siv/password.

Yog li nkag mus nrog ntu PuTTY tshiab thiab ua raws cov lus txib hauv qab no:

sudo /etc/init.d/mosquitto nres

cd /etc/mosquitto/conf.d/

sudo nano mosquitto.conf Qhov no pib tus editor.

Ntxiv kab:

allow_anonymous cuav

password_file /etc/mosquitto/conf.d/passwd

require_certificate tsis tseeb

Txuag thiab tawm (Ctrl+X), Y, nkag mus.

sudo kov passwd Qhov no tsim cov ntaub ntawv tus password thiab cov lus qhia hauv qab no ntxiv cov npe thiab tus lej zais.

sudo mosquitto_passwd -b /etc/mosquitto/conf.d/passwd loungelight loungelightPW

sudo mosquitto_passwd -b /etc/mosquitto/conf.d/passwd NodeRed NodeRedPW

sudo /etc/init.d/mosquitto rov pib dua

Nco tseg thaum ntxiv cov cuab yeej tshiab koj yuav tsum nkag mus rau tus neeg siv thiab tus lej nkag mus ntawm qhov chaw nres nkoj txuas thiab ntxiv cov no rau cov ntaub ntawv tus lej lossis hloov ib ntus hloov cov ntaub ntawv mositto teeb tsa thiab tawm tswv yim (ntxiv # thaum pib ntawm kab) kab "allow_anonymous cuav "thiab" password_file /etc/mosquitto/conf.d/passwd "thiab tom qab ntawd rov pib dua cov no thaum cov ntsiab lus tau raug xa mus rau lub cuab yeej thiab ntxiv rau cov ntaub ntawv tus password li saum toj no.

Peb tau hloov lub npe sonoff rau lub teeb ci thiab yog li hloov kho mqtt qhov tso tawm (txuas nrog lub hloov) kom siv lub ntsiab lus cmnd/loungelight/POWER.

Nyem Deploy thiab tshawb xyuas cov mqtt nodes qhia 'txuas'.

Tom ntej no sim khawm hloov thiab saib rau qhov kev debug uas qhia Sonoff hloov teb. Koj yuav pom tias lub cuab yeej qhia qhov kev hloov pauv nrog lub ncauj lus: stat/loungelight/POWER. Yog li tam sim no hloov cov tswv yim uas tau teeb tsa rau cmnd/sonoff/POWER rau stat/loungelight/POWER. Peb tuaj yeem siv qhov npog qhov sib txawv ntawm peb txoj haujlwm. Lub kaw lus raws li tau teeb tsa thaum pib yuav ua synchronized nrog txhua tus nkag rau hauv cov neeg siv tab sis yuav tsis ua haujlwm nrog kev hloov pauv hloov los ntawm nias lub pob ntawm Sonoff hloov. Yog li tam sim no txuas cov txiaj ntsig ntawm stat/loungelight/POWER mqtt input node rau qhov hloov pauv (LHS). Tam sim no ob npaug nias qhov hloov pauv thiab xaiv qhov "yog tias msg tuaj txog ntawm kev nkag, hla dhau mus rau qhov tso tawm". Qhov no coj qee qhov kev xaiv tshiab - xaiv 'hloov lub cim qhia pom lub xeev ntawm kev nkag mus'. Tso. Yog li tam sim no peb muaj cov lus tawm tswv yim zoo. Lub dashboard hloov txoj haujlwm yuav ib txwm hloov thaum Sonoff hloov pauv, tsis hais qhov kev hloov pauv tau pib qhov twg.

Yog li tam sim no peb muaj kev nyab xeeb, ib leeg nyob ib leeg hauv tsev tshuab ua haujlwm tau zoo thiab npaj rau kev nthuav dav rau txhua yam uas koj xav kom nws ua. Hauv ntu txuas ntxiv kuv yuav npog qee qhov ntawm kuv qhov kev sim kom deb li deb thiab cov teeb meem kuv npaj yuav daws.

Kauj Ruam 8: Thawj kauj ruam rau kev nthuav dav

Kuv muaj lwm Qhov Kev Qhia Hauv Tsev Automation Sonoff-Tasmota Sensors LEDs Development Board uas qhia qee qhov peev xwm ntxiv ntawm Sonoff-Tasmota firmware:

Kev ntsuas kub thiab av noo

Kev tshawb nrhiav intruder (hloov cov tswv yim)

IR chaw taws teeb (rau TV thiab lwm yam)

Cov hlua LED - ob qho tib si RGB thiab NeoPixel (tus kheej tuaj yeem hais tau)

I2C cov sensors

Rau qhov saum toj no kuv tab tom siv ESP12F thiab kev cai PCB. NodeMCU thiab daim ntawv qhia zaub mov tuaj yeem siv sib npaug. Qhov no ua rau cov haujlwm ntxiv no tsis muaj kab rau hauv Sonoff ntaus ntawv, thiab yog li yog txoj hauv kev muaj kev nyab xeeb dua. Nrog rau qhov ntsuas kub kuv tuaj yeem ua tiav kuv daim pam hluav taws xob automation.

Suab paj nruag thiab Internet Xov tooj cua tau yooj yim ntxiv. Qhov no qhib kev xaiv kom muaj cov chaw tshwj xeeb lossis albums tuaj raws lub sijhawm lossis tej zaum yuav teb rau tus qhua (xov tooj) raug kuaj pom. Cov kev qhia no cuam tshuam yog nyob ntawm Cov Suab Nkauj Zoo Tshaj Plaws thiab Xov Tooj Cua Internet nrog Kev Tswj Xyuas Smartphone. Txij li qhov no tseem tau tsav los ntawm Node-RED nws yuav tsum muaj peev xwm ua kom muaj ntau dua ib lub suab thiab siv MQTT kev sib txuas lus los tsav lawv.

Kuv kuj tseem tau tshawb txog Node-Red, suav nrog xa email thiab ua suab ceeb toom. Kuj tseem muaj peev xwm rau cov kab ke txhawm rau txheeb xyuas thaum koj nyob hauv/tawm - los ntawm pinging koj lub xov tooj ntawm tes IP chaw nyob. Node -Red kuj tseem tuaj yeem nkag mus rau huab cua thiab xov xwm - yog li ib tus tuaj yeem ntxiv cov ntaub ntawv ntxiv nrog rau kev ua haujlwm tsis siv neeg.

Muaj qee qhov kev qhia kom paub - tab sis cov no dhau los ua tuag yooj yim zaum thib ob.

Lwm txoj hauv kev yog ntxiv cov zaub rau pi kom pom lub dashboard. Nov yog 'ua haujlwm tab tom ua' - lossis ua lwm yam kuv tsis zoo siab heev. Cov zaub kuv tau txais yog nyuaj rau tig mus rau hauv hom duab thiab Chromium browser tau mob qeeb. Lwm txoj hauv kev yuav yog khaws cov ntsiav tshuaj qub ntawm ebay thiab siv qhov ntawd. Kuv tuaj yeem sim nrog Pi 2 thiab pom tias qhov ntawd muab kev txhim kho txaus (qauv B siv rau txoj kev txhim kho no).

Kuv vam tias qhov no tau pib koj thiab muaj koj lub tswv yim nrov nrov. Cov peev txheej muaj peev xwm loj heev. Ib tus tuaj yeem hloov kho Sonoff code rau lwm qhov ntsuas yog xav tau.

Zuag qhia tag nrho kuv tau xav tsis thoob ntawm qhov system no tuaj yeem ua dab tsi. Kuv lub hom phiaj tseem ceeb yog tsuas yog tsav tsheb hloov pauv ntawm lub xov tooj smartphone kom ntseeg tau zoo los ntawm ib leeg kheej kheej. Kuv tau muaj lub zeem muag xav tau los tswj cov servers thiab cov neeg siv khoom thiab sau html rau tus neeg siv interface. Qhov twg qhov no xaus yog txoj hauv kev ua ntej ntawm qhov no, nrog kev nyab xeeb ntau dua, kev ntseeg tau zoo, kev siv tus neeg siv zoo heev, luag thiab poob qhov program thiab muaj peev xwm loj rau kev nthuav dav. Thiab tag nrho cov no nrog kev siv zog tsawg dua.

Mike

Kauj Ruam 9: Ntxiv - Loading Los ntawm Raspbian Stretch Lite

Qhov kev xaiv no zam rau bloatware uas los nrog Raspbian Stretch version tag nrho. Feem ntau ntawm qhov no yuav tsis xav tau thaum siv Pi rau kev siv tshuab hauv tsev. Txawm li cas los Node-Red yuav tsum tau teeb tsa.

Ua raws li hauv Kauj Ruam 1 tab sis siv Raspbian Stretch Lite ntau dua li Raspbian Stretch.

Hloov chaw Kauj Ruam 2 ua cov hauv qab no:

sudo apt -y nruab npm

npm -v yuav tsum rov qab: 1.4.21 lossis tom qab

sudo npm nruab -g n

sudo n tau 8.9.0

Tam sim no peb tuaj yeem siv cov node pob tus thawj coj los teeb tsa Node-Red:

sudo npm nruab node-liab-ntiaj teb-tsis muaj kev nyab xeeb-perm

Qhov no yuav muab ob peb ntawm cov lus yuam kev vim qhov chaw nyob tsis raug. Txawm li cas los xij lub kaw lus ua 'qhov chaw sib sau ua ke' los kho qhov teeb meem no. Yog tias koj rov ua cov lus qhia saum toj no (tsis tsim nyog) qhov yuam kev tsis tshwm sim.

Tam sim no peb muaj Node-Red thiab nws cov pob txhawb nqa tau teeb tsa thiab tuaj yeem txav mus rau Kauj Ruam 3, thauj cov mos txwv.

Kev sib tw Wireless
Kev sib tw Wireless
Kev sib tw Wireless
Kev sib tw Wireless

Khiav Tawm Hauv Kev Sib Tw Wireless

Pom zoo: