标签:
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 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
安装必要的库和工具包
sudo dnf groupinstall "Development tools"
sudo dnf groupinstall "Development Libraries"
sudo dnf install cmake gcc-c++ openssl-devel
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
标签:
原文地址:http://www.cnblogs.com/zhanghongjay/p/5022237.html