Changing baud rate doesn't allow second command

Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915 at spamschutz.glglgl.de
Mon Apr 25 09:06:19 EDT 2011


Am 25.04.2011 14:46, schrieb rjmccorkle:
> hi - I need to open a serial port in 9600 and send a command followed
> by closing it, open serial port again and send a second command at
> 115200.  I have both commands working separately from the python
> command line but it won't work in the script.  Any idea why?

What does "won't work" mean? I can't see any issues in the code.

I suppose the string sent with 9600 tells the device to change the 
speed. Are you sure that it is received correctly?

Additionally, maybe you have output issues. E.g. you just write 
"ser.baudrate" instead of "print ser.baudrate", so that could be a 
source of behavioral differences.


> #import os
> #program = 'C:\Program Files\Program.exe'+'-start'
> #os.system(r'program)

I suppose this doesn't belong to the problem?


Thomas




More information about the Python-list mailing list