rambo 7 meses atrás
pai
commit
8965b52561

+ 145 - 0
python/docs/socket命令.md

@@ -361,4 +361,149 @@ _(该命令用于单独自定义配置中某一项的单独调整测试,不进
 }
 ```
 
+
+
+#### 获取MCU其他设置信息
+<mark>以下操作需要连接设备且初始化<mark>
+* data:为null或其他值  后端忽略
+* type:
+    * 当该字段为get_mcu_other_info时,代表获取MCU其他设置信息
+##### 请求示例
+```python
+{
+    "data":null,
+    "type": "get_mcu_other_info"
+}
+```
+##### 响应示例
+* data:忽略
+* type:
+    * 当该字段为get_other_mcu_info,代表成功获取MCU其他设置信息
+<mark>以下数据包作为写入设备时对应得字段名称<mark>
+###### 成功状态
+```python
+{
+    "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其他设置信息
+<mark>以下操作需要连接设备且初始化<mark>
+* data:设置得数据包
+* type:
+    * 当该字段为set_mcu_other_info时,代表设置MCU其他设置信息
+##### 请求示例
+```python
+{
+    "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"
+}
+```
+##### 响应示例
+* data:忽略
+* type:
+    * 当该字段为get_other_mcu_info,代表成功获取MCU其他设置信息
+<mark>以下数据包作为写入设备时对应得字段名称<mark>
+###### 成功状态
+```python
+{
+    "code": 0,
+    "msg": "设置mcu其他配置信息成功",
+    "status": 2,
+    "data": null,
+    "msg_type": "set_mcu_other_info"
+}
+```
+
+
+#### 通过命令行发送设备指令
+<mark>以下操作需要连接设备且初始化<mark>
+* data:
+    * command:命令行指令,字符串“0x01 0x42 0x6C 0x6b”为前端默认展示得字符串值,写死即可
+* type:
+    * 当该字段为send_command时,代表设置通过命令行发送指令
+##### 请求示例
+```python
+{
+    "data": {
+        "command": "0x01 0x42 0x6C 0x6b"
+    },
+    "type": "send_command"
+}
+```
+##### 响应示例
+* data:
+    * command:收到的指令
+    * type:
+        * 为input时代表输入指令被转换成功,前端需要填充到发送命令得输入框中覆盖用户输入值;
+        * 为output时代表收到指令回复,前端需要填充到回复得文本展示框中;
+* type:
+    * 当该字段为send_command,代表成功获取到指令回复
+<mark>以下数据包作为写入设备时对应得字段名称<mark>
+###### 发送后指令转换
+```python
+{
+    "code": 0,
+    "msg": "命令发送完成",
+    "status": 2,
+    "data": {
+        "command": "0x01 0x42 0x6C 0x6B",
+        "type": "input"
+    },
+    "msg_type": "send_command"
+}
+```
+###### 接收到指令回复
+```python
+{
+    "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"
+}
+```
 ##### 未完待续.....

+ 34 - 10
python/mcu/DebugUart.py

@@ -1,19 +1,20 @@
 import os
 import time
 
-from lief import Object
-
+# from lief import Object
+import asyncio
 from collections import OrderedDict
 
 
-class DebugUart(Object):
+class DebugUart():
 
     def __init__(self, mcu):
-        super().__init__()
+        # super().__init__()
         self.mcu = mcu
         # 0x01 0x42 0x6C 0x6b
 
-    def set(self, text):
+    async def set(self, text):
+        await asyncio.sleep(0.1)
         #  1 0x42 0x6C 0x6b
         # text = self.ui.textEdit.toPlainText()
         # self.ui.textEdit_2.clear()
@@ -33,31 +34,54 @@ class DebugUart(Object):
             ]
             data = [int(x, 16) for x in data if x]
             buf.extend(data)
-            # text = " ".join([f"0x{x:02X}" for x in data])
+            text = " ".join([f"0x{x:02X}" for x in data])
+            self.mcu.msg_type = "send_command"
+            self.mcu.sendSocketMessage(
+                code=0,
+                msg="命令发送完成",
+                device_status=2,
+                data={"command": text, "type": "input"},
+            )
+            self.mcu.msg_type = "mcu"
             # self.ui.textEdit.setText(text)
             # # 刷新界面命令
             # QApplication.processEvents()
             self.mcu.add_send_data_queue(buf)
