Cov txheej txheem:

KEV HLOOV TSHIAB HAUV TSEV KAWM NTAWV hauv MQTT Tus Pabcuam Siv RASPBERRY PI THIAB NODEMCU BOARD: 6 Kauj Ruam
KEV HLOOV TSHIAB HAUV TSEV KAWM NTAWV hauv MQTT Tus Pabcuam Siv RASPBERRY PI THIAB NODEMCU BOARD: 6 Kauj Ruam

Video: KEV HLOOV TSHIAB HAUV TSEV KAWM NTAWV hauv MQTT Tus Pabcuam Siv RASPBERRY PI THIAB NODEMCU BOARD: 6 Kauj Ruam

Video: KEV HLOOV TSHIAB HAUV TSEV KAWM NTAWV hauv MQTT Tus Pabcuam Siv RASPBERRY PI THIAB NODEMCU BOARD: 6 Kauj Ruam
Video: Hloov Kev Xav, Lub Neej Hloov 2024, Hlis ntuj nqeg
Anonim
KEV HLOOV TSHIAB HAUJ LWM ZOO TSHAJ PLAWS MQTT SERVER Siv RASPBERRY PI THIAB NODEMCU BOARD
KEV HLOOV TSHIAB HAUJ LWM ZOO TSHAJ PLAWS MQTT SERVER Siv RASPBERRY PI THIAB NODEMCU BOARD

Txog tam sim no kuv tau ua ntau cov vis dis aus qhia txog kev tswj cov khoom siv hauv internet. Thiab rau qhov kuv ib txwm nyiam Adafruit MQTT server vim nws yooj yim siv thiab siv tau zoo rau. Tab sis txhua yam uas tau ua los ntawm internet. Qhov ntawd txhais tau tias peb tuaj yeem tswj hwm cov cuab yeej tsuas yog thaum peb muaj kev sib txuas hauv is taws nem zoo uas tsis ua haujlwm txhua. Yog li lub sijhawm no, Kuv tuaj nrog Tsev automation raws li Local MQTT server uas peb tuaj yeem tswj cov khoom siv yam tsis xav tau internet. Txhua yam khoom siv yuav txuas nrog ib lub network thiab peb tuaj yeem yooj yim tswj lawv siv peb lub xov tooj ntse app.

Peb kuj tseem tuaj yeem ntsuas cov ntaub ntawv ntawm ntau lub ntsuas ntsuas txuas rau ntawm peb lub pcb. Yog li cia saib seb nws ua haujlwm li cas thiab yuav ua li cas.

Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau

  1. Raspberry Pi 3B pawg thawj coj saib
  2. SD daim npav
  3. Pawg Board
  4. 4 x 5V Relays
  5. DHT11 sensor
  6. 4 x BC547 transistors
  7. 4x 1 n4007 diode
  8. 4 x 330 ohm resistor
  9. 7805 ib
  10. 9v Hwj chim Adapter
  11. DC lub qhov (socket)
  12. 2 tus pin Ntsuab Txuas

Kauj Ruam 2: Daim duab Circuit Court

Daim duab Circuit Court
Daim duab Circuit Court

Kauj Ruam 3: Kev xaj PCBs rau Txoj Haujlwm no

Kev txiav txim PCBs rau Txoj Haujlwm no
Kev txiav txim PCBs rau Txoj Haujlwm no

Txoj haujlwm no yuav tsum muaj ntau yam khoom sib txuas ua ke. Yog tias koj mus rau Lub Hom Phiaj Tshwj Xeeb PCB, tom qab ntawd Nws yuav yog qhov nyuaj thiab txheej txheem ntev rau koj. Zoo dua mus rau qhov kev cai tsim PCB. Nws yooj yim heev kom xaj koj li PCBs los ntawm jlcpcb.com. Koj tsuas yog yuav tsum tau ua tus as khauj, xa cov ntaub ntawv gerber ntawm PCB thiab tso koj xaj. Koj yuav tau txais PCBs ntawm koj lub qhov rooj kauj ruam. Thiab nyob zoo, koj puas paub tus nqi rau PCBs no?

