Serial I/O problem with pywin32 ?

17 views
Skip to first unread message

Xavier

unread,
Sep 3, 2008, 3:09:03 AM9/3/08
to Movable Python
Hi,

I try to access to a Bluetooth GPS data-logger with Python. I use
pySerial.

Sending and receiving little messages (~100 char) works fine. However,
when I ask the GPS to dump the trails, it sends some Mbytes and here
is the problem : in the stream of bytes, I randomly losts chunks of
~100bytes.

I tried USPP and pyBlueZ instead of pySerial : same problem.

It doesn't like it is a bufferoverun bug from me because :
- the GPS seems to wait when I do not read the stream,
- there is never more than 200 inWainting() characters,
- my code to test it is quite simple :

seriallink = serial.Serial("COM40")
fileName = "data.dump"
out = open(fileName, 'w')
while 1:
c = seriallink.read()
out.write(" %0.2X" % ord(c))
print "*",
out.close()

(with pyBluez :
sock=BluetoothSocket( RFCOMM )
sock.connect(("00:0A:...", 1)))

I tried my program on two different PC with two Bluetooth dongle,
(with pySerial, USPP, pyBluez).
The same things are :
- windows
- the GPS (which works fine with the dumper program of the
constructor)
- pyWin32

Any known problems with pywin32 and serial I/O when downloading a big
stream of data ?

Xavier

unread,
Sep 3, 2008, 3:16:34 AM9/3/08
to Movable Python
I've forgotten to tell than I found another guy with a similar
problem :
http://www.generation-nt.com/reponses/rs232-entraide-142097.html

He said that :
- no problem with little messages
- lost of one byte every hour when receiving a lot of data

Michael Foord

unread,
Sep 3, 2008, 5:35:28 AM9/3/08
to mo...@googlegroups.com
Xavier wrote:
> I've forgotten to tell than I found another guy with a similar
> problem :
> http://www.generation-nt.com/reponses/rs232-entraide-142097.html
>

Sorry Xavier - I've never used the serial port with pywin32. You're much
more likely to get a useful response on the pywin32 message group.

All the best,

Michael Foord

> He said that :
> - no problem with little messages
> - lost of one byte every hour when receiving a lot of data
> >


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/

Xavier

unread,
Sep 3, 2008, 5:45:31 AM9/3/08
to Movable Python
Sorry for the misplaced post. I post it in comp.lan.python :-)
Reply all
Reply to author
Forward
0 new messages