Frustration debugging serial code

MRAB python at mrabarnett.plus.com
Fri May 7 22:49:29 EDT 2010


William R. Wing (Bill Wing) wrote:
> 
> On May 7, 2010, at 10:18 PM, MRAB wrote:
> 
>> William R. Wing (Bill Wing) wrote:
>>> See comments in-line.
>>> On May 7, 2010, at 3:23 PM, MRAB wrote:
>>>> William R. Wing (Bill Wing) wrote:
>>>>> On May 7, 2010, at 2:08 PM, MRAB wrote:
> 
> [byte -byte- byte]
> 
>>>>>>
>>> The X10 controller not only receives it, it echos the response 
>>> (\x06\r) that means
>>> it saw it and is ready for the next command in all three cases.  The 
>>> serial write
>>> that immediately follows, in which five hex bytes get sent to it is 
>>> the one which
>>> succeeds interactively and in the IDE, and fails when executed as a 
>>> bash script.
>> Does the ' Hit any key to continue: ' message appear when run as a bash
>> script?
> 
> Yes, in all three cases, and just for completeness, the neither of the 
> error returns
> from the first open statement ever are taken - that is, I never get 
> either the \x15, which
> would print "Received NAK" nor the "Something's wrong" print that would 
> indicate
> any other random return.
> 
So clutching at straws doesn't work either... :-(

>> I'm just wondering whether it's that when run from the Python prompt or
>> IDE the 'ser' object continues to exist for a while, but when run as a
>> bash script Python is terminating before all of the bytes have been
>> sent.
>>
>> Of course, I'd expect 'ser.close()' to return only when there's nothing
>> left to be sent, or, at least, for there to be enough time while it's
>> waiting for you to press ENTER.
>>




More information about the Python-list mailing list