GemeOpen
写几行代码,就可以控制的智能设备!
86型智能门磁PUSH开关 S1-WiFi版开发者文档
产品型号:GSAW1B
产品概要信息
基本描述
一款支持远程控制且具备传统功能的PUSH开关,220V交流供电,自带12V直流输出给门禁供电,适配电磁门控制通断,支持MQTT协议与TCP协议二次开发
主要特点
产品图片
技术支持
企业微信扫一扫
武汉智鸟科技有限责任公司
企业官网:www.smart-bird.cn
服务热线:130-0715-9689
办公地址:湖北省武汉市高新大道光谷崇文中心B1栋1401、1409
控制采集
点动控制
controller-event-pulseTime
指令简介
远程控制设备的导通状态,指令执行后,设备立即导通PUSH和GND。(仅在自动模式下才能触发)
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"pulse" : 1,
"type" : "event"
}
"messageId" : "202201241610366046",
"pulse" : 1,
"type" : "event"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | pulse | int | 点动控制 ,固定传1 | 1 |
| 3 | type | String | 控制设备点动固定传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-event-pulseTime",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-event-pulseTime",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-event-pulseTime |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
获取设备基础信息
info-all
指令简介
获取设备信息一般会包含:设备通断电状态、MAC/IMEI、固件版本、设备内网IP地址、设备WIFI网络名称等信息,不同的产品返回的信息有所差异
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "info"
}
"messageId" : "202201241610366046",
"type" : "info"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 获取设备基本信息固定传"info" | info |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "info-all",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.0.85",
"mac" : "78EE4CFFD0A0",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.0.0",
"wifiLock" : 1
}
"commandName" : "info-all",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.0.85",
"mac" : "78EE4CFFD0A0",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.0.0",
"wifiLock" : 1
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | info-all |
| 2 | delayPowerOn | int | 通电延时时间,0-30秒 | 8 |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 4 | doorMode | int | 0 :常开 、1常闭 2 :自动 ,默认模式为:自动 | 0 |
| 5 | ip | String | 设备连接WIFI后获取的IP | 192.168.0.85 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 78EE4CFFD0A0 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 9 | source | String | 消息来源,自动上报“auto”,指令回复“command”,按键反馈“button” | command |
| 10 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 11 | type | String | 设备类型 | GSAM1B |
| 12 | version | String | 当前固件版本号 | 1.0.0 |
| 13 | wifiLock | int | 配网锁,0:关闭,1:开启 | 1 |
设备维护
重置设备
controller-reset
指令简介
恢复出厂设置后配网信息和自定义信息都会清空,请谨慎操作!
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "reset",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | system | String | 重置/恢复出厂设置默认填"reset" | reset |
| 3 | type | String | 固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-reset",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-reset |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
重启设备
controller-restart
指令简介
软重启后,通过指令设置的参数将生效,同时设备将重新连接Wifi/4G网络,注意设备IP地址可能发生变化
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
"messageId" : "202201241610366046",
"system" : "restart",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | system | String | 重启设备默认填"restart" | restart |
| 3 | type | String | 固定填"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "controller-restart",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | controller-restart |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
获取设备通讯信息
info-protocol
指令简介
获取当前设备与服务端交互的通信协议及协议配置参数,目前支持MQTT、TCP Client,设备出厂时默认接入GemeOpen厂家MQTT测试服务器,免费提供客户调试使用,如需接入自己的服务器或使用其他协议,请自行搭建服务器。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"type" : "protocol"
}
"messageId" : "202201241610366046",
"type" : "protocol"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | type | String | 获取设备通讯信息固定传"protocol" | protocol |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "admin",
"commandName" : "info-protocol",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
"clientId" : "admin",
"commandName" : "info-protocol",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | commandName | String | 指令名称 | info-protocol |
| 3 | messageId | String | 消息ID字段 | 202201241610366046 |
| 4 | port | String | 端口号 | 1883 |
| 5 | protocol | String | 协议类型 | mqtt |
| 6 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 7 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 8 | source | String | 指令回复“command" | command |
| 9 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 10 | username | String | 自定义服务器用户名 | username |
设置设备通电延时
setting-delayPowerOn
指令简介
设置点动控制后,门磁再次通电的时间,如设置5秒,按下面板或触发点动控制后,门磁5秒后才会通电,这时合上门磁才会吸合。
向设备发送指令
服务端向设备订阅topic发送消息
{
"delayPowerOn" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
"delayPowerOn" : 0,
"messageId" : "202201241610366046",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | delayPowerOn | int | 通电延时时间,0-30秒 | 0 |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | type | String | 固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-delayPowerOn",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.122.119
",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.2.3",
"wifiLock" : 0
}
"commandName" : "setting-delayPowerOn",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.122.119
",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.2.3",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-delayPowerOn |
| 2 | delayPowerOn | int | 通电延时时间,0-30秒 | 8 |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 4 | doorMode | int | 0 :常开 、1常闭 2 :自动 ,默认模式为:自动 | 0 |
| 5 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 9 | source | String | 指令回复“command" | command |
| 10 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 11 | type | String | 设备类型 | GSAM1B |
| 12 | version | String | 当前固件版本号 | 1.2.3 |
| 13 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
设置设备常开/常闭/自动模式
setting-doorMode
指令简介
设置模式为0及常开模式,门磁一直不吸合;设置模式为1及常闭模式,门磁一直吸合;设置模式为2及自动模式,门磁默认吸合状态,通过按动面板或点动控制触发门磁不吸合。
向设备发送指令
服务端向设备订阅topic发送消息
{
"doorMode" :2,
"messageId" : "202201241610366046",
"type" : "event"
}
"doorMode" :2,
"messageId" : "202201241610366046",
"type" : "event"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | doorMode | int | 0 :常开 、1常闭 2 :自动 ,默认模式为:自动 | 0 |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | type | String | 设备控制传"event" | event |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-doorMode",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
"commandName" : "setting-doorMode",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-doorMode |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | source | String | 指令回复“command" | command |
| 5 | success | boolean | 执行结果 | true |
自定义MQTT
setting-mqtt
指令简介
设备支持自定义MQTT,注意:在通过MQTT自定义MQTT信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "custom",
"username" : "username"
}
"clientId" : "admin",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"subcribe" : "/topic/qos1",
"type" : "custom",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | password | String | 密码 | 123456 |
| 4 | port | String | 端口号 | 1883 |
| 5 | protocol | String | 协议类型 | mqtt |
| 6 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 7 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 8 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 9 | type | String | 固定传"custom" | custom |
| 10 | username | String | 自定义服务器用户名 | username |
设备返回信息
设备向服务端订阅topic上报消息
{
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
"clientId" : "admin",
"commandName" : "setting-mqtt",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"password" : "123456",
"port" : "1883",
"protocol" : "mqtt",
"publish" : "/topic/qos0",
"server" : "192.168.0.66",
"source" : "command",
"subcribe" : "/topic/qos1",
"username" : "username"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | clientId | String | 自定义MQTT客户端ID注意:不可重复 | admin |
| 2 | commandName | String | 指令名称 | setting-mqtt |
| 3 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | password | String | 密码 | 123456 |
| 6 | port | String | 端口号 | 1883 |
| 7 | protocol | String | 协议类型 | mqtt |
| 8 | publish | String | 自定义发布主题 注意:不可重复 | /topic/qos0 |
| 9 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 10 | source | String | 指令回复“command" | command |
| 11 | subcribe | String | 自定义订阅主题,注意:不可重复 | /topic/qos1 |
| 12 | username | String | 自定义服务器用户名 | username |
清除已匹配遥控器
setting-remote-clear
指令简介
支持通过指令远程清除匹配遥控器。可一次性清除全部4个按键,也可单独清除指定按键。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"remoteMatch" : 2,
"remoteMatchKey" : "A",
"type" : "setting"
}
"messageId" : "20260520",
"remoteMatch" : 2,
"remoteMatchKey" : "A",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | remoteMatch | int | 1 开始匹配,0 取消匹配,2 清除已匹配数据 | 2 |
| 3 | remoteMatchKey | String | 单独清除指定按键:"A" "B" "C" "D"。不传或传空字符串 "" 表示清除全部 | A |
| 4 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-remote-clear",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"remoteMatched" : 1,
"remoteMatchKey" : "A",
"remoteMatchStep" : "",
"source" : "command",
"success" : true
}
"commandName" : "setting-remote-clear",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "20260520",
"remoteMatched" : 1,
"remoteMatchKey" : "A",
"remoteMatchStep" : "",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-remote-clear |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 5 | remoteMatched | int | int 遥控器匹配状态:0 未匹配,1 已匹配 | 1 |
| 6 | remoteMatchKey | String | 单独清除指定按键:"A" "B" "C" "D"。不传或传空字符串 "" 表示清除全部 | A |
| 7 | remoteMatchStep | String | 当前等待学习的按键:"A" "B" "C" "D",未在匹配模式为空字符串 "" | |
| 8 | source | String | 指令回复“command" | command |
| 9 | success | boolean | 执行结果 | true |
进入遥控器匹配模式
setting-remote-match
指令简介
支持通过指令远程匹配遥控器。可一次性学习全部4个按键,也可单独学习指定按键。设备进入匹配模式后,等待接收对应按键信号,学习成功后断电保存。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "20260520",
"remoteMatch" : 2,
"remoteMatchKey" : "A",
"type" : "setting"
}
"messageId" : "20260520",
"remoteMatch" : 2,
"remoteMatchKey" : "A",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | 20260520 |
| 2 | remoteMatch | int | 1 开始匹配,0 取消匹配,2 清除已匹配数据 | 2 |
| 3 | remoteMatchKey | String | 单独学习指定按键:"A" "B" "C" "D"。不传或传空字符串 "" 表示学习全部4个按键 | A |
| 4 | type | String | 固定传 "setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-remote-match",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "key C matched",
"remoteMatched" : 1,
"remoteMatchKey" : "A",
"remoteMatchStep" : "",
"source" : "auto",
"success" : true
}
"commandName" : "setting-remote-match",
"mac" : "2026bb16aa14",
"message" : "ok",
"messageId" : "key C matched",
"remoteMatched" : 1,
"remoteMatchKey" : "A",
"remoteMatchStep" : "",
"source" : "auto",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-remote-match |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 2026bb16aa14 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。 | key C matched |
| 5 | remoteMatched | int | int 遥控器匹配状态:0 未匹配,1 已匹配 | 1 |
| 6 | remoteMatchKey | String | 单独学习指定按键:"A" "B" "C" "D"。不传或传空字符串 "" 表示学习全部4个按键 | A |
| 7 | remoteMatchStep | String | 当前等待学习的按键:"A" "B" "C" "D",未在匹配模式为空字符串 "" | |
| 8 | source | String | 指令回复“command" | auto |
| 9 | success | boolean | 执行结果 | true |
自定义TCP
setting-tcp
指令简介
设备支持通过MQTT方式自定义TCP信息,注意:通过MQTT自定义TCP信息后,需要将设备断电重启或者向设备发送重启命令才可生效。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"server" : "192.168.0.66",
"type" : "custom"
}
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"server" : "192.168.0.66",
"type" : "custom"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | port | String | 端口号 | 1883 |
| 3 | protocol | String | 协议类型 | mqtt |
| 4 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 5 | type | String | 固定传"custom" | custom |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-tcp ",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"server" : "192.168.0.66",
"source" : "command"
}
"commandName" : "setting-tcp ",
"messageId" : "202201241610366046",
"port" : "1883",
"protocol" : "mqtt",
"server" : "192.168.0.66",
"source" : "command"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-tcp |
| 2 | messageId | String | 消息ID字段 | 202201241610366046 |
| 3 | port | String | 端口号 | 1883 |
| 4 | protocol | String | 协议类型 | mqtt |
| 5 | server | String | 自定义服务器地址 | 192.168.0.66 |
| 6 | source | String | 指令回复“command" | command |
设置WiFi账号
setting-wifi-config
指令简介
修改设备的 WiFi 连接信息(网络名称与密码),使设备连接至指定的 WiFi 网络。设备仅支持 2.4G WiFi(不支持 5G 频段),请确认目标网络为 2.4G。
向设备发送指令
服务端向设备订阅topic发送消息
{
"messageId" : "202201241610366046",
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
"messageId" : "202201241610366046",
"password" : "123456",
"ssid" : "GemeOpen",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | messageId | String | 消息ID字段 | 202201241610366046 |
| 2 | password | String | 密码 | 123456 |
| 3 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 4 | type | String | 固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-config",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-config |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
设置IP获取方式
setting-wifi-dhcpEnable
指令简介
配置设备的 IP 获取方式,设备出厂时IP获取方式默认为DHCP,静态 IP 需位于路由器网段内且未被占用,否则可能无法联网或冲突。
向设备发送指令
服务端向设备订阅topic发送消息
{
"dhcpEnable" : 1,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "202201241610366046",
"subnet" : "255.255.255.0",
"type" : "setting"
}
"dhcpEnable" : 1,
"dns" : "192.168.0.1",
"gateway" : "192.168.0.1",
"local_ip" : "192.168.0.118",
"messageId" : "202201241610366046",
"subnet" : "255.255.255.0",
"type" : "setting"
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 2 | dns | String | DNS服务器地址 | 192.168.0.1 |
| 3 | gateway | String | 默认网关 | 192.168.0.1 |
| 4 | local_ip | String | IP地址 | 192.168.0.118 |
| 5 | messageId | String | 消息ID字段 | 202201241610366046 |
| 6 | subnet | String | 子网掩码 | 255.255.255.0 |
| 7 | type | String | 设备设置固定传"setting" | setting |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
"commandName" : "setting-wifi-dhcpEnable",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-dhcpEnable |
| 2 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 3 | message | String | 执行返回结果 | ok |
| 4 | messageId | String | 消息ID字段 | 202201241610366046 |
| 5 | source | String | 指令回复“command" | command |
| 6 | success | boolean | 执行结果 | true |
设置WiFi配网锁
setting-wifi-lock
指令简介
wifi配网锁定后,设备无法通过长按配网按钮进入配网操作,仅能通过MQTT/TCP协议解锁配网功能
向设备发送指令
服务端向设备订阅topic发送消息
{
"type" : "setting",
"wifiLock" : 0
}
"type" : "setting",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | type | String | 设备设置固定传"setting" | setting |
| 2 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |
设备返回信息
设备向服务端订阅topic上报消息
{
"commandName" : "setting-wifi-lock",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.122.119
",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.2.3",
"wifiLock" : 0
}
"commandName" : "setting-wifi-lock",
"delayPowerOn" : 8,
"dhcpEnable" : 1,
"doorMode" : 0,
"ip" : "192.168.122.119
",
"mac" : "4CEBD60BFD62",
"messageId" : "202201241610366046",
"signal" : -75,
"source" : "command",
"ssid" : "GemeOpen",
"type" : "GSAM1B",
"version" : "1.2.3",
"wifiLock" : 0
}
字段属性
| # | 字段名称 | 字段类型 | 字段说明 | 示例值 |
|---|---|---|---|---|
| 1 | commandName | String | 指令名称 | setting-wifi-lock |
| 2 | delayPowerOn | int | 通电延时时间,0-30秒 | 8 |
| 3 | dhcpEnable | int | 自动寻址1:开启, 0:关闭,默认开启 | 1 |
| 4 | doorMode | int | 0 :常开 、1常闭 2 :自动 ,默认模式为:自动 | 0 |
| 5 | ip | String | 设备连接WIFI后获取的IP | 192.168.122.119 |
| 6 | mac | String | wifi设备MAC地址或4G设备的IMEI号,唯一标识 | 4CEBD60BFD62 |
| 7 | messageId | String | 消息ID字段 | 202201241610366046 |
| 8 | signal | int | 信号强度,显示规则为: signal<= 0 && signal>= -50 //信号最好 signal< -50 && signal>= -70 //信号较好 signal< -70 && signal>= -80 //信号一般 signal<-80 && signal>= -100 //信号较差 signal没有在0~(-100)之间,表示无信号 | -75 |
| 9 | source | String | 指令回复“command" | command |
| 10 | ssid | String | 设备当前连接的WIFI名称 | GemeOpen |
| 11 | type | String | 设备类型 | GSAM1B |
| 12 | version | String | 当前固件版本号 | 1.2.3 |
| 13 | wifiLock | int | 配网锁,0:关闭,1:开启 | 0 |









