安装libwebsockets 这里的编译过程比较慢,树莓派的硬件决定的。
wget https://github.com/Kitware/CMake/releases/download/v3.17.0-rc3/cmake-3.17.0-rc3.tar.gz data目录有
tar -xzvf cmake-3.17.0-rc3.tar.gz
cd cmake-3.17.0-rc3
./configure
make
make install
下载 libwebsockets data目录有
unzip libwebsockets-master.zip
cd libwebsockets-master/
mkdir build
cd build/
cmake ../
make
make install
cp lib/libwebsockets.so.16 /usr/lib/
安装MQTT服务
tar -zxvf mosquitto-1.6.9.tar.gz data目录有
cd mosquitto-1.6.9
修改config.mk 中 WITH_WEBSOCKETS:=yes
make
make install
安装 nginx 下载 http://nginx.org/download/nginx-1.16.1.tar.gz data目录有
yum -y install gcc pcre-devel zlib-devel
tar -zxvf nginx-1.16.1.tar.gz
cd nginx-1.16.1
./configure
make
make install