Cov txheej txheem:

Tsim Apple Kua HomeKit Kub Sensor Device Siv ESP8266 thiab BME280: 10 Cov Kauj Ruam
Tsim Apple Kua HomeKit Kub Sensor Device Siv ESP8266 thiab BME280: 10 Cov Kauj Ruam

Video: Tsim Apple Kua HomeKit Kub Sensor Device Siv ESP8266 thiab BME280: 10 Cov Kauj Ruam

Video: Tsim Apple Kua HomeKit Kub Sensor Device Siv ESP8266 thiab BME280: 10 Cov Kauj Ruam
Video: Обзор умной цветной лампы TP Link и умной розетки | КЛ130 и HS103 2024, Kaum ib hlis
Anonim
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280
Tsim Apple Kua HomeKit Kub Sensor Ntaus Ntawv Siv ESP8266 thiab BME280

Hauv cov lus qhia niaj hnub no, peb yuav ua tus nqi qis, ntsuas kub thiab av noo raws li AOSONG AM2302/DHT22 lossis BME280 ntsuas kub/av noo, YL-69 noo noo thiab ESP8266/Nodemcu platform. Thiab rau kev nthuav tawm cov ntaub ntawv, peb yuav siv homebridge los koom ua ke nrog Apple's HomeKit.

Qhov no txhawb nqa ntau yam khoom siv thiab kev tshawb pom lub cuab yeej siv mDNS, nrog rau kev teeb tsa me me uas xav tau hauv Homebridge.

Daim Ntawv Teev Npe

  • NodeMCU / Tshiab Wireless module NodeMcu Lua WIFI Internet ntawm Yam kev txhim kho pawg thawj coj saib raws ESP8266 nrog pcb Antenna thiab chaw nres nkoj usb

    Cov no pheej yig heev ntawm Ali Express, tsuas yog teeb meem yog kev xa khoom yuav siv sijhawm 4-6 lub lis piam

  • Txawb Xov Tooj Charger
  • Mini USB Cable
  • AOSONG AM2302/DHT22 ntsuas kub/av noo

Los yog ua lwm txoj kev ntsuas

