一、mosquitto搭建
1.1 mosquitto介紹
Eclipse Mosquitto是一個開源(EPL/EDL許可)消息代理(broker),它實現了MQTT協議版本5.0、3.1.1和3.1。Mosquito重量輕,適用于從低功耗單板計算機到完整服務器的所有設備。
1.2 使用mosquitto在windows下創建一個mqtt broker
step1)使能mosquitto服務
step2)配置mosquitto
MQTT協議端口號
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)創建訪問mqtt broker的賬戶
mosquitto_passwd.exe用于生成連接mqtt broker的用戶名和密碼,下面的命令表示向pwfile.example文件追加一個“myAccount”賬戶,在client中可以用這個賬戶和密碼登錄,否則會報驗證失敗的錯誤。
.mosquitto_passwd.exe .pwfile.example myAccount
step4)啟動mqtt broker
執行下面的命令可以啟動一個mqtt服務器
.mosquitto.exe -v -c .configmosquitto.conf
二、mqtt網絡包分析
-
RT-Thread
+關注
關注
31文章
1305瀏覽量
40402 -
MQTT協議
+關注
關注
0文章
98瀏覽量
5490
發布評論請先 登錄
相關推薦
ElfBoard技術貼|如何移植Mosquitto庫
![ElfBoard技術貼|如何移植<b class='flag-5'>Mosquitto</b>庫](https://file1.elecfans.com/web3/M00/02/3D/wKgZO2db42iAFiswAABH_NtRJ3U728.png)
在英特爾Edison開發平臺上運行Mosquitto MQTT
在linux上搭建mqtt服務器
mosquitto在ARM嵌入式平臺的移植方法
kawayi mqtt連接mosquitto始終連接不上怎么解決?
如何用數據采集網關快速采集工業現場數據,怎么搭建MQTT服務器?
OpenHarmony開發之MQTT講解
【廣東龍芯2K500先鋒板試用體驗】4.移植開發MQTT服務與MQTT通訊測試
kawayi mqtt連接mosquitto失敗怎樣解決該問題?
全志T3+Logos FPGA開發板——MQTT通信協議案例
怎么搭建MQTT服務器
![怎么<b class='flag-5'>搭建</b><b class='flag-5'>MQTT</b>服務器](https://file.elecfans.com/web1/M00/53/2B/pIYBAFseJxuADXj5AABNHM99Bps521.png)
來了解一下MQTT Broker代理
![來了解一下<b class='flag-5'>MQTT</b> <b class='flag-5'>Broker</b>代理](https://file1.elecfans.com/web2/M00/FC/9C/wKgZomaU5NOAeXp5AAHyw44uN4w849.png)
知識科普 MQTT Broker 代理 是什么
![知識科普 <b class='flag-5'>MQTT</b> <b class='flag-5'>Broker</b> 代理 是什么](https://file1.elecfans.com/web2/M00/FC/9C/wKgZomaU5NOAeXp5AAHyw44uN4w849.png)
評論