- config/config.yaml
- docker/cqhttp/cqconf/config.yml
- docker/mosquitto/mosquitto.conf
git clone https://github.com/Diam2023/IOTServer
cd docker
docker compose run *
# use -d if need
# docker compose stop
Request
- MySQL (MariaDB)
- Redis
- yaml-cpp
yay -S yaml-cppsudo apt install libyaml-cpp-devyay -S qt5-mqttgit clone -b 5.12.3 git://code.qt.io/qt/qtmqtt.git qtmqtt
cd qtmqtt
mkdir build
cd build
qmake ..
make
sudo make install
https://github.com/drogonframework/drogon/wiki/ENG-02-Installation
yay -S drogongit clone https://github.com/drogonframework/drogon
cd drogon
./buildhttps://github.com/drogonframework/drogon/wiki/ENG-02-Installation
yay -S drogongit clone https://github.com/drogonframework/drogon
cd drogon
./buildAll Command: config/config.yaml:240
Or send "help" to Bot
| command | action |
|---|---|
| 登入{usr} {pwd} | LoginAPI |
| 登出 | LogoutAPI |
| 添加设备{name} {sn} | |
| 删除设备{name} | |
| 查看所有设备 | |
订阅设备{name} {topic} |
|
取消订阅{name} {topic} |
|
| 查看所有订阅消息 | |
| 查看所有设备别名 | |
| 设备别名{name} | |
| 添加别名{name} | |
| 删除别名{name} |
定义操作 {操作名} {设备名/别名} {subtopic} {JSON数据}
It will publish JSON data to device topic When call {操作名}
| command | announcement |
|---|---|
| 定义操作{} | |
| 删除操作{操作名} |
root dir
/api/
base dir
user/
| Path | Request Type | Request Body | Header | Status | Response Body |
|---|---|---|---|---|---|
| register | PUT | { "user_name": "", "user_password": ""} |
NAN | 200 Successful 500 |
|
| login | POST | { "key": "name/id", "pwd": "pwd" } |
NAN | 203 Need Authorize 200 Successful 401 |
|
| info | GET | NAN | Authorization: token | 203 Need Authorize 200 Successful 401 400 |
|
| logout | DELETE | NAN | Authorization: token | 200 Successful 500 |
base dir
device/
| Path | Request Type | Request Body | Header | Status | Response Body |
|---|---|---|---|---|---|
| new | PUT | { "device_sn": "DTESTSNDATA", "device_name": "TD", "device_comment": "TestComment", "target_permission_level": 1} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| delete | DELETE | { "device_sn": "DTESTSNDATA"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| info | GET | { "device_sn": "DTESTSNDATA"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| all | GET | NAN | Authorization: token | 203 Need Authorize 200 Successful 500 |
|
base dir
subscribe/
| Path | Request Type | Request Body | Header | Status | Response Body |
|---|---|---|---|---|---|
| new | PUT | { "device_sn": "TESESNDDT", "topic": "TestTopic"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| delete | DELETE | { "device_sn": "TESESNDDT", "topic": "TestTopic"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| all | GET | NAN | Authorization: token | 203 Need Authorize 200 Successful 500 |
|
base dir
alias/
| Path | Request Type | Request Body | Header | Status | Response Body |
|---|---|---|---|---|---|
| new | PUT | { "device_sn": "DTESTSNDATA", "alias": "testAlias"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| delete | DELETE | { "alias": "MyRoom"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| all | GET | NAN | Authorization: token | 203 Need Authorize 200 Successful 500 |
|
base dir
action/
| Path | Request Type | Request Body | Header | Status | Response Body |
|---|---|---|---|---|---|
| new | PUT | { "action_name": "TA1", "device_sn": "TESESNDDT", "topic_name": "testTopic1", "action_json": {...}} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| delete | DELETE | { "action_name": "TA1"} |
Authorization: token | 203 Need Authorize 200 Successful 400 Request Body Err 500 |
|
| all | GET | NAN | Authorization: token | 203 Need Authorize 200 Successful 500 |
|
| call | PUT | { "action": "TA1"} |
Authorization: token | 203 Need Authorize 200 Successful 404 |
NAN |
- Mysql
- Redis
- mosquitto