一、mosquitto搭建
1.1 mosquitto介紹
Eclipse Mosquitto是一個(gè)開源(EPL/EDL許可)消息代理(broker),它實(shí)現(xiàn)了MQTT協(xié)議版本5.0、3.1.1和3.1。Mosquito重量輕,適用于從低功耗單板計(jì)算機(jī)到完整服務(wù)器的所有設(shè)備。
1.2 使用mosquitto在windows下創(chuàng)建一個(gè)mqtt broker
step1)使能mosquitto服務(wù)
step2)配置mosquitto
MQTT協(xié)議端口號(hào)
listener 1883
啟用WebSocket支持
listener 9001
protocol websockets
訂閱主題持久化
persistence true
persistence_location D:softwaremosquittodata
開啟日志記錄
log_dest file D:softwaremosquittomosquitto.log
log_type all
開啟密碼驗(yàn)證
password_file D:softwaremosquittopwfile.example
allow_anonymous false
step3)創(chuàng)建訪問mqtt broker的賬戶
mosquitto_passwd.exe用于生成連接mqtt broker的用戶名和密碼,下面的命令表示向pwfile.example文件追加一個(gè)“myAccount”賬戶,在client中可以用這個(gè)賬戶和密碼登錄,否則會(huì)報(bào)驗(yàn)證失敗的錯(cuò)誤。
.mosquitto_passwd.exe .pwfile.example myAccount
step4)啟動(dòng)mqtt broker
執(zhí)行下面的命令可以啟動(dòng)一個(gè)mqtt服務(wù)器
.mosquitto.exe -v -c .configmosquitto.conf
二、mqtt網(wǎng)絡(luò)包分析
-
RT-Thread
+關(guān)注
關(guān)注
32文章
1409瀏覽量
41967 -
MQTT協(xié)議
+關(guān)注
關(guān)注
0文章
99瀏覽量
5954
發(fā)布評(píng)論請(qǐng)先 登錄
ElfBoard技術(shù)貼|如何移植Mosquitto庫(kù)

在英特爾Edison開發(fā)平臺(tái)上運(yùn)行Mosquitto MQTT
在linux上搭建mqtt服務(wù)器
mosquitto在ARM嵌入式平臺(tái)的移植方法
kawayi mqtt連接mosquitto始終連接不上怎么解決?
如何用數(shù)據(jù)采集網(wǎng)關(guān)快速采集工業(yè)現(xiàn)場(chǎng)數(shù)據(jù),怎么搭建MQTT服務(wù)器?
OpenHarmony開發(fā)之MQTT講解
【廣東龍芯2K500先鋒板試用體驗(yàn)】4.移植開發(fā)MQTT服務(wù)與MQTT通訊測(cè)試
kawayi mqtt連接mosquitto失敗怎樣解決該問題?
ESP SDK中是否支持mqtt broker功能?
全志T3+Logos FPGA開發(fā)板——MQTT通信協(xié)議案例
怎么搭建MQTT服務(wù)器

來了解一下MQTT Broker代理

知識(shí)科普 MQTT Broker 代理 是什么

評(píng)論