Nws tsuas yog $ 2 rau 10 PCBs. Yog lawm, koj tau hnov qhov yog, hauv tsuas yog $ 2, koj yuav tau txais 10 qhov PCBs zoo nrog tus nqi zoo ntawm koj lub qhov rooj. Kuv ib txwm nyiam JLCPCB rau PCBs siv hauv kuv cov phiaj xwm thiab yuav qhia koj ib yam ntxiv rau nws. Yog tias koj xav tau txais cov ntaub ntawv gerber ntawm PCB siv hauv txoj haujlwm no, koj tuaj yeem rub nws dawb los ntawm, www.easyeda.com/techiesms/ultimate-home-automation. Tom qab rub tawm cov ntaub ntawv gerber, upload nws rau JLCPCB thiab tso koj xaj. Yooj yim.

Kauj Ruam 4: Txhim Kho Mosquitto MQTT Broker ntawm Rpi

Ua ntej tshaj plaws, rub tawm qhov tseeb version ntawm raspbian jessie los ntawm raspberry pi lub vev xaib raug cai. Ua ntej txhim kho daim duab, ua ntej ntawm txhua daim ntawv SD daim npav nrog daim ntawv thov, daim npav SD daim ntawv.

Tom qab ntawd ntsaws cov duab rau hauv daim npav SD nrog kev pab ntawm software hu ua Etcher

Tom qab koj ua tiav khau raj cov duab rau hauv daim npav pib siv lub cuab yeej, txuas nws nrog internet los ntawm wifi. Qhib lub davhlau ya nyob twg thiab nkag mus rau cov lus txib ib tus zuj zus, sudo apt-tau hloov tshiab

sudo apt-tau hloov tshiab

sudo apt-tau nruab mosquitto

sudo apt-tau nruab mosquitto-cov neeg siv khoom

Tom qab ua qhov no, koj yuav tuaj yeem siv koj tus Pi ua MQTT broker..

Kauj Ruam 5: NodeMCU Raws li MQTT Client

NodeMCU Raws li MQTT Client
NodeMCU Raws li MQTT Client

Hauv txoj haujlwm no, Kuv tab tom siv NodeMCU ua tus tswj hwm uas muaj MQTT tus lej siv tus lej xa khoom ntawm nws. Txoj cai rau txoj haujlwm no tau muab tso rau ntawm kuv tus lej GitHub. Txhawm rau siv tus lej ntawd, koj yuav tsum muaj Adafruit MQTT Library thiab DHT11 lub tsev qiv ntawv teeb tsa ntawm koj lub system.

Qhov kev hloov pauv nkaus xwb uas koj yuav tsum tau ua sab hauv cov cai yog, ua ntej koj yuav tsum nkag mus rau WiFi daim ntawv pov thawj hauv nws. Tom qab ntawd koj yuav tsum nkag mus rau tus IP chaw nyob ntawm koj raspberry pi board ua tus MQTT server. Txhawm rau kom tau txais IP chaw nyob ntawm koj lub Rooj Tswjhwm Saib Raspberry Pi, qhib lub davhlau ya nyob twg thiab nkag mus rau qhov hais kom ua ifconfig thiab nias nkag mus.

Cov cai rau NodeMCU pawg thawj coj tau muab tso rau ntawm kuv tus lej GitHub. Yog li koj tuaj yeem rub tawm tau yooj yim thiab siv tus lej ntawd rau koj txoj haujlwm.

Kauj Ruam 6: Tutorial Video

Kuv tau ua daim vis dis aus qhia tag nrho uas kuv tau npog txhua qhov ntawm txhua qhov ntawm txoj haujlwm no. Kuv kuj tseem tau qhia yuav ua li cas teeb tsa lub MQTT dashboard hauv daim ntawv thov. Yog li ua siab zoo saib cov vis dis aus no.

Pom zoo: