Re: Samsung A900 AT codes
"Vallevand, Mark K" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <CE091CB077F4A74A9CBA33A4E4A8A3BF0FBFFA10@USEA-EXCH4.na.uis.unisys.com> |
I wrote a similar thing for testing all the AT commands for my Samsung m520. It also hangs after a few minutes. Is this something that affects all Sammys? I couldn't find anything short of turning off/on the m520. My code would track progress in a file and always start at the point of the hang from the previous run. I'll dig it up and post the relevant code. I've basically given up on the m520. I can get it to respond to a small set of AT commands, but nothing useful. Regards. Mark K Vallevand We old folks have to find our cushions and pillows in our tankards. Strong beer is the milk of the old. - Martin Luther THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of David Lonie Sent: Sunday, July 13, 2008 11:54 AM To: [email protected] Subject: [BitPim-devel] Samsung A900 AT codes I'm using the python script below (much of it adapted from WebSVN - kryogenix.org - Rev 8 - /gnome-bluetooth-phones/trunk/backend.py <http://svn.kryogenix.org/filedetails.php?repname=kryogenix.org&path=%2F gnome-bluetooth-phones%2Ftrunk%2Fbackend.py&sc=1> ) to try to discover the AT+ codes for my samsung a900 in the eventual goal of being able to access the calendar. The script works beautifully, generating AT+XXXX codes and displaying the phone's response, but after a couple hundred queries the phone stops responding and has to be restarted to continue. Is there a linux command or a know AT+ code that will reset the connection without restarting the phone? Having to restart the phone every couple of minutes is really slowing this down. I'm new to working with serial tty communications, so even if something should seem obvious, I probably didn't try it :) Also, I noticed that Stephen Wood wrote the existing framework for the A900 in trunk. Do you (or anyone else) have any suggestions for getting into the guts of the phone? Here's the hacky little python script. It's not well commented, but it's not that complex either :) Feel free to modify or use it as you see fit: # samsungATProbe.py # # import serial start = 'GMM' # Set the string to start at. 'GMM' is the first code in the for loops below, since it is known to get a response from the phone. active = False #initialize phone def talk(send): ph = serial.Serial('/dev/ttyUSB2', 115200, timeout=0.03) ph.flushOutput() ph.flushInput() # send = 'at+gmm\r' ph.write(send) # print "s = " + send eol, receive_data,blank_line = False, [], 0 while eol != True: receive=ph.readline().strip() # print "r = " + receive if len(receive) > 0: if receive == send.strip() or receive =='OK' or receive == 'ERROR': print receive continue else: print "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " + send print receive else: blank_line=blank_line+1 if blank_line > 2: # Some output has a single blank line within it, so we wait until we get two blank lines before assuming the end of the output eol = True ph.close() if 1: for a in ['G', 'P', 'A', 'B', 'C', 'D', 'E', 'F', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']: for b in ['M', 'C', 'A', 'B', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W','X', 'Y', 'Z']: for c in ['M', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']: for d in ['', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']:# No 'R'!!! if a+b+c+d == start: active = True if active: talk("AT+"+a+b+c+d+'\r') ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ BitPim-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bitpim-devel