概述
轻松连系列设备支持串口通讯,可使用配套Micro-USB/Type-C数据线与电脑连接,通过PC端工具进行设置,也可通过串口工具进行配置。
若使用串口工具,请确认先打开串口,并采用以下串口设置参数:
- 波特率:115200,数据位:8,检验位:无,停止位:1
- 发送数据格式:字符串,接收数据格式:字符串。
设备支持大部分串口调试工具及SDK。
以下为设备相关信息读取操作接口
读取设备固件信息
请求数据:
{"command": "ReadProduct"}
成功返回如下:
{"ProductID":"ubibot-xxxxxx","SeriesNumber":"xxxxxx","Host":"api.ubibot.cn","Port":80,"backup_ip":"101.201.30.5","CHANNEL_ID":"xxxxx","USER_ID":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","USAGE":0,"dual_lan":x,"MAC":"xx:xx:xx:xx:xx:xx","apn":"CMIOT","user":"","pwd":"","firmware":"xxxx-xxx"}
读取设备WiFi配置信息
请求数据:
{"command": "ReadWifi"}
成功返回如下:
{"SSID":"xxxxxx","password":"xxxxxxx","type":"xx","channel":x,"dhcp":0,"ip":"xxx.xxx.xxx.xxx","mask":"xxx.xxx.xxx.xxx","gw":"xxx.xxx.xxx.xxx","dns1":"8.8.8.8"}
读取设备参数配置
请求数据:
{"command": "ReadMetaData"}
成功返回如下:
{"fn_th":xxx,"fn_light":xxx,"fn_mag":xxx,"fn_mag_int":xxx,"fn_acc_tap1":xxx,"fn_acc_tap2":xxx,"fn_acc_act":xxx,"fn_acc_min":xxx,"fn_bt":xxx,"fn_ext":xxx,"fn_battery":xxxx,"fn_dp":xxx,"cg_data_led":1}
具体metedata请参考设备配置参数
读取设备内部存储的感知数据
请求数据:
{"command": "ReadData"}
成功返回如下:
{"created_at":"2015-12-17T18:16:22Z","field1":0}……
读取设备最近错误代码
请求数据:
{"command": "GetLastError"}
成功返回如下:
{"c_srv_flr":1693382978,"api_gt_flr":1514764831,"mry_dt_err":1514764807,"pt_dt_flr":1693385224,"enet_cnt_err":1693288634,"scn_wf_flr":1514764929}
具体错误代码请参考设备错误指示说明
扫描设备周围WiFi网络信息
请求数据:
{"command": "ScanWifiList"}
成功返回如下:
{"SSID":"CF_9936","rssi":-68,"type":4,"BSSID":"d0:76:e7:bb:99:36"}
设备自检测试(用于调试检测设备内部元器件功能情况,需使用串口工具)
请求数据:
{"command": "CheckSensors"}
成功返回如下:
{"created_at":"2017-05-12T04:41:10Z","temp_val":32.132446,"humi_val":17,"light_val":767.359985,"power_vol_val":4.524133,"ssid":"m_work-GN","rssi":-37,"acce_xval":0,"acce_yval":0,"acce_zval":0,"mag_val":1,"ext_temp_val":65535}
以下为设备相关信息更改操作接口
清空设备内部存储的感知数据(过程将持续超过30秒)
请求数据:
{"command": "ClearData"}
成功返回如下:
{\"status\":0,\"code\": 0}
更改设备参数配置
请求数据:(其中”metadata”部分为设备设置进行JSON转译)
{"command":"SetMetaData","metadata":"{\"fn_th\":60,\"fn_light\":60,\"fn_mag\":120,\"fn_mag_int\":2,\"fn_acc_tap1\":0,\"fn_acc_tap2\":0,\"fn_acc_act\":0,\"fn_acc_min\":5,\"fn_bt\":120,\"fn_ext_t\":1480041854,\"fn_battery\":120,\"fn_dp\":120,\"cg_data_led\":\"on\"}"}
成功返回如下:
{\"status\":0,\"code\": 0x00}
设定设备WiFi接入点配置
请求数据:(其中type值为WiFi加密协议,支持WPA,WEP,OPEN三种方式)
{"command": "SetupWifi","SSID": "XXXXX","password": "XXXXX"}
成功返回如下:
{\"status\":0,\"code\": 0}
若您需要将设备配置直接连接到您私有化的服务器或平台,请与我们销售人员联系获取相关信息。