Cov txheej txheem:

Ntse Fais Sawb Raws Li Beaglebone Dub thiab OpenHAB: 7 Cov Kauj Ruam (nrog Duab)
Ntse Fais Sawb Raws Li Beaglebone Dub thiab OpenHAB: 7 Cov Kauj Ruam (nrog Duab)

Video: Ntse Fais Sawb Raws Li Beaglebone Dub thiab OpenHAB: 7 Cov Kauj Ruam (nrog Duab)

Video: Ntse Fais Sawb Raws Li Beaglebone Dub thiab OpenHAB: 7 Cov Kauj Ruam (nrog Duab)
Video: Wb zaj dab neeg sib hlub tsis tau (Full version) - ZAJ DUB nkauj tawm tshiab 2024, Hlis ntuj nqeg
Anonim
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB
Ntse Hwj Huam Sawb Raws Li Beaglebone Dub thiab OpenHAB

!!!!! Ua si nrog lub ntsiab (110/220V) yog qhov txaus ntshai, thov ua tib zoo saib xyuas !!!

Muaj qee qhov qauv siv hluav taws xob ntse uas twb muaj lawm raws li "Raspberry Pi" thiab ob Arduinos, uas tau qhia hauv daim duab "Tsim qauv qub".

Qhov kev tsim qauv tshiab no txawv ntawm qhov qub hauv ob txoj hauv kev:

  1. Txij li Raspberry Pi tuaj yeem tswj tau nRF24 los ntawm kev siv nws tus kheej SPI, nws tsis muaj txiaj ntsig los tso Arduino nyob nruab nrab. Tsis tas li kuv nyiam Beaglebone Black board vim nws pheej yig thiab muaj zog, thiab tshwj xeeb tshaj yog nws muaj cov khoom siv ntxiv (xws li GPIO, SPI) dua li Raspberry Pi.
  2. Hauv cov qauv qub, tib txoj hauv kev los tswj cov kab hluav taws xob yog los ntawm lub vev xaib sib piv (piv txwv li OpenHAB). Txawm li cas los xij, nws tsis yooj yim heev los ua li ntawd yog tias lub hwj huam hluav taws xob nyob ntawm tes. Yog li ntawd hauv qhov kev tsim qauv no, cov hlua hluav taws xob tau hloov tus kheej rau txhua lub qhov hluav taws xob, thiab tib neeg tuaj yeem qhib/OFF txhua lub qhov hluav taws xob nrog lossis tsis muaj OpenHAB (yog tias nrog OpenHAB, cov xwm txheej ntawm OpenHAB yuav tau hloov kho tshiab thaum twg lub cev hloov pauv mus).

Kauj ruam 1: Demo

Image
Image

Kauj ruam 2: Txheej txheem cej luam

Rooj vag - Kho vajtse
Rooj vag - Kho vajtse

Kuv lub zog fais fab ntse yog tsim los ntawm ob ntu: lub qhov rooj thiab lub zog txuas (pom hauv daim duab "Kuv tsim").

Lub rooj vag suav nrog:

  1. Beaglebone Dub board
  2. NRF24L01+ module
  3. OpenHAB + MQTT (tsheb npav xa ntawv)

Lub zog hluav taws xob sab muaj:

  1. Peb tus qauv hloov+qhov hluav taws xob sib txuas (w/ a 3-gang box)
  2. Arduino pro mini board
  3. NRF24L01+ module
  4. Peb relay modules

Cov ncauj lus yuav raug suav nrog hauv cov theem hauv qab no.

Kauj ruam 3: Rooj vag - Kho vajtse

Rooj vag - Kho vajtse
Rooj vag - Kho vajtse
Rooj vag - Kho vajtse
Rooj vag - Kho vajtse
Rooj vag - Kho vajtse
Rooj vag - Kho vajtse

Cov ntaub ntawv:

Beaglebone Dub board

NRF24L01+ module

10uF capacitor (RadioShack, ebay thiab lwm yam), txhawm rau txhim kho kev ntseeg tau txais tos.

Ntawm no kuv qhia qhov sib txuas ntawm Beaglebone Dub thiab lub xov tooj cua module. Kuv kuj qhia kuv qhov kev sib tham rau nws, tab sis lub khob cij yuav ua haujlwm ib yam.

Txhawm rau siv SPI thiab nRF24 tus qauv hauv Bealebone Dub, yuav tsum muaj ob kauj ruam.

  1. Pab kom SPI ntawm Beaglebone Dub
  2. Tau txais NRF24L01+ RADIOS Ua Haujlwm ntawm BEAGLEBONE BLACK

Kauj ruam 4: Rooj vag - Software

Rooj vag - Software
Rooj vag - Software
Rooj vag - Software
Rooj vag - Software

Hais txog software ntawm Beaglebone Black, tag nrho cov qauv tau qhia hauv daim duab 1.

Txij li thaum muaj Debian khiav ntawm nws, nws yooj yim heev rau nruab software siv apt-tau hais kom ua.

