Re: Serial port failure

2006-12-17 Thread Nick Craig-Wood
Rob <[EMAIL PROTECTED]> wrote: > Craig, > > In the embedded firmware, the each box re-transmits after it finishes > reading the packet. This is a very rudimentary system, and uses no > flow control. The topology is that each embedded box has a master and > a slave port. The master is used

Re: Serial port failure

2006-12-15 Thread Leo Kislov
Rob wrote: > try: > response = p.readline() > except SerialException: > print ">>>>>Timed out<<<<<" > try: > port.writelines(msg) > except OSError: > print &quo

Re: Serial port failure

2006-12-15 Thread Rob
######## > > def GetNumLanes(Lanes): > >print "Looking for connected units" > > # give a turn command and wait for responses > >msg = ".g t 0 336\n" > > >for i in range(3): > >port = OpenPort() >

Re: Serial port failure

2006-12-15 Thread Leo Kislov
ts" > # give a turn command and wait for responses > msg = ".g t 0 336\n" > > for i in range(3): > port = OpenPort() > time.sleep(3) > print port.isOpen() > print "Request #%d" % (i+1) > try

Re: Serial port failure

2006-12-15 Thread Rob
message > >> > reslen = len(response) > >> > if reslen > 5: > >> > if res[1] == 'Ack': > >> > return res[0] > >> > elif res[1] == 'Nak': > >> > return 0x7F > >> > else: > >> >

Re: Serial port failure

2006-12-15 Thread Grant Edwards
On 2006-12-15, hg <[EMAIL PROTECTED]> wrote: >> Here is OpenPort >> >> >> OpenPort procedure >> >> def OpenPort(name): >> BRate = 19200 >> Tout =

Re: Serial port failure

2006-12-15 Thread Rob
Craig, In the embedded firmware, the each box re-transmits after it finishes reading the packet. This is a very rudimentary system, and uses no flow control. The topology is that each embedded box has a master and a slave port. The master is used to receive data from the upstream box, and send

Re: Serial port failure

2006-12-15 Thread hg
gt;> > #look for ack in the return message >> > reslen = len(response) >> > if reslen > 5: >> > if res[1] == 'Ack': >> > return res[0] >> > elif res[1] == 'Nak': >> > return 0x7F >> > else: >&

Re: Serial port failure

2006-12-15 Thread Rob
gt; >>>>>> Snip <<<<<< > > > > #### GetNumLanes Procedure > > > > def GetNumLanes(Lanes): > >

Re: Serial port failure

2006-12-15 Thread hg
# > GetNumLanes Procedure > > def GetNumLanes(Lanes): > print "Looking for connected units" > # give a turn command and wait for responses &g

Re: Serial port failure

2006-12-15 Thread drake
[EMAIL PROTECTED] wrote: ..snip> > In the second iteration of your loop, you appear to be opening a port > that is already open: > > for i in range(3): > port = OpenPort() > > thus the error message: "the serial port is unavailable". > > --Drake Smith Skip that -- I didn't not

Re: Serial port failure

2006-12-15 Thread drake
ts" > # give a turn command and wait for responses > msg = ".g t 0 336\n" > > for i in range(3): > port = OpenPort() > time.sleep(3) > print port.isOpen() > print "Request #%d" % (i+1) > try

Re: Serial port failure

2006-12-15 Thread Nick Craig-Wood
Rob <[EMAIL PROTECTED]> wrote: > I am fairly new to python, but not programming and embedded. I am > having an issue which I believe is related to the hardware, triggered > by the software read I am doing in pySerial. I am sending a short > message to a group of embedded boxes daisy chained v

Serial port failure

2006-12-15 Thread Rob
mLanes(Lanes): print "Looking for connected units" # give a turn command and wait for responses msg = ".g t 0 336\n" for i in range(3): port = OpenPort() time.sleep(3) print port.isOpen() print "Request #