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 ...
随机推荐
- 如何仿写thinkphp的C方法?
config.php代码如下: <?php return array( 'db_user'=>'root', 'db_pass'=>'root', 'db_name'=>'te ...
- 【设计模式 - 11】之享元模式(FlyWeight)
1 模式简介 当系统中存在大量对象时,非常容易造成内存溢出.为了解决这个问题,我们把这些对象中共有的部分抽象出来,如果有相同的业务请求,则直接返回在内存中已有的对象,避免重新创建,这就是享元 ...
- webview 本地上传文件
参考http://blog.csdn.net/zhtsuc/article/details/49154099 直接上代码 public class MainActivity1 extends Ac ...
- UVa 10400 - Game Show Math 游戏中的数学 dfs+判重
题意:给出一些数字和一个目标数字,要求你在数字间添加+-*/,让表达式能达到目标数字,运算符号的优先级都是一样的. 由于数据量很大,本来想用map<string>判重的,结果还是超时了,然 ...
- android 15 activity跳转
从一个屏幕跳到另一个屏幕,一个activity跳转到另一个activity,Intent类用于组件之间传递数据和跳转,组件包括不仅activity. package com.sxt.day04_01; ...
- linux下mysql配置文件my.cnf详解
basedir = path 使用给定目录作为根目录(安装目录). character-sets-dir = path 给出存放着字符集的目录. datadir = path 从给定目录读取数据库文件 ...
- css 嵌套 元素所属类别
元素所属类别 Metadata content(元数据元素)(8) base,link,meta,noscript,script,style,template, title Flow content( ...
- easyui 常用代码
最近在公司制作内部使用数据管理网页,用到了easyui,使用过程中发现与jquery的写法有比较多不一样的地方,趁现在有空,先做个笔记. (这里主要说明的是combobox的用法,其他的像textbo ...
- ES6数组去重
今天五一,在出去玩之前赶紧写篇博客,时刻不要忘记学习^_^!! 提到数组去重,想必大家都不陌生,会的同学可能噼里啪啦写出好几个,下面来看看之前常见的去重代码: 'use strict'; var ar ...
- linux的grep命令
参考文档如下: linux grep命令 grep abb15455baeb4b23ab47540272ec47eb epps-sas.log | grep operateSettleBill exp ...