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

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

來了解一下MQTT Broker代理

知識科普 MQTT Broker 代理 是什么

評論