Discussion:
[BitPim-devel] Samsung A900 AT codes
David Lonie
2008-07-13 16:54:19 UTC
Permalink
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=%2Fgnome-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')
Stephen Wood
2008-07-14 01:03:46 UTC
Permalink
Post by David Lonie
I'm using the python script below (much of it adapted from WebSVN -
kryogenix.org - Rev 8 - /gnome-bluetooth-phones/trunk/backend.py ) to try to
discover the AT+ codes for my samsung a900 in the eventual goal of being
able to access the calendar.
If the calendar is accessible through AT commands, then it could be PISHR. Try

AT#PISHR=?

or AT#PISHR=n (where n is a small number).

But I'll bet that the calendar, if accessible, is done through binary
packets like the phone book. One can do the same thing as you did
with that python script, but it is trickier. I will try to hunt for
the calendar protocol when I get a chance. I still have the A900 that
was donated a while ago.

Does BitPim writing work with your phone? It works for me, but I
havn't heard if it works for anyone else.

Stephen
David Lonie
2008-07-14 01:46:30 UTC
Permalink
The PISHR commands don't do anything with this phone. The phonebook mode
works great for the A900 over here, and by looking through the filesystem
browser, the calendar info looks to be in /nvm/nvm/schedule. I see the
filesystem browser's context menu has an option to reboot the phone, but I
can't find how in the source (granted, I just noticed and haven't dug very
deep yet :) ) Do you know offhand how this is done?

Dave
Post by David Lonie
Post by David Lonie
I'm using the python script below (much of it adapted from WebSVN -
kryogenix.org - Rev 8 - /gnome-bluetooth-phones/trunk/backend.py ) to
try to
Post by David Lonie
discover the AT+ codes for my samsung a900 in the eventual goal of being
able to access the calendar.
If the calendar is accessible through AT commands, then it could be PISHR.
Try
AT#PISHR=?
or AT#PISHR=n (where n is a small number).
But I'll bet that the calendar, if accessible, is done through binary
packets like the phone book. One can do the same thing as you did
with that python script, but it is trickier. I will try to hunt for
the calendar protocol when I get a chance. I still have the A900 that
was donated a while ago.
Does BitPim writing work with your phone? It works for me, but I
havn't heard if it works for anyone else.
Stephen
-------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Stephen Wood
2008-07-16 02:11:56 UTC
Permalink
You do have to do AT#PMODE=1 before at least some AT commands work on
phones that use them. But if I recall, PMODE=1 doesn't work on the
A900.

On many phones, files in the /nvm directory are not writable. Try
reading the schedule file and then replacing it with itself. (Or wait
until I give that a try.) So that means that another way has to be
found to access the calendar if both reading and writing of the
calendar is to be sup
Post by David Lonie
The PISHR commands don't do anything with this phone. The phonebook mode
works great for the A900 over here, and by looking through the filesystem
browser, the calendar info looks to be in /nvm/nvm/schedule. I see the
filesystem browser's context menu has an option to reboot the phone, but I
can't find how in the source (granted, I just noticed and haven't dug very
deep yet :) ) Do you know offhand how this is done?
Dave
Vallevand, Mark K
2008-07-14 14:14:06 UTC
Permalink
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: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of David
Lonie
Sent: Sunday, July 13, 2008 11:54 AM
To: bitpim-***@lists.sourceforge.net
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')
David Lonie
2008-07-14 14:18:44 UTC
Permalink
I noticed bitpim has a "reboot phone" feature that works for the a900. I'm
digging through trunk trying to find it now :)

On Mon, Jul 14, 2008 at 9:14 AM, Vallevand, Mark K <
Post by Vallevand, Mark K
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.
------------------------------
Vallevand, Mark K
2008-07-14 14:20:27 UTC
Permalink
That would be handy.



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: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of David
Lonie
Sent: Monday, July 14, 2008 9:19 AM
To: bitpim-***@lists.sourceforge.net
Subject: Re: [BitPim-devel] Samsung A900 AT codes



I noticed bitpim has a "reboot phone" feature that works for the a900.
I'm digging through trunk trying to find it now :)

On Mon, Jul 14, 2008 at 9:14 AM, Vallevand, Mark K
<***@unisys.com> wrote:

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.

________________________________
Loading...