使用python进行串口通讯,下载cfg文件,发送sensorStart后不返回Done
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
# 打开串口
dataSerial = SerialPort(serialDataPort, dataBaudRate)
cfgSerial = SerialPort(serialCFGPort, cfgBaudRate)
# 传送配置文件
cfg_file = open(cfg_file_name, 'r')
cfg = cfg_file.readlines()
for i in range(len(cfg)):
if cfg[i][0] == '%':
continue
cfgSerial.send_message(cfg[i])
for j in range(3):
msg = cfgSerial.port_readline()
if msg == 'Done\n':
print(msg)
break
elif -1 != msg.find('not recognized as a CLI command'):
print(msg)
exit()
elif -1 != msg.find('Error'):
print(msg)
exit()
else:
print(msg)

其他cfg指令都可以Done,但是sensorStart不行
请尝试在每个command之间加段延时,类似下面的帖子。
https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/625663/starterware-awr1642-starting-up-the-device-without-sending-config-from-the-visualizer/2311611#2311611
另外,请确定cfg参数配置都是正确的。