Bosch BME280 Kub, Vaum thiab Barometric Sensor

  • YL-69 Hws noo Sensor
  • 2N3904 Transistor
  • 1K tus neeg tiv thaiv

    Transistor thiab Resistor tsuas yog xav tau ntawm YL-69 Moisture Sensor

  • 5 Pin Poj Niam rau Poj Niam cable teeb (1.5 ') (DHT)
  • 4 Pin Poj Niam rau Poj Niam cable teeb (1.5 ') (BME 280)
  • Thaum tshav kub kub ntsws tubing me me
  • Thawv rau nruab NodeMCU

    • Kuv siv lub khob yas me me los ntawm dollarama
    • 5 lub txiv ntoo me me thiab ntsia liaj qhov rooj rau mount NodeMCU

Cov cuab yeej

  • Soldering Hlau
  • Solder
  • Hlau Cutters

Kauj Ruam 1: Tsim Kho Vajtse - DHT22

Tsim Kho Vajtse - DHT22
Tsim Kho Vajtse - DHT22
Tsim Kho Vajtse - DHT22
Tsim Kho Vajtse - DHT22

Txuas DHT22

1. Txiav 5 Tus Pin Poj Niam rau Poj Niam cable hauv ib nrab, tsim ib txoj hlua ntev txog 9 ntiv tes.

2. Ntawm tus txuas, tus pin 2 thiab 3 tsis siv thiab tuaj yeem tshem tawm tau.

3. Tsam li 1/4 ntawm txhua lub xaim ntawm qhov kawg ntawm qhov ntxeev ntawm qhov txuas.

4. Nrog koj cov hlau soldering, tin txhua lub xaim kawg thiab lub dav hlau ntawm DHT22.

5. Txiav li 3/4 ntawm cov cua sov ntsws tubing thiab thawb cov xov hlau.

6. Muab cov xov hlau txuas rau DHT22 raws li hauv qab no

Tus Txuas Txuas DHT22 Tus Pin

1 - 2 (Thib ob ntawm sab laug)

4 - 1 (Thawj ntawm sab laug)

5 - 4 (Thawj ntawm sab xis)

7. Xaub qhov cua sov ntsws tubing hla DHT22 Pins thiab txo cov tubing nrog cov hlau txuas.

Kauj Ruam 2: Tsim Kho Vajtse - BME280

Tsim Kho Vajtse - BME280
Tsim Kho Vajtse - BME280
Tsim Kho Vajtse - BME280
Tsim Kho Vajtse - BME280
Tsim Kho Vajtse - BME280
Tsim Kho Vajtse - BME280

Txuas BME280

1. Txiav tus 4 Pin Poj Niam rau Poj Niam cable hauv ib nrab, tsim ib txoj hlua ntev li 9 ntiv tes.

2. Tsam li 1/4 ntawm txhua lub xaim ntawm qhov kawg ntawm qhov sib thooj ntawm qhov txuas.

3. Nrog koj cov hlau soldering, tin txhua lub xaim kawg.

4. Muab cov xov hlau txuas rau BME280 hauv qhov kev txiav txim no, VCC, GND, SCL, SDA. Cov no yuav tsum tau kab mus rau tus pin hauv qhov txuas.

Kauj Ruam 3: Tsim Kho Vajtse - YL -69

Tsim Kho Vajtse - YL -69
Tsim Kho Vajtse - YL -69

Kauj ruam 4: Tsim Case

Tsim Case
Tsim Case
Tsim Case
Tsim Case
Tsim Case
Tsim Case

Kauj Ruam 5: Tsim NodeMCU Firmware

1. Siv https://nodemcu-build.com, tsim cov kev cai firmware uas muaj tsawg kawg cov qauv no:

adc, ads1115, ntsis, bme280, dht, file, gpio, i2c, mdns, net, node, tmr, uart, websocket, wifi

2. Thov siv esptool txhawm rau txhim kho lub ntab firmware mus rau koj lub nodemcu. Muaj ntau cov lus qhia rau qhov no, yog li kuv yuav tsis rov hais dua ntawm no.

Kauj Ruam 6: Txuas Sensors

Txuas Sensors
Txuas Sensors
Txuas Sensors
Txuas Sensors

TSH 22

1. Tso txoj kab txuas txuas kom tus pin 1 txuas rau D2 ntawm nodemcu, tus pin 4 nrog 3v3 thiab tus pin 5 nrog gnu.

NPE 280

1. Txuas BME280 mus rau nodeMCO, txheej kab ntawv raws li hauv qab no:

3V3 -> VCC

GND -> GND

D5 -> SCL

D6 -> SDA

Kauj Ruam 7: Nruab Nodemcu Software

1. Rub tawm lua software pob los ntawm NodeMCU Lua Code

2. Ua raws li cov lus qhia teeb tsa hauv README nyob ntawm no

github.com/NorthernMan54/homebridge-mcuiot/tree/master/lua

Kauj Ruam 8: Xeem

Kev Xeem
Kev Xeem

1. Koj tuaj yeem sim los ntawm kab hais kom ua nrog curl lossis wget, nco ntsoov tias koj siv tus IP chaw nyob los ntawm Esplorer screen thiab tsis yog kuv li;-)

curl 192.168.1.165 {"Hostname": "NODE-8689D", "Model": "BME", "Version": "1.2", "Data": {"Kub": 22.15, "Humidity": 50.453, "Hws noo ": 8," Status ": 0," Barometer ": 1003.185," Dew ": 11.38}}

2. Hauv Esplorer koj yuav tsum pom cov hauv qab no

Tau txais/HTTP/1.1Host: 192.168.1.165 Tus neeg siv-Tus sawv cev: curl/7.43.0 Txais: */ *

Xwm txheej: 0

Temp: 22.15 Humi: 50.453 Huv: 8 Baro: 1003.185 Dew: 11.38

3. Siv Esplorer nruab init.lua. Ib feem ntawm nodemcu ntawm kev tsim tam sim no tiav.

4. Txhawm rau ntsuas mDNS, Kuv siv cov lus txib no ntawm OS X

dns -sd -B _dht22._tcp

Thiab rau 2 lub cuab yeej ntawm lub network, kuv tau txais cov txiaj ntsig hauv qab no:

Nrhiav rau _dht22._tcp

HNUB: --- Mon 19 Sep 2016 --- 21: 11: 26.737… STARTING… Timestamp A/R Flags if Domain Service Type Instance Name 21: 11: 26.739 Add 3 4 local. _dht22._tcp. NODE-18A6B3 21: 11: 26.739 Ntxiv 2 4 hauv zos. _dht22._tcp. NODE-871ED8

Kauj Ruam 9: Homebridge-mcuiot Install

1. Nruab homebridge siv:

npm nruab -g homebridge

Kuv yuav tsis nkag mus rau ntau cov ntsiab lus ib puag ncig thaum pib teeb tsa ntawm homebridge thiab yuav teeb tsa nws li cas rau autostart thiab lwm yam. Lawv muaj ntau lwm cov lus qhia rau qhov no.

2. Nruab homebridge-mcuiot siv:

npm nruab -g homebridge -mcuiot

3. Hloov kho koj cov ntaub ntawv teeb tsa, saib qauv-config.json hauv phau ntawv teev npe no.

yog ie

"choj": {"npe": "Bart", "username": "CC: 22: 3D: E3: CD: 39", "chaw nres nkoj": 51826, "pin": "031-45-154"},

"kev piav qhia": "HomeBridge",

"platforms": [Cov.

}

4. Pib homebridge, cov zis yuav tsum zoo li no

[2016-20-10, 10:15:20 PM] Loaded plugin: homebridge-mcuiot [2016-20-10, 10:15:20 PM] Sau npe platform 'homebridge-mcuiot.mcuiot'

[2016-20-10, 10:15:20 PM] ---

[2016-20-10, 10:15:20 PM] Loaded config.json nrog 0 cov khoom siv thiab 0 lub platform.

[2016-20-10, 10:15:20 PM] ---

[2016-20-10, 10:15:20 PM] Thauj 0 platform…

[2016-20-10, 10:15:20 PM] Thauj 0 cov khoom siv ntxiv…

Load homebridge-mcuiot.mcuiot

Luam theej duab cov cai no nrog koj HomeKit App ntawm koj lub cuab yeej iOS los ua ke nrog Homebridge:

┌────────────┐

│ 031-45-154 │

└────────────┘

[2016-20-10, 10:15:20 PM] [homebridge-mcuiot.mcuiot] Pib mDNS mloog

[2016-20-10, 10:15:20 PM] Homebridge tab tom khiav ntawm chaw nres nkoj 51826.

[2016-20-10, 10:15:20 PM] [homebridge-mcuiot.mcuiot] Pom url

[2016-20-10, 10:15:20 PM] [homebridge-mcuiot.mcuiot] Pom url

[2016-20-10, 10:15:20 PM] [homebridge-mcuiot.mcuiot] Pom url

[2016-20-10, 10:15:21 PM] [homebridge-mcuiot.mcuiot] ntxivMcuAccessory 195 NODE-8689D BME

[2016-20-10, 10:15:21 PM] [homebridge-mcuiot.mcuiot] ntxivMcuAccessory 195 NODE-871ED8 DHT

[2016-20-10, 10:15:21 PM] [homebridge-mcuiot.mcuiot] ntxivMcuAccessory 195 NODE-869815 DHT

Hauv kuv ib puag ncig kuv muaj 3 lub cuab yeej ua haujlwm.

Kauj ruam 10: Homebridge

Homebridge
Homebridge

Ntawm koj lub iPhone/iPad pib qhov koj nyiam homekit cov neeg siv khoom thiab ua khub koj cov neeg siv khoom rau hauv tsev. Koj yuav tsum pom tag nrho cov cuab yeej mcuiot.

Ntxiv cov khoom siv

Cov cuab yeej tau pib pom siv mDNS, thiab yuav ntxiv cov cuab yeej tshiab thaum lawv tshwm ntawm mDNS. Hauv qhov xwm txheej uas tsis pom cov cuab yeej, rov pib dua homebridge yuav ua kom muaj kev sib haum xeeb ntawm lub plugin thiab mDNS, thiab ntxiv cov khoom siv uas ploj lawm. Cov khoom siv uas ploj lawm tsis raug tshem tawm thaum pib, saib hauv qab no seb yuav tshem tawm cov cuab yeej uas tsis muaj nyob.

Tshem tawm cov cuab yeej

Cov cuab yeej raug tshem tawm siv qhov 'Identify Accessory' ua haujlwm. Thaum koj siv lub luag haujlwm los ntawm koj lub app, nws kuaj xyuas seb lub cuab yeej tsis teb tiag tiag lossis tshem tawm lub cuab yeej.

Pom zoo: