Raspberry(树莓派)安装MQTT服务器
·
mosquitto是比较常用的MQTT服务器,它本身也是开源的。这篇文章以mosquitto为例,说明如何在安装了Raspberry的树莓派上安装mosquitto
1. 安装依赖openssl
可以通过命令执行:
sudo apt-get install libssl-dev
如果不安装openssl直接去编译mosquitto,会有下面的错:
fatal error:openssl/opensslconf.h:No such file or directory
2. 安装依赖cjson
这个就通过源码安装吧,去https://github.com/DaveGamble/cJSON下载包导入树莓派中,然后在文件夹中:
make
make install
如果不安装cJson直接去编译mosquitto,会有下面的错:
mosquitto_ctrl.h:21:10: fatal error: cjson/cJSON.h: No such file or directory
3. 安装mosquitto
首先执行如下命令(否则mosquitto的make会报错):
sudo apt-get install xsltproc docbook-xsl docbook-xml
去这个网站http://mosquitto.org/files/source/下载mosquitto的源码并导入树莓派,进入指定文件夹下执行如下命令:
cd mosquitto-2.0.9
make
sudo make install
4. 验证是否安装成功
执行命令:
mosquitto -v
出现下面这样的就算是成功了
更多推荐
已为社区贡献9条内容
所有评论(0)