* 本地: ws://10.56.42.176:7074/ws
* 打包后: ws://127.0.0.1:7074/ws
{
"code": 0,
"msg": "开始识别接口:COM8",
"status": 1,
"data": {
"_type": "show_info",
"plugins_mode": "auto_select_com",
"data": {
"text": "开始识别接口:COM8"
}
},
"msg_type": "mcu"
}
{"data": null, "type": "connect_mcu"}
以下操作前必须保证设备已连接!!!
目前连接设备后,后端会自动进行设备初始化操作,如无特殊需求可忽略
(该命令用于单独自定义配置中某一项的单独调整测试,不进行任何存储操作) 遥控器得拍照命令需要由后端转发到前端,再由前端将消息转发给后端对应得拍照命令
当蓝牙遥控器点击拍照后,后端消息响应如下:
注:在多次按下拍照按钮时,前端需要在命令发送给后端时且拍照未完成之前处理拦截操作,否则会出现拍照任务在不断执行
注意:当前响应可能会出现失败得情况,如:用户清空了所有货号数据;用户未打开拍照软件等其他错误消息响应;前端需要判断code是否为0;去释放拦截
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
以下操作需要连接设备且初始化
当通过物理遥控器按键停止拍摄时,会收到以下消息,前端需要把上方的【停止拍摄】消息转发给后端即可
以下操作需要连接连接相机并拉起smartshooter5软件
如果相机未连接可能data参数为空,需要注意判断 msg_type:详情图处理固定为[detail_progress]
以下为消息发送得示例 msg_type:详情图处理固定为[segment_progress]
以下为消息发送得示例 msg_type:详情图处理固定为[upload_goods_progress]
以下为消息发送得示例 msg_type:固定为[get_mcu_info] state_overturn_steering:翻板状态 msg_type:固定为[get_dynamic_config]
以下为消息发送得示例 响应示例-成功
注意,前端需要遍历data中的数据进行渲染设置栏,并且需要注意readonly属性,如果为true则代表该参数不可修改 msg_type:固定为[set_dynamic_config]
以下为消息发送得示例 响应示例-成功初始化mcu设备
请求示例
{"data": null, "type": "init_mcu"}
单独控制设备得某一个功能运行命令
请求示例
{
"data": {
"device_name": "camera_high_motor",
"value": 200
},
"type": "control_mcu"
}
执行拍摄任务
请求示例
{
"data": {
"action": "执行左脚程序",
"goods_art_no": "1234556"
},
"type": "run_mcu"
}
执行拍摄任务命令发送完成后-服务端响应消息
响应示例
{
"msg": "MCU 命令已发送完成",
"data": {
"image_counts": 4,
"goods_art_no": "1234556",
"action_names": [
"俯视",
"侧视",
"后跟",
"鞋底",
"内里"
],
"current_time": "年月日时分秒"
},
"msg_type": "image_process"
}
单张照片拍照完成后-服务端响应消息
响应示例-单个任务拍照成功(前端需要刷新列表)
{
"code": 0,
"msg": "拍鞋底 执行完成~",
"status": 2,
"data": null,
"msg_type": "photo_take"
}
响应示例-单个任务拍照失败
{
"code": 1,
"msg": "拍鞋底 执行失败~",
"status": 2,
"data": null,
"msg_type": "photo_take"
}
响应示例-整体任务拍照完成
{
"code": 1,
"msg": "执行左脚程序 执行成功~",
"status": 2,
"data": null,
"msg_type": "photo_take_finish"
}
接收遥控器扫码货号动作处理
消息示例
{
"code": 0,
"msg": "准备执行[左脚程序]",
"status": 2,
"data": {
"data": {
"action": "执行左脚程序",
"goods_art_no": "货号信息",
},
"type": "run_mcu",
},
"msg_type": "blue_tooth_scan"
}
接收遥控器点击拍照事件处理
消息示例
{
"code": 0,
"msg": "处理单拍消息",
"status": -1,
"data": {
"type": "handler_take_picture",
"data": null
},
"msg_type": "handler_take_picture"
}
单拍任务命令
发送-消息示例
{
"type": "handler_take_picture",
"data": null
}
响应-消息示例
{
"code": 0,
"msg": "执行左脚程序 执行完成~",
"status": 2,
"data": {"goods_art_no": "执行货号"},
"msg_type": "photo_take"
}
修改配置-独立操作MCU
请求示例
{
"data": {
"camera_height": 300,
"after_delay": 1,
"camera_angle": 20,
"led_switch": true,
"number_focus": 1,
"id": 0,
"take_picture": false,
"mode_type": "执行左脚程序",
"turntable_position": 200,
"action_name": "侧视图",
"turntable_angle": 300,
"shoe_upturn": false,
"action_index": 1,
"pre_delay": 1
},
"type": "run_mcu_single"
}
响应示例
当 msg_type 为run_mcu_single时,代表独立执行MCU设备完成,前端将此命令作为完成依据
{
"code": 0,
"msg": "执行完成",
"status": 2,
"data": null,
"msg_type": "run_mcu_single_finish"
}
设备调平-获取
请求示例
{
"data": {
},
"type": "get_deviation"
}
响应示例
{
"code": 0,
"msg": "接收偏移量信息",
"status": 2,
"data": {
"camera_high_motor_deviation": 10,
"camera_steering_deviation": 0.0,
"turntable_steering_deviation": 0.0,
"overturn_steering_middle": 109.0,
"overturn_steering_high": 150.0,
"overturn_steering_up_speed": 2,
"overturn_steering_down_speed": 4,
"turntable_front_end_deviation": 300
},
"msg_type": "get_deviation_data"
}
设备调平-设置
请求示例
{
"data": {
"value": 10,
"action_name": "相机电机",
"type": "move"
},
"type": "set_deviation"
}
响应示例
成功状态
{
"code": 0,
"msg": "相机电机 设置成功",
"status": 2,
"data": {},
"msg_type": "set_deviation"
}
失败状态
{
"code": 1,
"msg": "设置参数有误,请检查",
"status": 0,
"data": {},
"msg_type": "set_deviation"
}
获取MCU其他设置信息
请求示例
{
"data": null,
"type": "get_mcu_other_info"
}
响应示例
成功状态
{
"code": 0,
"msg": "获取mcu其他配置信息",
"status": 2,
"data": {
"is_auto_send_base_info": 0,
"is_move_retry": 0,
"is_data_response": 0,
"low_speed": 300,
"is_test": 0,
"to_init_mode": 1,
"turntable_move_to_init_mode": 0,
"led_count": 20,
"turntable_steering_angle_ratio": 356,
"is_manual_check": 1,
"camera_steering_angle_ratio": 50174,
"is_auto_motor_to_disable": 1,
"diff_dir": 0,
"is_auto_send_pos_info": 0,
"is_dog": 0,
"has_been_set_motor_config": 1
},
"msg_type": "get_other_mcu_info"
}
设置MCU其他设置信息
请求示例
{
"data": {
"is_auto_send_base_info": 0,
"is_move_retry": 0,
"is_data_response": 0,
"low_speed": 300,
"is_test": 0,
"to_init_mode": 1,
"turntable_move_to_init_mode": 0,
"led_count": 20,
"turntable_steering_angle_ratio": 356,
"is_manual_check": 1,
"camera_steering_angle_ratio": 50174,
"is_auto_motor_to_disable": 1,
"diff_dir": 0,
"is_auto_send_pos_info": 0,
"is_dog": 0,
"has_been_set_motor_config": 1
},
"type": "set_mcu_other_info"
}
响应示例
成功状态
{
"code": 0,
"msg": "设置mcu其他配置信息成功",
"status": 2,
"data": null,
"msg_type": "set_mcu_other_info"
}
通过命令行发送设备指令
请求示例
{
"data": {
"command": "0x01 0x42 0x6C 0x6b"
},
"type": "send_command"
}
响应示例
发送后指令转换
{
"code": 0,
"msg": "命令发送完成",
"status": 2,
"data": {
"command": "0x01 0x42 0x6C 0x6B",
"type": "input"
},
"msg_type": "send_command"
}
接收到指令回复
{
"code": 0,
"msg": "命令发送完成",
"status": 2,
"data": {
"command": "0xa8 0x12 0x4 0x14 0x14 0x24 0x24 0x4 0x4 0x15 0x14 0x14 0x64 0x4 0xc5 0x4 0xb6 0x84 0x1b 0x42 0x0 0x7 0x0 0x1 0x0 0x1 0x0 0x8 0x4 0x4c 0x4 0xb0 0x0 0x3 0x6b",
"type": "output"
},
"msg_type": "send_command"
}
执行重拍操作
请求示例
{
"data": {"record_id": 1},
"type": "re_take_picture"
}
停止拍摄
请求示例
{
"data": null,
"type": "stop_action"
}
{
"code": 0,
"msg": "停止执行组合动作",
"status": -1,
"data": {
"type": "stop_action",
"data": null
},
"msg_type": "stop_action"
}
使用smart shooter进行相机控制
获取相机是否连接
请求示例
{
"data": {},
"type": "smart_shooter_getinfo"
}
响应示例-连接成功
发送后指令转换
{
"code": 0,
"msg": "相机已连接",
"status": 2,
"data": null,
"msg_type": "smart_shooter_getinfo"
}
响应示例-连接失败
发送后指令转换
{
"code": 0,
"msg": "相机未连接",
"status": -1,
"data": null,
"msg_type": "smart_shooter_getinfo"
}
启动/关闭预览
请求示例
{
"data": {"value": false},
"type": "smart_shooter_enable_preview"
}
响应示例-启动预览
{
"code": 0,
"msg": "预览启用成功",
"status": 2,
"data": null,
"msg_type": ""
}
响应示例-关闭预览
{
"code": 0,
"msg": "预览关闭成功",
"status": 2,
"data": null,
"msg_type": ""
}
拍照
请求示例
{
"data": {},
"type": "smart_shooter_photo_take"
}
响应示例-拍照成功
{
"code": 0,
"msg": "拍照成功",
"status": 2,
"data": null,
"msg_type": ""
}
响应示例-照片获取成功
{
"code": 1,
"msg": "照片获取成功",
"data": {
"photo_file_name": "C:\\Users\\15001\\Pictures\\Smart Shooter 5\\SSP_45.JPG"
},
"msg_type": "smart_shooter_photo_take"
}
获取相机属性-ISO等相关信息
请求示例
{
"data": {},
"type": "smart_shooter_get_camera_property"
}
响应示例-获取成功
{
"code": 0,
"msg": "操作成功",
"status": 2,
"data": [
{
"CameraPropertyType": "Aperture",
"CameraPropertyValue": "22",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"4",
"4.5",
"5.0",
"5.6",
"6.3",
"7.1",
"8",
"9",
"10",
"11",
"13",
"14",
"16",
"18",
"20",
"22",
"25"
]
},
{
"CameraPropertyType": "ShutterSpeed",
"CameraPropertyValue": "1/125",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"Bulb",
"30",
"25",
"20",
"15",
"13",
"10",
"8",
"6",
"5",
"4",
"3.2",
"2.5",
"2",
"1.6",
"1.3",
"1",
"0.8",
"0.6",
"0.5",
"0.4",
"0.3",
"1/4",
"1/5",
"1/6",
"1/8",
"1/10",
"1/13",
"1/15",
"1/20",
"1/25",
"1/30",
"1/40",
"1/50",
"1/60",
"1/80",
"1/100",
"1/125",
"1/160",
"1/200",
"1/250",
"1/320",
"1/400",
"1/500",
"1/640",
"1/800",
"1/1000",
"1/1250",
"1/1600",
"1/2000",
"1/2500",
"1/3200",
"1/4000"
]
},
{
"CameraPropertyType": "ISO",
"CameraPropertyValue": "6400",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"AUTO",
"100",
"200",
"400",
"800",
"1600",
"3200",
"6400",
"12800"
]
},
{
"CameraPropertyType": "Exposure",
"CameraPropertyValue": "0.0",
"CameraPropertyIsWriteable": false,
"CameraPropertyRange": [
"0.0"
]
},
{
"CameraPropertyType": "Quality",
"CameraPropertyValue": "JPEG Fine Large",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"JPEG Fine Large",
"JPEG Normal Large",
"JPEG Fine Medium",
"JPEG Normal Medium",
"JPEG Fine Small1",
"JPEG Normal Small1",
"JPEG Fine Small2",
"JPEG Fine Small3",
"RAW + JPEG Fine Large",
"RAW"
]
},
{
"CameraPropertyType": "ProgramMode",
"CameraPropertyValue": "Manual",
"CameraPropertyIsWriteable": false,
"CameraPropertyRange": [
"Manual"
]
},
{
"CameraPropertyType": "MeteringMode",
"CameraPropertyValue": "Spot",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"Evaluative",
"Partial",
"Spot",
"Center Weighted"
]
},
{
"CameraPropertyType": "FocusMode",
"CameraPropertyValue": "MF",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"AF Single",
"AF Auto",
"AF Continuous",
"MF"
]
},
{
"CameraPropertyType": "DriveMode",
"CameraPropertyValue": "Continuous",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"Single Frame",
"Continuous",
"10s Timer",
"2s Timer",
"10s Timer Continuous"
]
},
{
"CameraPropertyType": "WhiteBalance",
"CameraPropertyValue": "Cloudy",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"AUTO",
"Daylight",
"Shade",
"Cloudy",
"Tungsten",
"Fluorescent",
"Flash",
"Manual"
]
},
{
"CameraPropertyType": "ColourTemperature",
"CameraPropertyValue": "",
"CameraPropertyIsWriteable": false,
"CameraPropertyRange": []
},
{
"CameraPropertyType": "Storage",
"CameraPropertyValue": "Disk",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"Card",
"Disk",
"Both",
"JPEG"
]
},
{
"CameraPropertyType": "MirrorLockup",
"CameraPropertyValue": "Off",
"CameraPropertyIsWriteable": true,
"CameraPropertyRange": [
"Off",
"On"
]
},
{
"CameraPropertyType": "PixelShiftMode",
"CameraPropertyValue": "",
"CameraPropertyIsWriteable": false,
"CameraPropertyRange": []
},
{
"CameraPropertyType": "ControlMode",
"CameraPropertyValue": "",
"CameraPropertyIsWriteable": false,
"CameraPropertyRange": []
}
],
"msg_type": "smart_shooter_get_camera_property"
}
获取详情图处理接口中的[详情页模板]执行进度信息
{
"code": 0,
"msg": "开始处理详情",
"status": 2,
"data": {
"goods_no": "B41135",
"temp_name": "huilima-1",
"status": "进行中",
"goods_art_nos": [
"B411351"
]
},
"msg_type": "detail_progress"
}
{
"code": 0,
"msg": "正在生成详情页切片",
"status": 2,
"data": {
"goods_no": "B41135",
"temp_name": "huilima-1",
"status": "进行中"
},
"msg_type": "detail_progress"
}
{
"code": 0,
"msg": "正在生成详情拼接图",
"status": 2,
"data": {
"goods_no": "B41135",
"temp_name": "huilima-1",
"status": "进行中"
},
"msg_type": "detail_progress"
}
{
"code": 0,
"msg": "详情页生成完成",
"status": 2,
"data": {
"goods_no": "B41135",
"temp_name": "huilima-1",
"status": "已完成"
},
"msg_type": "detail_progress"
}
获取详情图处理接口中的[抠图]执行进度信息
{
"code": 0,
"msg": "开始处理抠图",
"status": 2,
"data": {
"status": "进行中",
"goods_art_nos": [
"AQN1411322",
"B411351"
]
},
"msg_type": "segment_progress"
}
{
"code": 0,
"msg": "抠图结束",
"status": 2,
"data": {
"status": "已完成",
"goods_art_nos": [
"AQN1411322",
"B411351"
]
},
"msg_type": "detail_progress"
}
获取详情图处理接口中的[上传商品到第三方]执行进度信息
{
"code": 0,
"msg": "开始上传商品数据",
"data": {
"status": "进行中",
"online_stores": [
"拼多多",
"天猫"
]
},
"msg_type": "upload_goods_progress"
}
{
"code": 0,
"msg": "商品上传第三方成功",
"data": {
"status": "已完成",
"online_stores": [
"拼多多",
"天猫"
]
},
"msg_type": "upload_goods_progress"
}
发送独立抠图命令任务
请求示例
{
"type": "segment_progress",
"data": {
"token": "",
"uuid": "",
"goods_art_no": []
}
}
响应示例-成功
{
"code": 0,
"msg": "开始处理抠图",
"status": 2,
"data": {
"status": "进行中",
"goods_art_nos": [
"AQN1411322",
"B411351"
]
},
"msg_type": "segment_progress"
}
{
"code": 0,
"msg": "抠图结束",
"status": 2,
"data": {
"status": "已完成",
"goods_art_nos": [
"AQN1411322",
"B411351"
]
},
"msg_type": "segment_progress"
}
响应示例-失败-异常
{
"code": 1,
"msg": "异常输出得错误内容",
"status": 2,
"data": null,
"msg_type": "segment_progress"
}
发送获取设备状态命令
{
"type": "get_mcu_info",
"data": null
}
响应示例-成功
{
"code": 0,
"msg": "获取mcu设备运行状态信息",
"status": 2,
"data": {
"_type": "show_mcu_info",
"plugins_mode": "mcu",
"data": "激光状态;1,相机高度状态:2,相机角度状态:2,转盘状态:2,转盘前后移动状态:2,翻板状态:2,flag:52",
"data_state": {
"state_camera_motor": 2,
"state_camera_steering": 2,
"state_turntable_steering": 2,
"state_overturn_steering": 2,
"state_move_turntable_steering": 2
}
},
"msg_type": "get_mcu_info"
}
增加参数设置页面(给设备设置其他动态参数)-批量获取动态参数
{
"data": {
},
"msg_type": "get_dynamic_config"
}
{
"code": 0,
"msg": "成功",
"data": {
"camera_high_motor_target_value": {
"addr": 3,
"tips": "升降机当前位置",
"readonly": true,
"type": "float",
"precision": 1,
"value": "0.0"
}
}}
增加参数设置页面(给设备设置其他动态参数)-设置对应项动态参数
{
"data": {
"addr": 113,
"tips": "转盘转速比",
"readonly": false,
"type": "float",
"precision": 1,
"value": "38.6"
},
"msg_type": "set_dynamic_config"
}
{
"code": 0,
"msg": "成功",
"data": {
"status": true
}
}
未完待续.....