Cov txheej txheem:

Ntse Kab Hlau Kab: 4 Cov Kauj Ruam
Ntse Kab Hlau Kab: 4 Cov Kauj Ruam

Video: Ntse Kab Hlau Kab: 4 Cov Kauj Ruam

Video: Ntse Kab Hlau Kab: 4 Cov Kauj Ruam
Video: Tseem Ev Lub Kawm - Koos Loos 2024, Hlis ntuj nqeg
Anonim
Image
Image

Koj puas xav tau lub kaw lus ntse uas kaw nws tus kheej thaum chav sov dhau thiab ci thiab tseem tuaj yeem tswj nws nyob deb ntawm kev mus?

Ntawm no kuv yuav qhia koj yuav ua li cas kom yooj yim tiag tiag ~

Khoom siv

  • Thawv lub thawv
  • DHT11 kub sensor
  • Servo tsav
  • Rooj sensor
  • Realtek Ameba1 RTL8195AM microcontroller
  • Jumper hlau

Kauj ruam 1: MQTT

MQTT
MQTT

MQTT yog lub tshuab-rau-tshuab (M2M)/"Internet ntawm Yam" kev sib txuas raws tu qauv. Nws tau tsim los ua qhov hnyav hnyav tshaj tawm/sau npe xa xov xa.

Peb tuaj yeem hais MQTT yog cov txheej txheem tsim rau IoT. MQTT yog ua raws TCP/IP thiab xa/tau txais cov ntaub ntawv ntawm kev tshaj tawm/sau npe.

Txij li thaum peb tab tom siv ameba pawg thawj coj txhim kho, peb tuaj yeem sau npe tus as khauj ntawm lub vev xaib raug cai ntawm amebaiot, thiab tau txais MQTT server dawb ntawm amebaiot.com/cloud-getting-started

Nco tseg, thaum koj tau sau npe ntawm AmebaIOT.com thiab tau sau koj lub cuab yeej rau "Cloud Service", tom qab ntawd lub npe siv thiab tus lej koj siv los nkag rau hauv AmebaIOT.com zoo ib yam rau koj qhov txuas MQTT, cov ntsiab lus yuav piav qhia tom qab hauv kev qhia.

Kauj ruam 2: Teeb Software

Teeb Software
Teeb Software
Teeb Software
Teeb Software
Teeb Software
Teeb Software

Qhov nruab nrab ntawm txhua qhov IoT (Internet-of-Things) txoj haujlwm yog Wi-nkaus-siv microcontroller, peb tes num tsis muaj qhov tshwj xeeb. Wi-Fi microcontroller siv ntawm no yog Ameba-1 RTL8195AM los ntawm Realtek, nws tau txais ntau yam khoom siv muaj txiaj ntsig zoo thiab muaj zog Wi-nkaus module ntawm lub zog qis txaus kom khiav ntawm lub roj teeb ntawm tes rau lub lis piam.

Dab tsi ntxiv? Pawg no yog programmable ntawm Arduino IDE! Yog, tsis muaj kev kawm nyuaj software xav tau, tsuas yog qhib koj Arduino IDE thiab muab cov kab ntawv txuas hauv qab no rau hauv "tus thawj tswj hwm ntxiv URLs" nyob rau hauv "Cov Ntaub Ntawv -> Nyiam" thiab microcontroller tag nrho cov cuab yeej siv thiab cov khoom siv yuav raug rub tawm ncaj qha los ntawm kev teeb tsa lub rooj tsavxwm no los ntawm "Board Manager" nyob rau hauv "Tools -> Board"

Tom qab ntawd, koj tuaj yeem rub tawm qhov chaws los ntawm Github ntawm Github.

Qhov kawg uas koj yuav tsum tau ua yog txhawm rau kho cov ntaub ntawv hauv qab no ntawm tus lej koj nyuam qhuav rub tawm thiab tom qab ntawd koj tau npaj los tsoo lub pob "Upload" thaum kawg thiab tau txais cov cai tawm ntawm ameba hauv vib nas this.

Kauj Ruam 3: Kev Kho Vajtse Txuas

Kho vajtse txuas
Kho vajtse txuas
Kho vajtse txuas
Kho vajtse txuas
Kho vajtse txuas
Kho vajtse txuas

Koj tuaj yeem xa mus rau ntu khoom siv kom tau txais cov npe khoom uas koj xav tau.

Ua ntej koj yuav tsum tsim "tsev" los ntawm lub thawv ntawv, tsis zoo nkauj heev, qhov hauv qab no yuav ua.

Kev sib txuas hauv Circuit Court yog qhov yooj yim dua, txheeb xyuas daim ntawv qhia kev sib txuas hauv qab no kom tau txais txhua yam txuas nrog.

Thaum kev sib txuas tiav, koj tuaj yeem muab cov kua nplaum tso rau ntawm phab ntsa ntawm koj lub thawv ntawv lub tsev thaum txuas nws txhais caj npab rau daim ntaub thaiv, lo lub paj ntoo paj ntoo rau ntawm ib sab ntawm kab hlau rhuav thiab lo cov hlau nplaum mus rau lwm sab ntawm daim ntaub. Nco ntsoov tias, los ntawm lub neej ntawd, reed sensor thiab cov hlau nplaum yuav tsum nyob ib sab kom txog thaum servo lub cev muaj zog rub daim ntaub thiab rub nws nrog nws.

Lub hom phiaj ntawm lub paj taub yog qhia rau ameba paub yog tias daim ntaub thaiv raug kaw lossis qhib. Qhov kawg tab sis tsis tsawg tshaj plaws, nplaum DHT11 lub ntsuas pa mus rau lwm sab ntawm phab ntsa, nws yuav pab ntsuas ntsuas "chav" qhov kub thiab yuav tsum qhia rau ameba yog tias chav tau txais tshav ntuj ntau dhau uas ua rau kub tsis txaus. Yog tias chav sov tiag, nws yuav kaw ntawm daim ntaub thiab xa tus neeg siv MQTT lus.

Kauj ruam 4: Teeb Xov Tooj

Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj
Teeb Xov Tooj

Txhawm rau tswj cov kab hlau rhuav los ntawm MQTT, peb yuav tsum xub teeb tsa MQTT cov neeg siv khoom. Muaj ntau qhov pub dawb MQTT tus thov kev pabcuam ntawm Playstore rau Android thiab Appstore rau iOS. Nov yog Android version thiab iOS version.

Tsis muaj teeb meem twg version koj siv, txheej txheem teeb tsa zoo ib yam, Ua ntej tshaj, koj yuav tsum tau sau rau hauv MQTT server chaw nyob -> “cloud.amebaiot.com”;

Qhov thib ob, sau tus lej chaw nres nkoj -> “1883”;

Thib peb, sau cov ncauj lus kom sau npe yuav -> “outTopic”;

Plaub, sau cov ncauj lus los tshaj tawm -> “hauvTopic”;

Thib tsib, sau koj li MQTT huab kev pabcuam username thiab password;

Thaum kawg, nyem "txuas" khawm kom tau txais kev sib txuas.

Thaum txuas nrog, koj yuav tau txais "--- MQTT server txuas nrog! ---" cov lus xa los ntawm ameba raws li kev pom zoo ntawm kev ua tiav kev sib txuas ob tog. Tam sim no, koj tuaj yeem xa cov lus "ntawm" kom qhib daim ntaub thiab "tawm" cov lus kom kaw nws txhua lub sijhawm koj nyiam!

Pom zoo: