[PythonCE] serial input problem

Adam Walley adam.walley at gmail.com
Mon Mar 31 15:09:00 CEST 2008

From: Adam Walley <adam.walley at gmail.com>
Date: 31 Mar 2008 13:15
Subject: Re: [PythonCE] serial input problem
To: Jan Ischebeck <mail at jan-ischebeck.de>

Hi, Jan.

Thanks for the reply. I am using 19200 baud, but I have also checked 2400,
4800, 9600, 14400, 38400, 57600 - same result. The other settings are 8N1
(set as 8,0,1 in the ceserial module). I have checked my modem settings to
see that there is nothing which could interfere, but AFAIK all seems ok. I
have made sure my wiring is ok too.

All these checks are good, but the fact is that my terminal program works
correctly, and PythonCE continues to give me these scrambled answers. The
first character usually seems to be correct, but after that it seems to be
garbage. The "OK" reply from my modem comes in as: 13 A1 6A 35 (in hex). If
I switch to numeric modem responses the modem replies with "0" instead of
"OK". In this case, PythonCE gives me a "0" followed by a square (indicating
a character which cannot be displayed).

I feel like I am missing something simple, but just cannot put my finger on

Just a note on encoding, my 'sys.getdefaultencoding()' is 'ascii' and my '
sys.getfilesystemencoding()' is 'mbcs'.

I hope you can help.


On 30/03/2008, Jan Ischebeck <mail at jan-ischebeck.de> wrote:
> Hi Adam,
> Have you checked Baudrate, Stopbit and Parity Settings?
> The begin of the modems answer in hex makes sense ( 0x0D = 13 = carriage
> return). The last byte is 0x0A = 10 = line feed.
> But A1 6A 35 is neither raw unicode, utf-8 or utf-16 so I guess
> something is wrong with the line settings.
> Jan
> Adam Walley wrote:
> >
> > PPC: AT
> > Modem: íj5 (this should be '0')
> >
> > The full modem response in hex is: 0D A1 6A 35 0A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonce/attachments/20080331/2a0dde03/attachment.htm 

More information about the PythonCE mailing list