-            self.get()
+            loop = asyncio.get_event_loop()
+            loop.create_task(self.get(), name="sendCommand3")
         except BaseException as e:
             print("解析错误", e)
             pass
 
-    def get(self, *args):
-
+    async def get(self, *args):
+        await asyncio.sleep(0.1)
         self.mcu.last_from_mcu_move_respond_data = None
         _s = time.time()
         print("_s", _s)
         while 1:
-            time.sleep(0.1)
+            await asyncio.sleep(0.1)
             if time.time() - _s > 3:
                 return False
+            # print("last_from_mcu_move_respond_data 1", time.time() - _s)
+            # print(
+            #     "last_from_mcu_move_respond_data 2",
+            #     self.mcu.last_from_mcu_move_respond_data,
+            # )
             if self.mcu.last_from_mcu_move_respond_data is not None:
                 break
         receive_data = self.mcu.last_from_mcu_move_respond_data
         receive_data = receive_data[2:]
         print("<------------------get_from_mcu_move_respond_data")
         # self.ui.textEdit_2.setText(" ".join([hex(x) for x in receive_data]))
+        text = " ".join([hex(x) for x in receive_data])
+        self.mcu.msg_type = "send_command"
+        self.mcu.sendSocketMessage(
+            code=0,
+            msg="命令发送完成",
+            device_status=2,
+            data={"command": text, "type": "output"},
+        )
+        self.mcu.msg_type = "mcu"
         if len(receive_data) >= 37:
             # 锁定按键菜单 Lock 为 Disable(0x01 为 Enable);
             data = OrderedDict()

+ 110 - 1
python/mcu/DeviceControl.py

@@ -13,6 +13,9 @@ from .ProgramItem import ProgramItem
 from .capture.module_digicam import DigiCam
 from databases import insert_photo_records
 from .McuDeviationSet import McuDeviationSet
+from .OtherSet import OtherSet
+from .DebugUart import DebugUart
+
 # mcu命令
 class DeviceControl(BaseClass, metaclass=SingletonType):
     lock = threading.Lock()
@@ -21,6 +24,8 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
         super().__init__(websocket_manager)
         self.msg_type = "mcu"
         self.mcu_deviation_set = McuDeviationSet(self)
+        self.mcu_other_set = OtherSet(self)
+        self.debug_uart = DebugUart(self)
         self.m_t = 1
         # 0未开始  1进行中 2已结束  99异常
         self.action_state = 2
@@ -105,6 +110,52 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             92: self.get_from_mcu_move_respond_data,  # 获取MCU响应
             100: self.print_mcu_error_data,  # 打印下位机的错误内容
         }
+    async def sendCommand(self,command):
+        await asyncio.sleep(0.01)
+        loop = asyncio.get_event_loop()
+        loop.create_task(self.debug_uart.set(command), name="sendCommand2")
+    async def getMcuOtherInfo(self):
+        await asyncio.sleep(0.01)
+        self.get_other_info()
+    async def setMcuOtherInfo(self,data):
+        await asyncio.sleep(0.01)
+        for k, v in data.items():
+            print("k:{},v:{}".format(k, v))
+            data[k] = self.setOtherMaxMinValue(k, v)
+        self.set_to_mcu_other_info(data)
+        self.msg_type = "set_other_mcu_info"
+        self.sendSocketMessage(
+            code=0,
+            msg="设置mcu其他配置信息完成",
+            device_status=2,
+        )
+        self.msg_type = "mcu"
+
+    def setOtherMaxMinValue(self,item, value):
+        value = int(value)
+        parameter_limits = {
+            "is_auto_send_base_info": (0, 10000),
+            "is_move_retry": (0, 10000),
+            "is_data_response": (0, 10000),
+            "low_speed": (0, 10000),  # 假设低速范围是0到1000
+            "is_test": (0, 10000),
+            "to_init_mode": (0, 10000),
+            "turntable_move_to_init_mode": (0, 10000),  # 假设转盘通讯方式范围是0到3
+            "led_count": (0, 10000),  # 假设LED数量范围是0到10
+            "turntable_steering_angle_ratio": (0, 10000),  # 假设角度比例范围是0到100
+            "is_manual_check": (0, 10000),
+            "camera_steering_angle_ratio": (0, 100000),  # 假设角度比例范围是0到100
+            "is_auto_motor_to_disable": (0, 10000),
+            "diff_dir": (0, 10000),
+            "is_auto_send_pos_info": (0, 10000),
+            "is_dog": (0, 10000),
+            "has_been_set_motor_config": (0, 10000),
+        }
+
+        # 获取参数的最小值和最大值
+        min_value, max_value = parameter_limits.get(item, (0, 10000))
+        value = max(min_value, min(max_value, value))
+        return value
 
     async def initDevice(self,is_force=False):
         if not self.is_running:
