夜无涯
## 连接mqtt 服务器
### 下载mqtt客户端软件
https://github.com/thomasnordquist/MQTT-Explorer/releases/download/v0.4.0-beta.6/MQTT-Explorer-Setup-0.4.0-beta.6.exe
使用上面链接下载并安装，如果发现速度过慢，可以找我发你下载好的安装包
### 配置参数连接服务器
按图示顺序操作，参数保持一致

![[Pasted image 20240518090635.png]]
## 控制指令发送
### 机库指令topic  确认
**高塘机库**
```sh
thing/product/7CTDM1L00B1N1P/services
```
其中7CTDM1L00B1N1P是高塘机库的序列号，如果需要控制其他机库，需要修改机库序列号为其他机库的序列号。
### 消息发送
![[Pasted image 20240518084818.png]]
按照图示操作，填入topic 和消息内容之后点击发送即可。
推流画质调整，直接发送相应指令即可，不需要进入远程调试模式
无人机开关机 消息发送顺序。
具体消息内容看最后部分
1 打开远程调试模式  
2 等待两秒  
3 无人机开机
4 等机库状态变成在线
5 无人机关机 
6 关闭远程模式
### 消息内容

**打开远程调试模式**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "debug_mode_open",
  "data": null
}
```
**无人机开机**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "drone_open",
  "data": null
}
```
**无人机关机**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "drone_close",
  "data": null
}
```
**关闭远程模式**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "debug_mode_close",
  "data": null
}
```
**打开增强图传**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "sdr_workmode_switch",
  "data": {
    "link_workmode": 1
  }
}
```
**机库重启**
```json
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "device_reboot",
  "data": null
}
```
### 升级固件


```json 
{
  "bid": "21c0f053-53f0-4e12-bcfc-eab208f04b48",
  "tid": "c3b76b2a-49d6-48b2-82db-bcf69e24d1d8",
  "timestamp": 1714372584862,
  "method": "ota_create",
  "data": {
    "devices": [
      {
        "file_name": "M3TD_10.01.16.07_pro.zip",
        "file_size": 407771084,
        "file_url": "https://test.minio.aihang.cn/aihang/firmware/M3TD_10.01.16.07_pro.zip",
        "firmware_upgrade_type": 2,
        "md5": "568dafc36d5403b578f9241c5e118a45",
        "product_version": "10.01.1607",
        "sn": "1581F6Q8D242U00CQ97P"
      },
      {
        "file_name": "DOCK2_10.01.16.07_pro.zip",
        "file_size": 485806750,
        "file_url": "https://test.minio.aihang.cn/aihang/firmware/DOCK2_10.01.16.07_pro.zip",
        "firmware_upgrade_type": 2,
        "md5": "ad116e1251f565b61c7553efb0e61cae",
        "product_version": "10.01.1607",
        "sn": "7CTDM1L00B1N1P"
      }
    ]
  }
}
```

### 推流画质更改
推流画质更改不需要打开远程调试模式。
**内容**
*其中7CTDM6F00BPE12 是机库序列号需要根据机库替换*
1 是最低画质  4是最高画质
```json
{
  "data": {
    "video_quality": 1,
    "video_id": "7CTDM6F00BPE12/165-0-7/normal-0"
  },
  "method": "live_set_quality",
  "tid": "43c16d7d-de77-445b-9f0f-000b1d0e9d53",
  "bid": "7b0e2914-040b-4bb7-a9a7-9d6c36448ecc",
  "timestamp": 1724113520310
}
```