OpenHAB yog Java raws, yog li nws yog qhov tsim nyog los teeb tsa Java VM. Thov xa mus rau OpenHAB kev teeb tsa kom paub meej (nws yog rau Raspberry Pi, tab sis apt-tau ua haujlwm rau ob qho tib si). Txhawm rau pab MQTT rau OpenHAB, cov ntawv "org.openhab.binding.mqtt-x.y.z.jar" yuav tsum tau muab tso rau hauv "addons" nplaub tshev hauv OpenHAB qhov chaw nplaub tshev. Peb xav tau cov ntaub ntawv teeb tsa (txuas hauv qab no), qhov twg "openhab.cfg", "test.sitemap" thiab "test.items" yuav tsum tau muab tso rau hauv "teeb tsa", "teeb tsa/sitemaps" thiab "teeb tsa/yam khoom" nplaub tshev, feem. Tom qab ntawd, OpenHAB tuaj yeem pib los ntawm kev ntaus "./start.sh".

Txog MQTT npav, Kuv siv Mosquitto uas yog qhib qhov chaw MQTT broker. Cov yoov tshaj cum version ntawm apt-tau yog qhov qub heev, yog li kuv rub tawm cov cai los ua ke thiab teeb tsa.

  1. Tau txais qhov chaws los ntawm lub vev xaib raug cai saum toj no.
  2. Hauv cov ntawv cim npe, tsim cov ntawv tshiab hu ua "tsim".
  3. Mus rau hauv "tsim", ntaus "cmake.."
  4. Tom qab ntawd rov qab mus rau lub nplaub tshev sab saud, ntaus "ua" thiab "teeb tsa"

Thaum kawg, txoj haujlwm ntawm rooj vag yog tus choj nruab nrab ntawm MQTT npav thiab nRF24 tus qauv, thiab cov vaj tsev tau qhia hauv daim duab 2. Muaj ob kab, txhua qhov rau ib qho kev taw qhia (piv txwv li ib qho rau kev tswj CMD los ntawm OpenHAB mus rau lub zog txuas, ib qho rau rov qab taw qhia). Yeej nws yog tus tsim khoom yooj yim/kev siv cov txheej txheem logic. Qhov chaws ntawm lub qhov rooj tuaj yeem pom ntawm no, nws siv qee qhov C ++ 11 cov yam ntxwv (txhawm rau teeb tsa GCC tshiab ntawm Beaglebone Dub, xa mus rau kab lus no) thiab xav tias nRF24 lib tau teeb tsa (xa mus rau Kauj Ruam dhau los).

Kauj Ruam 5: Lub Hwj Huam Hwjchim - Kho Vajtse

Fais fab Sawb - Kho vajtse
Fais fab Sawb - Kho vajtse
Fais fab Sawb - Kho vajtse
Fais fab Sawb - Kho vajtse
Fais fab Sawb - Kho vajtse
Fais fab Sawb - Kho vajtse

Cov ntaub ntawv:

Arduino pro mini board.

NRF24L01+ module.

10uF capacitor (RadioShack, ebay thiab lwm yam), txhawm rau txhim kho kev ntseeg tau txais tos.

Peb 10K resistors (RadioShack, ebay thiab lwm yam), rau kev hloov pauv.

Peb Relay modules.

Peb tus qauv hloov/qhov hluav taws xob combo thiab lub thawv, Kuv yuav lawv los ntawm Lowe's.

110vac rau 5vdc module, txhawm rau ua kom lub zog Arduino thiab xa tawm.

5vdc mus rau 3vdc nqis qis, txhawm rau lub zog nRF24.

Qhov kev sib txuas tau qhia hauv daim duab 1.

!!!!! Yog tias koj xav siv tib lub hloov/qhov hluav taws xob sib txuas zoo li kuv, thov nco ntsoov tias koj txiav qhov "txiav tawm" ntawm nws (saib daim duab 2) !!!!! Qhov no tseem ceeb heev lossis koj tuaj yeem rhuav tshem tag nrho koj lub voj voog !!!!

Daim duab 3 qhia txog lub zog fais fab tiav, raws li koj tuaj yeem pom, nws tsis zoo nkauj hauv lub thawv (txij li kuv tsis tuaj yeem pom ib qho loj txaus tawm ntawm lub txee fais fab sawb nrog tus kheej hloov mus siv), tab sis nws ua haujlwm ^_ ^!

Kauj Ruam 6: Lub Hwj Huam Sawb - Software

Kuv siv tib lub tsev qiv ntawv nRF24 rau Arduino zoo li rau Beaglebone Dub (ntawm no, librf24-bbb nplaub tshev yog rau Beaglebone Dub, thaum ib qho hauv cov hauv paus ntawv yog rau Arduino), tab sis koj kuj tseem tuaj yeem siv qhov muaj zog/muaj zog ntxiv rau Arduion hauv nov.

Kuv qhov chaws rau lub hwj chim sawb sab tau txuas ntawm no, thov siv Arduino IDE (lossis lwm yam kev xaiv) thiab tus programmer kom raug rau nruab nws ntawm Arduino pro mini.

Kauj Ruam 7: Xaus

Txaus siab rau !!!

Pom zoo: