通过串口/dev/ttyAMA1, come这边通过python脚本往串口写,单片机收到消息后会回应,现在come这边一直收不到消息。。。。很奇怪。
while True:
try:
send_msg(ser, 'check link')
nw_mgr_logger.info('send message')
time.sleep(0.01) #old is 0.1
str100 = ser.readline()
nw_mgr_logger.info('check link:%s' % str100)
if str100 != '':
break
except serial.SerialException:
nw_mgr_logger.error('Faild to read data from %s', SERIAL_PORT)
time.sleep(1)
except Exception as e:
nw_mgr_logger.error(e)
time.sleep(1)
现在单片机这边收到消息后给come发的信息,在python里面readline没有,很奇怪,可能啥原因呢?
下面是单片机发的消息(通过printf 接口,写的串口)
appeal initialization!
The link is normal.
The link is normal.
The link is normal.
The link is normal.
appeal initialization!
The link is normal.
The link is normal.
The link is normal.
The link is normal.
appeal initialization!
The link is normal.
The link is normal.
The link is normal.
The link is normal.
appeal initialization!
The link is normal.
The link is normal.
The link is normal.
The link is normal.
appeal initialization!
The link is normal.
|
|