Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Tsim tus AWS Account
- Kauj Ruam 2: Tsim Lub Tshuab Virtual
- Kauj Ruam 3: Xaiv Amazon Tshuab Duab (AMI)
- Kauj Ruam 4: Xaiv thiab Kho Kom Zoo Dua Hom
- Kauj Ruam 5: Txheeb Xyuas Lub Sijhawm Pib
- Kauj Ruam 6: Tau Txais IP Chaw Nyob
- Kauj Ruam 7: Txuas rau Koj Tus Kheej
- Kauj Ruam 8: Ruaj Ntseg Nrog Tus Kheej
Video: Yuav Ua Li Cas Teeb Mosquitto MQTT ntawm AWS: 8 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Nyob zoo! Kuv yuav teeb tsa tus tswv lag luam MQTT ntiag tug nrog tus password ntawm kuv AWS (amazon web service) tus lej rau kuv cov haujlwm IOT. Txhawm rau ua qhov no, Kuv tau ua tus lej pub dawb ntawm AWS uas yog qhov zoo rau 1 xyoos los ntawm kev mus ntawm no:
Khoom siv
Sofware siv:
Putty
MQTT LENS
Kauj ruam 1: Tsim tus AWS Account
Ua ntej, koj yuav xav tau AWS tus lej nyiaj.. Kuv twb tau tsim tus as khauj dawb uas zoo rau 1 xyoos thiab siv nws los nkag rau hauv. Koj tuaj yeem tsim koj li los ntawm kev mus rau qhov txuas no, nyem "Tsim Tus Account pub dawb" thiab muab qhov tsim nyog ntaub ntawv:
aws.amazon.com/free/?all-free-tier.s
Kauj Ruam 2: Tsim Lub Tshuab Virtual
Lub tswv yim:
Internet yog tsim los ntawm ob hom tshuab: tus neeg rau zaub mov lossis tus neeg siv khoom. Tus neeg rau zaub mov muab kev pabcuam rau koj thaum tus neeg thov kev pabcuam. Thaum koj qhib nplooj ntawv web no, koj lub tshuab thov luam daim ntawv ntawm nplooj ntawv web no uas tau khaws cia rau hauv server. Thaum tau txais koj qhov kev thov, tus neeg rau zaub mov xa koj daim ntawv tso cai rau koj pom nws. Txhawm rau kom ntseeg tau tias peb tus broker MQTT (cov kev pabcuam) tuaj yeem nkag mus siv lwm lub khoos phis tawj lossis khoom siv hluav taws xob txhua lub sijhawm, peb yuav tsum teeb tsa tus broker mus rau lub tshuab server uas ib txwm qhib thiab txuas nrog internet. Txhawm rau ua qhov no, peb xauj lub tshuab virtual, uas tseem hu ua duab, ntawm AWS uas ua haujlwm zoo li lub khoos phis tawj.
Cov lus qhia:
Ntawm Tus Tswj Kev Tswj
- Thaum nkag mus, koj yuav raug coj mus rau AWS Management Console.
- Hauv qab qhov kev daws teeb meem nyem rau "Launch a virtual Machine" raws li qhia hauv daim duab.
VIA LUB AMAZON EC2 console
- Koj tseem tuaj yeem tsim qhov piv txwv los ntawm kev mus rau qhov txuas no
- Nyob rau sab xis saum toj ntawm kab lus taw qhia, xaiv koj thaj tsam tam sim no. Hauv kuv qhov xwm txheej, nws yog Singapore.
- Hauv qab qhov Launch instance, nyem rau ntawm "Launch instance" khawm
Kauj Ruam 3: Xaiv Amazon Tshuab Duab (AMI)
Hauv theem no, koj yuav xaiv hom kev ua haujlwm (linux, windows, redhat thiab ntau yam ntxiv) thiab nco (64 ntsis /86 lossis caj npab) rau peb lub tshuab virtual.
- Xaiv los ntawm "Pib Pib" hom AMI nyob rau sab laug pane "Ubuntu Server 18.04 LTS (HVM), SSD Volume Type-ami-0f7719e8b7ba25c61 (64-ntsis x86) / ami-02b6622eae4966dfd (64-ntsis Caj Npab) nrog qib dawb ntawm nws lub logo.
- Ua kom ntseeg tau tias lub hauv paus ntaus ntawv hom: ebs thiab hom virtualization yog HVm txij li nws tau txuas sai dua raws li qhov no
Kauj Ruam 4: Xaiv thiab Kho Kom Zoo Dua Hom
Hauv theem kawg, peb teeb tsa lub khoos phis tawj. Ntawm no, peb teeb tsa nws ua server nrog cov cim xeeb hauv qab no thiab txuas nrog rau hauv internet (IPV6 kev txhawb nqa yuav tsum hais tias yog)
- Nyem rau ntawm Qib dawb tsim nyog ntawm hom t2.micro.
- Koj tuaj yeem nyem "Txheeb xyuas thiab tshaj tawm" tam sim lossis xaiv tau, nyem rau "Tom ntej: Txheeb Xyuas Cov Lus Qhia Ncaj Ncees" nyob rau hauv qab txoj cai kaum
- Nyem rau ntawm "Tom ntej: Ntxiv cov cim npe"
- Nyem "Mus rau Configure Security tabs". Ntawm no, Nyem ntxiv txoj cai Kom txog thaum koj muaj cov chaw nres nkoj hauv qab no qhib:
- 1883: MQTT, tsis nkag siab
- 8883: MQTT, encrypted
- 8080: MQTT hla WebSockets, tsis nkag siab
- 8081: MQTT hla WebSockets, encrypted
5. Nyem rau "Txheeb xyuas thiab tso tawm" nyob rau hauv qab txoj cai kaum
Kauj Ruam 5: Txheeb Xyuas Lub Sijhawm Pib
Txheeb xyuas cov ntsiab lus ntawm koj lub tshuab virtual. Hauv AWS, lawv hu nws ua piv txwv.
Kev ceeb toom kev nyab xeeb tuaj yeem tshwm nyob rau hauv qab qhov kev tshuaj xyuas qhov pib
Txhawm rau tshem nws, mus rau "teeb tsa pab pawg ruaj ntseg" thiab xaiv paub IP chaw nyob siv kev cai, lossis siv koj tus IP chaw nyob rau hom "SSH". Hloov qhov peev txheej no txwv cov khoom siv uas tuaj yeem txuas rau koj lub tshuab virtual. Hauv qhov no, peb yuav siv txhua qhov chaw.
- Nyem "Launch" ntawm qhov Review tab.
- Koj yuav raug nug kom xaiv tus khub tseem ceeb. Xaiv "Tsim tus yuam sij tshiab" ntawm qhov nco thiab nws lub npe. Txuag cov ntawv no txij li koj yuav siv nkag mus rau koj lub tshuab virtual tom qab.
- Nyem "Launch Instance"
Kauj Ruam 6: Tau Txais IP Chaw Nyob
Lub tswv yim:
Raws li tau hais ua ntej, muaj server thiab tus neeg siv khoom. Peb tuaj yeem xav txog cov neeg rau zaub mov raws li kev tsim khoom noj khoom haus, internet yog kev pabcuam xa zaub mov thiab peb yog cov neeg siv khoom. Ua ntej peb "thov" khoom noj los ntawm cov chaw tsim khoom noj tshwj xeeb los ntawm kev qhia nws "chaw nyob". Qhov kev pabcuam xa zaub mov mus rau qhov "chaw nyob" ntawd. Kev tsim khoom noj khoom haus "ua haujlwm" cov zaub mov rau cov zaub mov xa khoom uas yog tom qab ntawd xa tuaj rau koj. Ib yam li ntawd, peb cov neeg rau zaub mov xav tau IP Chaw Nyob Pej Xeem kom mus cuag tau hauv internet. Ua li ntawd,
- Mus rau Network & Security tab nyob ntawm sab laug pane
- Nyem Elastic IPs
- Nyem Allocate Elastic IP chaw nyob.
- Nias lub "Allocate" khawm thiab tos kom txog thaum nws xa koj mus rau nplooj ntawv nrog tus chij hais tias "Elastic OP Address Allocated"
Kauj Ruam 7: Txuas rau Koj Tus Kheej
Hauv cov xwm txheej tab ntawm sab laug, nyem rau "Cov xwm txheej". Kuv tau txiav txim siab muab kuv lub npe piv txwv li "MQTT Broker" los ntawm txhaj rau lub npov lub npe nyob ntawm thaj chaw npe. Txhawm rau txuas rau qhov piv txwv no:
- Txoj cai nyem rau ntawm kab ntawv ntawd thiab nyem nyem txuas.
- Xaiv txoj kev sib txuas. Rau tus neeg siv SSH ib leeg, ua raws AWS cov lus qhia ntawm kev txuas siv PUTTY. Saib cov duab rau cov duab txuas ntawm kuv qhov kev teeb tsa.
-
Tom qab txuas mus rau qhov piv txwv ntaus cov lus txib hauv qab no:
sudo apt hloov tshiab Hloov kho linux version ntawm koj lub tshuab
-
sudo apt nruab mosquitto mosquitto
Txhim kho tus broker broker
-
sudo apt nruab mosquitto mosquitto-cov neeg siv khoom
Nruab ib lub mositto tus thov kev pab
-
mositto -v
Txheeb xyuas qhov mositto version kom ntseeg tau tias nws tau teeb tsa kom raug. Yuav tsum muaj cov lus hais tias "Qhib ipv4 mloog lub mloog pob ntseg ntawm chaw nres nkoj 1883" yog teeb tsa kom raug. Ib qho "yuam kev: Chaw nyob twb tau siv" txhais tau tias tus broker twb tau khiav lawm
-
mosquitto_sub -h -t "test"
Mloog cov ncauj lus npe "xeem" ntawm tus broker ntawm qhov chaw nyob no (IPv4 Public IP)
-
- Xa Kev Tshaj Tawm uas siv lub Windows cov neeg siv khoom zoo li MQTT-LENS nrog cov lus pom zoo ib yam li daim duab txuas tom kawg. Koj yuav tsum muaj peev xwm tau txais cov lus ntawm koj li Linux console
Kauj Ruam 8: Ruaj Ntseg Nrog Tus Kheej
Ntawm linux console ntaus cov hauv qab no los tsim tus password. Hloov nrog lub npe siv uas koj xaiv.
sudo mosquitto_passwd -c/etc/mosquitto/passwd
Nws yuav teb tus password ob zaug. ceev faj vim nws yuav tsis pom cov tsiaj ntawv raug ntaus. Tom qab qhov no, tsim cov ntaub ntawv teeb tsa npe "default.conf" nyob ntawm cov ntaub ntawv txoj kev "etc/mosquitto/conf.d/" siv linux server cov ntawv sau npe hu ua "nano" raws li tus thawj coj/hauv paus siv los ntawm kev ntaus "sudo"
sudo nano /etc/mosquitto/conf.d/default.conf
Tom qab qhib cov ntawv, muab tshuaj txhuam hauv qab no. Txuag thiab tawm los ntawm nias Ctrl + X
allow_anonymous cuav
password_file/etc/mosquitto/passwd
Txhawm rau siv qhov kev hloov pauv no rov pib dua lub mos txwv los ntawm kev ntaus "Ctrl+O", "Enter" thiab "Ctrl+X"
sudo systemctl rov pib dua Mositto
Tam sim no koj tuaj yeem sim nws dua siv koj qhov kev xaiv Windows cov neeg siv khoom thiab nkag mus siv lub npe siv thiab tus lej nkag los sib txuas.
Pom zoo:
Yuav Ua Li Cas Thib Peb Lub Roj Teeb Lub Neej ntawm AAA Teeb nyem: 3 Kauj Ruam
Yuav Ua Li Cas Thib Peb Lub Roj Teeb Lub Neej ntawm AAA Teeb: Thaum siv 3W LED teeb nyem los ntawm AAA roj teeb, koj yuav cia siab tias lawv yuav nyob ntev li 30 feeb. Muaj ib txoj hauv kev kom peb npaug sijhawm ua haujlwm los ntawm kev siv AA roj teeb, uas kuv yuav qhia koj los ntawm kev txuas tus AA roj teeb tuav rau nws
Yuav Ua Li Cas Txuas thiab Tswj Lub Teeb Ntawm ZigBee Module ntawm Dragonboard: 5 Kauj Ruam
Yuav Ua Li Cas Txuas thiab Tswj Lub Teeb Los Ntawm ZigBee Module ntawm Dragonboard: Cov lus qhia no qhia tus neeg siv yuav ua li cas los txuas thiab txhim kho ZigBee tus qauv raug ntawm Dragonboard thiab cuam tshuam nrog ZigBee tswj lub teeb (OSRAM), ua ZigBee IOT network.Requirements : Dragonboard 410c; CC2531 USB Dongle; T
Yuav Ua Li Cas Kom Tsis Siv Neeg Teeb Teeb Teeb Meem: 6 Kauj Ruam
Yuav Ua Li Cas Kom Teeb Lub Teeb Kub Kub Tsis Siv Neeg: yog li hauv cov lus qhia no kuv yuav qhia yuav ua li cas thiaj ua lub teeb hluav taws xob thaum muaj xwm ceev yooj yim*yooj yim dua*lub hnab tshos*rov them dua*tsis siv neeg
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Info: 4 Cov Kauj Ruam
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws … Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Cov Lus Qhia: yog tias koj tau mus rau lub vev xaib thiab nws ua nkauj nkauj uas koj nyiam thiab xav tau nws ntawm no yog cov lus qhia rau koj tsis yog kuv qhov txhaum yog tias koj cuam tshuam qee yam (tsuas yog txoj hauv kev nws yuav tshwm sim yog tias koj pib tshem cov khoom yam tsis muaj laj thawj. ) Kuv tuaj yeem tau txais cov nkauj rau
YUAV UA LI CAS YUAV TSUM XEEB NYIAJ NTAWM LUB FAMOUS ALTOIDS TIN. (THIAB RECYCLE NTAWM LUB SIJ HAWM SIAB): 7 Kauj Ruam
YUAV UA LI CAS YUAV TSUM XEEB NYIAJ NTAWM LUB FAMOUS ALTOIDS TIN. (THIAB RECYCLE NTAWM LUB SIJ HAWM SIJ HAWM): Nyob Zoo Qhov tsis tsim nyog no yog hais txog yuav ua li cas thiaj ua tau lub thawv hlau kom zoo ib yam (lossis qhov loj npaum li cas koj xav tau) ntawm Altoids tin. Koj Puas Paub Dab Tsi Qhov No ???? Qhov no txhais tau tias koj tuaj yeem ua koj tus kheej tins ….. LEEJ TWG YUAV TSUM MUAJ !!!!!!!!!!!!! Qhov no yog li cas.MATERIALS: 2