41 lines
974 B
Python
41 lines
974 B
Python
|
|
|
|
|
|
#baud_rates_test = (2400, 4800, 9600, 19200, 28800, 38400, 56000, 57600, 115200, 128000, 153600, 230400, 256000)
|
|
baud_rates_test = [57600]
|
|
|
|
|
|
cmd_line = '/home/thebears/sr/bin/sigrok-cli --config samplerate=12M --driver=fx2lafw --continuous'
|
|
cmd_start = cmd_line
|
|
#'-P uart:baudrate=57600:tx=D0 -P uart:baudrate=9600:tx=D0 -A uart=tx-data:tx-warning'
|
|
cmd_split = cmd_line.split()
|
|
for x in baud_rates_test:
|
|
cmd_split.append('-P')
|
|
cmd_split.append(f'uart:baudrate={str(x)}:tx=D0')
|
|
|
|
cmd_split.append('-A')
|
|
cmd_split.append('uart=tx-data:tx-warning')
|
|
|
|
|
|
import io
|
|
import time
|
|
import subprocess
|
|
import sys
|
|
|
|
command_to_run = cmd_split
|
|
#command_to_run = ['/bin/bash','/home/thebears/Source/serial_monitor_variable/run_me.sh']
|
|
process = subprocess.Popen(command_to_run,stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
|
|
|
|
idx = 0
|
|
while True:
|
|
stuff = process.stdout.readline()
|
|
if len(stuff) == 0:
|
|
break
|
|
print(idx,stuff)
|
|
idx+=1
|
|
|
|
|
|
|
|
|
|
|