Discussion:
[Bitpim-devel] serial problem on Mac?
Tim Lowery
2003-04-08 03:23:43 UTC
Permalink
Hi All,

I've been trying the characterize the problem with the serial
communications on the Mac. It's not uncommon for the serial connection
to fail after "Get Phone Data" the first time the application is
launched. Below is a portion of the protocol log for a successful
switch to Brew mode.

/dev/tty.usbserial0: Writing - Data 5 bytes
00000000 59 0c c4 c1 7e
/dev/tty.usbserial0: Begin reading until - Data 1 bytes
00000000 7e
/dev/tty.usbserial0: Read completed - Data 10 bytes
00000000 59 0c 00 b0 28 1f 00 4e 3c 7e

Here's the same portion of the protocol log for a failed switch to Brew
mode.

/dev/tty.usbserial0: Writing - Data 5 bytes
00000000 59 0c c4 c1 7e
/dev/tty.usbserial0: Begin reading until - Data 1 bytes
00000000 7e
/dev/tty.usbserial0: Read completed - Data 9 bytes
00000000 0c 00 b0 28 1f 00 4e 3c 7e

Note the last two lines of each log. It appears that the first byte
(hex 59) is dropped in the response from the phone.

This is my observation with all the serial failures I've encountered in
my testing. After the serial connection fails (displaying 8-6-2
alert), it almost always succeeds the 2nd time. And, without altering
the port setting on the phone. It doesn't seem to matter how the port
is selected on the phone. I'm able to consistently establish serial
connection whether it's in RS232, USB, or Closed.

My practice is to power-off the phone before connecting or
disconnecting to the cable.

Any thoughts on the above? How reliable is the serial communication on
the Windows side?

Tim
Roger Binns
2003-04-08 03:47:53 UTC
Permalink
Post by Tim Lowery
Note the last two lines of each log. It appears that the first byte
(hex 59) is dropped in the response from the phone.
Ok. Bitpim doesn't currently check the results of data coming back,
especially not the CRC. I should probably do that at some point.

I do know that the code in pyserial does clear buffers a lot. I also
know that the phone is somewhat buggy. If you actually know anything
about commport programing, you may want to have a closer look at
the pyserial code. I have interacted with the author a few times.
He mainly uses it with simple devices and several minute timeouts.
Post by Tim Lowery
How reliable is the serial communication on
the Windows side?
I would put a number on it like 98%. It is extremely rare for me
to have problems on Windows. (I use Win98SE with phone firmware 04).
On Linux I do have more problems, but usually at the begining after
I have just unplugged phone from Windows while bitpim was using it
and connected to Linux.

I think the pyserial code is shared between Linux and Mac.

Roger

Loading...