Mosquitto-MQTT
安装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的更多相关文章
- 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 ...
- Ubuntu 16.04安装测试MQTT Mosquitto
环境:Ubuntu 16.04 介绍MQTT MQTT是一种机器到机器的消息传递协议,旨在为“物联网”设备提供轻量级的发布/订阅通信.它通常用于地理跟踪车队,家庭自动化,环境传感器网络和公用事业规模数 ...
- TCP/IP, WebSocket 和 MQTT
按照OSI网络分层模型,IP是网络层协议,TCP是传输层协议,而HTTP和MQTT是应用层的协议.在这三者之间, TCP是HTTP和MQTT底层的协议.大家对HTTP很熟悉,这里简要介绍下MQTT.M ...
- Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto
Mosquitto安装_Ubuntu/Debian上安装消息队列Mosquitto MQTT是IBM开发的一个即时通讯协议.MQTT是面向M2M和物联网的连接协议,采用轻量级发布和订阅消息传输机制.M ...
- 常见MQTT服务器搭建[转载]
简介 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,它比较适合于在低带宽.不可靠的网络的进行远程传感器和控制设备通 ...
- 常见MQTT服务器搭建与试用
常见MQTT服务器搭建与试用 简介 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输)是IBM开发的一个即时通讯协议,它比较适合于在低带宽.不可靠 ...
- mosquitto ---mosquitto-auth-plug
https://github.com/jpmens/mosquitto-auth-plug This is a plugin to authenticate and authorize Mosquit ...
- 各种MQTT server功能比較
this page attempts to document the features that various MQTT servers (brokers) support. This is spe ...
- 采用MQTT协议实现android消息推送(2)MQTT服务端与客户端软件对比、android客户端示列表
1.服务端软件对比 https://github.com/mqtt/mqtt.github.io/wiki/servers 名称(点名进官网) 特性 简介 收费 支持的客户端语言 IBM MQ 完整的 ...
- 物联网时代-跟着Thingsboard学IOT架构-MQTT设备协议
Thingsboard的MQTT设备协议 thingsboard官网: https://thingsboard.io/ thingsboard GitHub: https://github.com/t ...
随机推荐
- fastjson 的简单说明及使用
fastjson 是一个性能很好的 Java 语言实现的 JSON 解析器和生成器,来自阿里巴巴的工程师开发. 各个版本jar包下载地址:https://repo1.maven.org/maven2/ ...
- android布局之线性布局
LinearLayout 线性布局有两种,分别是水平线性布局和垂直线性布局,LinearLayout属性中android:orientation为设置线性布局当其="vertical&quo ...
- UltraISO对光盘镜像的常用操作
UltraISO,它能直接编辑光盘映像或者从光盘映像文件里面提取文件:可以从CD-ROM里面制作光盘映像:也可以把硬盘上的文件制作成ISO文件:可以把ISO中启动信息保存下来,也可以为ISO添加启动功 ...
- MySql The service could not be started
MySql安装 由于需要用mySql数据库今天就把它安上了,每次安装软件,数据库总是够我们折腾的,有时出现错误甚至比重装系统还要让人头疼. 今天在安的过程中就不出了很多错误,在重启与重装的反复捣鼓中终 ...
- Java多线程,哲学家就餐问题
问题描述:一圆桌前坐着5位哲学家,两个人中间有一只筷子,桌子中央有面条.哲学家思考问题,当饿了的时候拿起左右两只筷子吃饭,必须拿到两只筷子才能吃饭.上述问题会产生死锁的情况,当5个哲学家都拿起自己右手 ...
- MyEclipse_6.0.1GA_E3.3.1集成版下载地址
因在开发中经常使用到myeclipse 对比相关版本,还是觉得6.0 –6.5 比较适合开发,其他的开发起来比较卡,下面是下载地址 MyEclipse_6.0.1GA_E3.3.1集成版下载地址: ...
- sizeToFit的用法和用途
最近有遇到过sizeToFit的方法,比较好奇,所以查了点资料 在官方文档中 - (void)sizeToFit; // calls sizeThatFits: with current view b ...
- html_entity_decode() 函数
html_entity_decode() 函数 定义和用法 The html_entity_decode() function converts HTML entities to characte ...
- MyTask1
从去年10月份开始着手的一个小项目,啊喂~人家更笨就没学过.net好不,都是现学现卖的丫~~~23333,好了好了,下面进入正题: 陆陆续续做了很长时间(其实也就是这两天兴趣说来就来,许久没码代码手痒 ...
- org.springframework.beans.factory.BeanCreationException: 求教育!
2014-11-26 14:05:56 [org.springframework.web.context.support.XmlWebApplicationContext]-[WARN] Except ...