pySerial - accessing GSM module failed

Dave Dave daved170 at gmail.com
Fri Jan 9 07:45:33 EST 2009


Hello all,
I'm newbie in the serial buissness and I beed some Help. I'm a student at my
last year and I got final assaignment.
My goal is to comunicate with SIM free, GSM Module through computer. I want
to simulate SIM card by receiving and transferring data from my code.

In order to understand how to comunicate with the GSM module I took an
existing module which gut RS232 connector and connected it to the computer.
I ran my python code:
class MySerial():
     def __init__ (self,port,baundrate,....)
          self.s = serial.Serial(port,baundreate,....)

     def read(self,size=1):
           txt = self.s.read(size)

    def write(self,text=''):            txt = self.s.write(text)

    def main():
          obj = MySerial('COM1')
          obj.write('ATI')
           sleep(1)
          obj.read(10)

the code run and I send the comman 'ATI' which ask the GSM Module if
everything is OK.
the read line returs 'ATI'. echo to my write function.

Whenever I run this comman ('ATI') through hyperterminal I gut the result :
232 OK

Does any one got an Idea why my code isn't getting the same answer from the
GSM Module?
thanks
dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090109/cb570252/attachment.html>


More information about the Python-list mailing list