@@ -341,6 +392,51 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             self.is_just_init_time = False
 
         return True
+
+    # 设置其他信息
+    def set_to_mcu_other_info(self, data):
+        is_auto_send_base_info = data["is_auto_send_base_info"]
+        is_move_retry = data["is_move_retry"]
+        is_data_response = data["is_data_response"]
+        low_speed = data["low_speed"]
+        is_test = data["is_test"]
+        to_init_mode = data["to_init_mode"]
+        turntable_move_to_init_mode = data["turntable_move_to_init_mode"]
+        led_count = data["led_count"]
+        turntable_steering_angle_ratio = data["turntable_steering_angle_ratio"]
+        is_manual_check = data["is_manual_check"]
+        camera_steering_angle_ratio = data["camera_steering_angle_ratio"]
+        is_auto_motor_to_disable = data["is_auto_motor_to_disable"]
+        diff_dir = data["diff_dir"]
+        is_auto_send_pos_info = data["is_auto_send_pos_info"]
+        is_dog = data["is_dog"]
+        has_been_set_motor_config = data["has_been_set_motor_config"]
+
+        buf = [self.command["set_other_info"]]
+        buf.extend(self.encapsulation_data(data=is_auto_send_base_info, len_data=1))
+        buf.extend(self.encapsulation_data(data=is_move_retry, len_data=1))
+        buf.extend(self.encapsulation_data(data=is_data_response, len_data=1))
+        buf.extend(self.encapsulation_data(data=low_speed, len_data=2))
+        buf.extend(self.encapsulation_data(data=is_test, len_data=1))
+        buf.extend(self.encapsulation_data(data=to_init_mode, len_data=1))
+        buf.extend(
+            self.encapsulation_data(data=turntable_move_to_init_mode, len_data=1)
+        )
+        buf.extend(self.encapsulation_data(data=led_count, len_data=2))
+        buf.extend(
+            self.encapsulation_data(data=turntable_steering_angle_ratio, len_data=2)
+        )
+        buf.extend(self.encapsulation_data(data=is_manual_check, len_data=1))
+        buf.extend(
+            self.encapsulation_data(data=camera_steering_angle_ratio, len_data=4)
+        )
+        buf.extend(self.encapsulation_data(data=is_auto_motor_to_disable, len_data=1))
+        buf.extend(self.encapsulation_data(data=diff_dir, len_data=1))
+        buf.extend(self.encapsulation_data(data=is_auto_send_pos_info, len_data=1))
+        buf.extend(self.encapsulation_data(data=is_dog, len_data=1))
+        buf.extend(self.encapsulation_data(data=has_been_set_motor_config, len_data=1))
+        self.add_send_data_queue(buf)
+
     def cleanAllReceiveData(self):
         while True:
             receive_data = self.serial_ins.read_cmd(out_time=1)
@@ -354,10 +450,14 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
             return False
         if not receive_data:
             return
-        # print("receive_data")
+        # print("receive_data", receive_data)
         # 数据 结构 command,按命令解析
         # command 0(9) 相机高度1-2  相机角度3-4  转盘角度5-6 灯光状态7  激光指示器状态8,运行状态9
         command = receive_data[0]
+        receive_data_temp = receive_data[2:]
+        receive_data_temp_text = " ".join([hex(x) for x in receive_data_temp])
+        print("command",command)
+        print("receive_data", receive_data_temp_text)
         if command in self.deal_code_func_dict:
             self.deal_code_func_dict[command](receive_data)
 
@@ -510,6 +610,7 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
 
     # 获取其他信息
     def get_from_mcu_other_info(self, receive_data):
+        # TODO  已完成设置
         is_auto_send_base_info = self.get_data_from_receive_data(
             receive_data=receive_data, start=1, len_data=1
         )
