码迷,mamicode.com
首页 > 其他好文 > 详细

安装MQTT客户端/服务器

时间:2015-12-05 20:51:09      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:

MQTT官方介绍

MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. It is useful for connections with remote locations where a small code footprint is required and/or network bandwidth is at a premium. For example, it has been used in sensors communicating to a broker via satellite link, over occasional dial-up connections with healthcare providers, and in a range of home automation and small device scenarios. It is also ideal for mobile applications because of its small size, low power usage, minimised data packets, and efficient distribution of information to one or many receivers

服务器/客户端选择

在MQTT官网中http://mqtt.org/software列举出了实现了该协议的开源客户端和服务器工程和库。根据网上资料的丰富程度这里我选Mosquitto作为我学习的工具

Mosquitto介绍

Mosquitto is an Open Source MQTT server with C, C++, Python. For JavaScript, Mosquitto recommends the Eclipse Paho Javascript client. A public, hosted test server is also available

Mosquitto安装配置

安装必要的库和工具包

sudo dnf groupinstall "Development tools"
sudo dnf groupinstall "Development Libraries"
sudo dnf install cmake gcc-c++ openssl-devel

 

下载源代码包,截止2015年12月,最新版本为mosquitto-1.4.5
wget http://mosquitto.org/files/source/mosquitto-1.4.5.tar.gz 

解压

tar zxfv mosquitto-1.4.5.tar.gz
 
进入目录
cd mosquitto-1.4.5

 

配置

cmake .

编译

make

安装

sudo make install

 


安装MQTT客户端/服务器

标签:

原文地址:http://www.cnblogs.com/zhanghongjay/p/5022237.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!