|
1234567891011121314151617 |
- import serial
-
- with serial.Serial(port='COM6', timeout=1) as ser:
- ser.baudrate = 74880
-
- while True:
- msg = ser.readline()
- if msg:
- try:
- print(msg.decode(), flush=True, sep='' ,end='')
- except:
- pass
-
- if msg == b'ld\r\n':
- ser.baudrate = 74880
- if msg == b'[OTA] End\r\n':
- ser.baudrate = 115200
|