# my_mqtt_sdk **Repository Path**: EExuke/my_mqtt_sdk ## Basic Information - **Project Name**: my_mqtt_sdk - **Description**: 基于mosquitto的MQTT客户端SDK开发 - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2022-01-06 - **Last Updated**: 2022-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # my_mqtt_sdk #### 介绍 基于mosquitto的MQTT客户端SDK开发 #### 软件架构 软件架构说明 #### 安装教程 1. 安装mosquitto: sudo apt-get install mosquitto 2. 源码包安装:https://blog.csdn.net/qq_36413982/article/details/115184473 3. xxxx #### 使用说明 1. C APIs: https://mosquitto.org/api/index/Functions.html 2. xxxx 3. xxxx ### 参考: #### 源码安装使用:https://www.cnblogs.com/jzcn/p/15205849.html 1. 启动服务器broker mosquitto -c /etc/mosquitto/mosquitto.conf.example 2. 订阅 mosquitto_sub -t temp 3. 发布 mosquitto_pub -t temp -m hello_world #### apt安装使用: https://www.cnblogs.com/guyk/p/12405938.html 0. 修改配置: sudo vim /etc/mosquitto/mosquitto.conf allow_anonymous false #禁止匿名登陆 password_file /etc/mosquitto/pwfile #用户密码注册文件 acl_file /etc/mosquitto/aclfile #权限管理文件 listener 1883 #关闭local模式 1. 添加用户: sudo mosquitto_passwd /etc/mosquitto/pwfile xuke 2. 配置权限: sudo vim /etc/mosquitto/aclfile 3. 启动服务: mosquitto -c /etc/mosquitto/mosquitto.conf -d 4. 订阅: mosquitto_sub -h localhost -t "test/#" -u user2 -P 123456 -i "client1" 5. 发布: mosquitto_pub -h localhost -t "test/abc" -u user1 -P 123456 -i "client3" -m "How are you?" #### 配置文件详解:https://zhuanlan.zhihu.com/p/400715220