安装Mosquitto

#To use the new repository you should first import the repository package signing key:
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key #Then make the repository available to apt:
cd /etc/apt/sources.list.d/ #Then one of the following, depending on which version of debian you are using:
sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list #Then update apt information:
sudo apt-get update #And discover what mosquitto packages are available:
sudo apt-cache search mosquitto ##Or just install:
#安装服务端
sudo apt-get install mosquitto
#安装客户端 (订阅sub 与 发布pub)
sudo apt-get install mosqutitto-client
#安装调试器
sudo apt-get install mosquitto-dbg

启动与关闭Mosquitto

开启 mosquitto:
sudo service mosquitto start
停止 mosquitto:
sudo service mosquitto stop
查看 mosquitto 状态:
sudo service mosquitto status
查看监听的端口:
sudo lsof -i:1883

测试Mosquitto

#启动代理服务
mosquitto -v
【-v】打印更多的调试信息 #订阅主题
mosquitto_sub -v -t sensor -h 192.168.228.130 -p
【-t】指定主题,此处为sensor
【-v】打印更多的调试信息
【-h】指定代理服务的IP地址
【-p】指定代理服务的端口号 #发布内容
mosquitto_pub -t sensor -m test_one -h 192.168.228.130 -p
【-t】指定主题,此处为sensor
【-m】指定消息内容,此处为test_one
【-h】指定代理服务的IP地址
【-p】指定代理服务的端口号

MQTT协议工作过程

---------------------------------------------------------------------------------------------------------------------------------------
※ 我在手机上先订阅内涵小段子(我为订阅者),内涵小段子每发我就会收到(内涵小段子为发布者,当然它也可以选择不发给我),我不订阅就收不到。
---------------------------------------------------------------------------------------------------------------------------------------

Mosquitto-MQTT的更多相关文章

  1. mosquitto MQTT message broker on ubuntu/debian built from source

    what is mosquitto? check this out! http://mosquitto.org what is MQTT? check this out. http://mqtt.or ...

  2. Ubuntu 16.04安装测试MQTT Mosquitto

    环境:Ubuntu 16.04 介绍MQTT MQTT是一种机器到机器的消息传递协议,旨在为“物联网”设备提供轻量级的发布/订阅通信.它通常用于地理跟踪车队,家庭自动化,环境传感器网络和公用事业规模数 ...

  3. TCP/IP, WebSocket 和 MQTT

    按照OSI网络分层模型,IP是网络层协议,TCP是传输层协议,而HTTP和MQTT是应用层的协议.在这三者之间, TCP是HTTP和MQTT底层的协议.大家对HTTP很熟悉,这里简要介绍下MQTT.M ...

  4. Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto

    Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto MQTT是IBM开发的一个即时通讯协议.MQTT是面向M2M和物联网的连接协议,采用轻量级发布和订阅消息传输机制.M ...

  5. 常见MQTT服务器搭建[转载]

    简介 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,它比较适合于在低带宽.不可靠的网络的进行远程传感器和控制设备通 ...

  6. 常见MQTT服务器搭建与试用

    常见MQTT服务器搭建与试用   简介 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,它比较适合于在低带宽.不可靠 ...

  7. mosquitto ---mosquitto-auth-plug

    https://github.com/jpmens/mosquitto-auth-plug This is a plugin to authenticate and authorize Mosquit ...

  8. 各种MQTT server功能比較

    this page attempts to document the features that various MQTT servers (brokers) support. This is spe ...

  9. 采用MQTT协议实现android消息推送(2)MQTT服务端与客户端软件对比、android客户端示列表

    1.服务端软件对比 https://github.com/mqtt/mqtt.github.io/wiki/servers 名称(点名进官网) 特性 简介 收费 支持的客户端语言 IBM MQ 完整的 ...

  10. 物联网时代-跟着Thingsboard学IOT架构-MQTT设备协议

    Thingsboard的MQTT设备协议 thingsboard官网: https://thingsboard.io/ thingsboard GitHub: https://github.com/t ...

随机推荐

  1. 【设计模式 - 14】之命令模式(Command)

    1      模式简介 命令模式的定义: 命令模式将命令封装成对象,从而使调用一个命令变为调用一个对象的指定方法. 命令模式的优点: 1)        降低了系统耦合度: 2)        新的命 ...

  2. GWT(Google Web Tookit) Eclipse Plugin的zip下载地址(同时提供GWT Designer下载地址)

    按照Eclipse Help->Install new software->....(这里是官方安装文档:http://code.google.com/intl/zh-CN/eclipse ...

  3. The app references non-public selectors in Payload

    上周上传app到appstore在validation完后有警告提示"The app references non-public selectors in Payload/wacao.app ...

  4. poj3252 Round Numbers

    Round Numbers Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7625   Accepted: 2625 Des ...

  5. [RxJS] map vs flatMap

    What's the difference between map and flatmap? First, let's show what map is. To show that, I need a ...

  6. Java 调用Dll

    Java 中怎么能调用到dll中的函数呢? 关键是java中生的本地函数名參数和dll中的本地函数名參数一模一样. 这个程序是java中调用dll中的求和函数. 一,java代码部分操作 1.新建pr ...

  7. 高级性能调试手段(oprofile+gprofile)+内核追踪手段:LTT

    http://blog.csdn.net/wlsfling/article/details/5876134http://www.lenky.info/archives/2012/03/1371http ...

  8. calltree查看工程代码中的函数调用关系

    http://blog.csdn.net/elitemouse/article/details/41680113 http://www.tinylab.org/callgraph-draw-the-c ...

  9. IE6与W3C标准的盒模型差异

    盒子模型(Box Model)是 CSS 的核心,现代 Web 布局设计简单说就是一堆盒子的排列与嵌套,掌握了盒子模型与它们的摆放控制,会发现再复杂的页面也不过如此,然而,任何美好的事物都有缺憾,盒子 ...

  10. U3D 脚本添加和获得对象

    有时候,一开始可能没有对象,而是由于某种触发,产生的一个对象,这里讲解下,如何通过脚本来创建一个对象: 这是通过脚本创建一个立方体: using UnityEngine; using System.C ...