@@ -581,6 +682,14 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
         self.last_mcu_other_info_data["num"] += 1
         for k, v in self.last_mcu_other_info_data["data"].items():
             print("k:{},v:{}".format(k, v))
+        self.msg_type = "get_other_mcu_info"
+        self.sendSocketMessage(
+            code=0,
+            msg="获取mcu其他配置信息",
+            device_status=2,
+            data=self.last_mcu_other_info_data["data"],
+        )
+        self.msg_type = "mcu"
 
     def get_data_from_receive_data(
         self, receive_data, start, len_data, data_magnification=1

+ 241 - 0
python/mcu/OtherSet.py

@@ -0,0 +1,241 @@
+import threading
+
+import settings
+from collections import defaultdict
+import time
+from .McuDebug import McuDebug
+
+
+class OtherSet():
+    def __init__(self, mcu):
+        super().__init__()
+        self.mcu = mcu
+        self.get_value_flag = False
+        self.last_value = defaultdict(float)
+        self.mcu_debug = McuDebug(mcu, is_debug=True, is_deviation=False)
+        # self.ampy_run = None
+        # 自动获取数据
+        # QTimer.singleShot(500, self.get_data_from_mcu)
+
+    def get_data_from_mcu(self, *args):
+        self.get()
+
+    def init(self):
+        self.ui.is_auto_send_base_info.setMinimum(0)
+        self.ui.is_auto_send_base_info.setMaximum(10000)
+        self.ui.is_move_retry.setMinimum(0)
+        self.ui.is_move_retry.setMaximum(10000)
+        self.ui.is_data_response.setMinimum(0)
+        self.ui.is_data_response.setMaximum(10000)
+        self.ui.low_speed.setMinimum(0)
+        self.ui.low_speed.setMaximum(10000)
+        self.ui.is_test.setMinimum(0)
+        self.ui.is_test.setMaximum(10000)
+        self.ui.to_init_mode.setMinimum(0)
+        self.ui.to_init_mode.setMaximum(10000)
+        self.ui.turntable_move_to_init_mode.setMinimum(0)
+        self.ui.turntable_move_to_init_mode.setMaximum(10000)
+        self.ui.led_count.setMinimum(0)
+        self.ui.led_count.setMaximum(10000)
+        self.ui.turntable_steering_angle_ratio.setMinimum(0)
+        self.ui.turntable_steering_angle_ratio.setMaximum(10000)
+        self.ui.is_manual_check.setMinimum(0)
+        self.ui.is_manual_check.setMaximum(10000)
+        self.ui.camera_steering_angle_ratio.setMinimum(0)
+        self.ui.camera_steering_angle_ratio.setMaximum(100000)
+        self.ui.is_auto_motor_to_disable.setMinimum(0)
+        self.ui.is_auto_motor_to_disable.setMaximum(10000)
+        self.ui.diff_dir.setMinimum(0)
+        self.ui.diff_dir.setMaximum(10000)
+        self.ui.is_auto_send_pos_info.setMinimum(0)
+        self.ui.is_auto_send_pos_info.setMaximum(10000)
+        self.ui.is_dog.setMinimum(0)
+        self.ui.is_dog.setMaximum(10000)
+        self.ui.has_been_set_motor_config.setMinimum(0)
+        self.ui.has_been_set_motor_config.setMaximum(10000)
+        # 相机舵机
+        self.ui.camera_degree.setSingleStep(0.1)
+        self.ui.camera_degree.setMinimum(-90)
+        self.ui.camera_degree.setMaximum(90)
+        self.ui.camera_degree.valueChanged.connect(
+            lambda x: self.change_value(x, "相机舵机")
+        )
+
+        self.ui.set.clicked.connect(self.set)
+        self.ui.get.clicked.connect(self.get)
+        self.ui.init_mcu.clicked.connect(self.init_mcu)
+        self.ui.pushButton.clicked.connect(self.check_and_upload)
+        self.ui.pushButton_2.clicked.connect(self.stop_mcu)
+        # 设定相机舵机偏移量
+        self.ui.set_camera_degree.clicked.connect(
+            lambda *args: self.set_deviation("相机舵机")
+        )
+
+    def check_and_upload(self, *args):
+        try:
+            ampy_class = settings.PLUGINS_DICT["ampy_scribe"]["AMPY插件"]
+        except:
+            return
+        self.s = threading.Thread(
+            target=ampy_class(top_windows=self.windows, windows=self).run, args=()
+        )
+        self.s.start()
+
+    def stop_mcu(self, *args):
+        self.mcu.stop_mcu()
+
+    def send_log(self, text):
+        if self.mcu:
+            self.mcu.send_log(text)
+
+    # 写入文件测试
+    def init_mcu(self, *args):
+        self.mcu.to_init_device_origin_point(device_name="mcu", is_force=True)
+
+    def change_value(self, value, name):
+        value = round(value, 2)
+        if self.last_value[name] - 1 <= value <= self.last_value[name] + 1:
+            if name == "相机电机":
+                self.mcu_debug.camera_high_motor(value=value)
+            if name == "相机舵机":
+                self.mcu_debug.camera_steering(value=value)
+            if name == "转盘舵机":
+                self.mcu_debug.turntable_steering(value=value)
+            if name == "转盘前后电机":
+                self.mcu_debug.turntable_position_motor(value=value)
+            if name == "翻板舵机中位":
+                self.mcu_debug.overturn_steering(value=value)
+            if name == "翻板舵机高位":
+                self.mcu_debug.overturn_steering(value=value)
+            if name == "翻板舵机上升速度":
+                pass
+            print(value, name)
+        self.last_value[name] = value
+
+    def set_deviation(self, name, camera_steering_deviation):
+        if name == "相机舵机":
+            # 设定相机舵机偏移量
+            # camera_steering_deviation = self.ui.camera_degree.value()
+            device_name = "camera_steering"
+            self.mcu.set_deviation(
+                device_name=device_name, _type=0, deviation=camera_steering_deviation
+            )
+            # self.ui.camera_degree.setValue(0.0)
+
+    def setMcuInfo(self, data):
+        self.mcu.msg_type = "set_other_mcu_info"
+        if not self.get_value_flag:
+            self.mcu.sendSocketMessage(
+                code=1, msg="请先获取其他mcu配置信息", device_status=0, data=None
+            )
+            self.mcu.msg_type = "mcu"
+            return
+
+        # is_auto_send_base_info = data.get("is_auto_send_base_info")
+        # is_move_retry = data.get("is_move_retry")
+        # is_data_response = data.get("is_data_response")
+        # low_speed = data.get("low_speed")
+        # is_test = data.get("is_test")
+        # to_init_mode = data.get("to_init_mode")
+        # turntable_move_to_init_mode = data.get("turntable_move_to_init_mode")
+        # led_count = data.get("led_count")
+        # turntable_steering_angle_ratio = data.get("turntable_steering_angle_ratio")
+        # is_manual_check = data.get("is_manual_check")
+        # camera_steering_angle_ratio = data.get("camera_steering_angle_ratio")
+        # is_auto_motor_to_disable = data.get("is_auto_motor_to_disable")
+        # diff_dir = data.get("diff_dir")
+        # is_auto_send_pos_info = data.get("is_auto_send_pos_info")
+        # is_dog = data.get("is_dog")
+        # has_been_set_motor_config = data.get("has_been_set_motor_config")
+
+        # data = {
+        #     "is_auto_send_base_info": is_auto_send_base_info,
+        #     "is_move_retry": is_move_retry,
+        #     "is_data_response": is_data_response,
+        #     "low_speed": low_speed,
+        #     "is_test": is_test,
+        #     "to_init_mode": to_init_mode,
+        #     "turntable_move_to_init_mode": turntable_move_to_init_mode,
+        #     "led_count": led_count,
+        #     "turntable_steering_angle_ratio": turntable_steering_angle_ratio,
+        #     "is_manual_check": is_manual_check,
+        #     "camera_steering_angle_ratio": camera_steering_angle_ratio,
+        #     "is_auto_motor_to_disable": is_auto_motor_to_disable,
+        #     "diff_dir": diff_dir,
+        #     "is_auto_send_pos_info": is_auto_send_pos_info,
+        #     "is_dog": is_dog,
+        #     "has_been_set_motor_config": has_been_set_motor_config,
+        # }
+        self.mcu.set_to_mcu_other_info(data)
+        self.mcu.sendSocketMessage(code=0, msg="已完成设置", device_status=2, data=None)
+        print("已完成设置")
+        self.mcu.msg_type = "mcu"
+
+    def getMcuInfo(self, *args):
+        self.mcu.get_other_info()
+        _s = time.time()
+        last_num = self.mcu.last_mcu_other_info_data["num"]
+        print("_s", _s)
+        while 1:
+            time.sleep(0.1)
+            if time.time() - _s > 2:
+                return False
+            print(
+                "last_mcu_other_info_data  num",
+                self.mcu.last_mcu_other_info_data["num"],
+            )
+            if last_num < self.mcu.last_mcu_other_info_data["num"]:
+                data = self.mcu.last_mcu_other_info_data["data"]
+                print("获取中断", data)
+                break
+            # if self.mcu.last_mcu_other_info_data["time"] - _s > 0:
+            #     data = self.mcu.last_mcu_other_info_data["data"]
+            #     break
+        print("获取成功")
+        is_auto_send_base_info = data["is_auto_send_base_info"]
+        is_move_retry = data["is_move_retry"]
+        is_data_response = data["is_data_response"]
+        low_speed = data["low_speed"]
+        is_test = data["is_test"]
+        to_init_mode = data["to_init_mode"]
+        turntable_move_to_init_mode = data["turntable_move_to_init_mode"]
+        led_count = data["led_count"]
+        turntable_steering_angle_ratio = data["turntable_steering_angle_ratio"]
+        is_manual_check = data["is_manual_check"]
+        camera_steering_angle_ratio = data["camera_steering_angle_ratio"]
+        diff_dir = data["diff_dir"]
+        is_auto_send_pos_info = data["is_auto_send_pos_info"]
+        is_dog = data["is_dog"]
+        has_been_set_motor_config = data["has_been_set_motor_config"]
+
+        is_auto_motor_to_disable = data["is_auto_motor_to_disable"]
+        if is_auto_motor_to_disable is None:
+            is_auto_motor_to_disable = False
+        dataSend = {
+            "is_auto_send_base_info": is_auto_send_base_info,
+            "is_move_retry": is_move_retry,
+            "is_data_response": is_data_response,
+            "low_speed": low_speed,
+            "is_test": is_test,
+            "to_init_mode": to_init_mode,
+            "turntable_move_to_init_mode": turntable_move_to_init_mode,
+            "led_count": led_count,
+            "turntable_steering_angle_ratio": turntable_steering_angle_ratio,
+            "is_manual_check": is_manual_check,
+            "camera_steering_angle_ratio": camera_steering_angle_ratio,
+            "is_auto_motor_to_disable": is_auto_motor_to_disable,
+            "diff_dir": diff_dir,
+            "is_auto_send_pos_info": is_auto_send_pos_info,
+            "is_dog": is_dog,
+            "has_been_set_motor_config": has_been_set_motor_config,
+        }
+        self.get_value_flag = True
+        self.mcu.msg_type = "get_other_mcu_info"
+        self.mcu.sendSocketMessage(
+            code=0, msg="获取mcu其他配置信息", device_status=2, data=dataSend
+        )
+        self.mcu.msg_type = "mcu"
+
+    def __del__(self):
+        self.state = 2
+        self.t = None

+ 18 - 0
python/sockets/message_handler.py

@@ -151,6 +151,24 @@ async def handlerSend(
                 device_ctrl.set_deviation_cmd(value, action_name, "move"),
                 name="move_deviation",
             )
+        case "get_mcu_other_info":
+            device_ctrl = DeviceControl(websocket_manager=manager)
+            loop.create_task(
+                device_ctrl.getMcuOtherInfo(),
+                name="mcu_other_set_get",
+            )
+        case "set_mcu_other_info":
+            device_ctrl = DeviceControl(websocket_manager=manager)
+            loop.create_task(
+                device_ctrl.setMcuOtherInfo(data),
+                name="setMcuOtherInfo",
+            )
+        case "send_command":
+            device_ctrl = DeviceControl(websocket_manager=manager)
+            loop.create_task(
+                device_ctrl.sendCommand(data.get("command", None)),
+                name="sendCommand",
+            )
         case _:
             data = manager.jsonMessage(code=1, msg="未知消息")
             await manager.send_personal_message(data, websocket)