mosquttio移植到Ubuntu
摘要
mqtt協(xié)議因其低帶寬和不穩(wěn)地網(wǎng)絡(luò)環(huán)境中提供可靠的網(wǎng)絡(luò)通訊服務(wù),而廣泛應(yīng)用在物聯(lián)網(wǎng)行業(yè)當(dāng)中。而本文主要介紹的如何在個(gè)人家庭環(huán)境下,如何搭建mqtt服務(wù)器。本文使用到的mqtt服務(wù)器為mosquitto。mosquitto 是一款實(shí)現(xiàn)了消息推送協(xié)議 MQTT v3.1 的開源消息代理軟件,提供輕量級的,支持可發(fā)布/可訂閱的的消息推送模式。(注意:如果要連接的設(shè)備比較多,建議使用emqx mqtt)
1.更新軟件包
apt-get update
2.安裝mosquitto
apt-get install mosquitto
mosquitto 命令
mosquito服務(wù)
service mosquitto status //查看mosquito服務(wù)狀態(tài)
service mosquitto start //重啟mosquito服務(wù)器
service mosquitto stop //停止mosquito服務(wù)
mosquito配置
# 打開文件
vim /etc/mosquitto/mosquitto.conf
# mosquitto.conf 文件內(nèi)容如下:
pid_file /var/run/mosquitto.pid
# 消息持久存儲
persistence true
persistence_location /var/lib/mosquitto/
# 日志文件
log_dest file /var/log/mosquitto/mosquitto.log
# 其他配置
include_dir /etc/mosquitto/conf.d
# 禁止匿名訪問
allow_anonymous false
# 認(rèn)證配置
password_file /etc/mosquitto/pwfile
# 權(quán)限配置
acl_file /etc/mosquitto/aclfile
mosquito添加用戶密碼
首次添加
mosquitto_passwd -c /etc/mosquitto/passwd 用戶名
# 輸入兩遍密碼
二次添加
mosquitto_passwd /etc/mosquitto/passwd 用戶名
# 輸入兩遍密碼
查看連接多少個(gè)客戶端
lsof -i | grep mosquitto
審核編輯:湯梓紅
-
Linux
+關(guān)注
關(guān)注
87文章
11378瀏覽量
211342 -
移植
+關(guān)注
關(guān)注
1文章
387瀏覽量
28316 -
Ubuntu
+關(guān)注
關(guān)注
5文章
569瀏覽量
30292 -
MQTT
+關(guān)注
關(guān)注
5文章
657瀏覽量
22966
發(fā)布評論請先 登錄
相關(guān)推薦
Linux系統(tǒng)移植開發(fā)篇2:燒寫linux鏡像

Linux系統(tǒng)移植篇8:STM32MP1微處理器之Linux內(nèi)核配置及編譯
Linux系統(tǒng)移植篇9:Linux內(nèi)核eMMC驅(qū)動移植
STM32MP157 Linux系統(tǒng)移植開發(fā)篇13:Linux內(nèi)核5寸觸摸屏驅(qū)動移植
STM32MP157 Linux系統(tǒng)移植開發(fā)篇15:Linux內(nèi)核7寸觸摸屏驅(qū)動移植
Linux系統(tǒng)移植
移植Linux到晶心平臺

Ubuntu從入門到精通
Ubuntu+Linux教程
如何讓Ubuntu Linux更快的技巧
Linux Ubuntu教程之Linux Ubuntu14.04如何進(jìn)行開發(fā)環(huán)境的搭建
STM32MP157 Linux系統(tǒng)移植開發(fā)篇1:linux系統(tǒng)移植前說明及源碼編譯

rk3288移植ubuntu
【北京迅為】i.mx8mm嵌入式linux開發(fā)指南第四篇 嵌入式Linux系統(tǒng)移植篇第六十九章uboot移植

評論