Discussion:
[Bitpim-devel] Re: [bitpim-cvs-checkins] bitpim commport.py,1. 34 ,1.35
d***@netzero.com
2004-10-17 02:08:58 UTC
Permalink
Stephen, here go you. com_samsungat has commonn/generic calls to support Samsung AT commands. com_samsungscha650, as a subclass to com_samsungat, implements its specific features. I plan to add com_samsungscha310 to implement A310 features. The only other change is a change to gui to make A650 available for selection. My carrier is Verizon. Please let me know if you have any questions or comments.

-Joe Pham

---------- Forwarded Message ----------
Stephen, I've been working to add support to the Samsung SCH-A650
phones and I've been able to retrieve phonebook data from a phone to
BP using AT commands. I'm working on saving data from BP back to the
phone. I could post what I have so far if you think it could help you
started going.
-Joe Pham
Yes I would like to see your code. Make sure that you agree to the
license that BitPim is copyrighted with (GPL), before you send any code.

You might want to look at bitpim/examples/samsungnotes.txt which has
some notes about various Samsung phones. If you would like to add some
notes about your phone, I would happy to add them to those notes.

What carrier is the A650 used with?

Stephen





-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Stephen Wood
2004-10-17 04:41:42 UTC
Permalink
Post by d***@netzero.com
Stephen, here go you. com_samsungat has commonn/generic calls to
support Samsung AT commands. com_samsungscha650, as a subclass to
com_samsungat, implements its specific features. I plan to add
com_samsungscha310 to implement A310 features. The only other change
is a change to gui to make A650 available for selection. My carrier
is Verizon. Please let me know if you have any questions or comments.
-Joe Pham
Joe:

I couldn't find an unrar utility that can extract the files. Can you
send the two files as straight attachments.

Thanks, Stephen
d***@netzero.com
2004-10-17 17:07:42 UTC
Permalink
Stephen, sorry 'bout that. Here you go again.

-Joe Pham
Stephen Wood
2004-10-18 03:50:06 UTC
Permalink
I have put your code into the CVS. I put your name on the copyright
line for both files (I renamed com_samsungat to com_samsung).

Please let me know if you don't agree to the copyright or putting the
code into the CVS.

I have not added the phone to guiwidgets.py yet as I want to study the
code and also rework it to use the sendatcommand function.

Stephen
Post by d***@netzero.com
Stephen, sorry 'bout that. Here you go again.
-Joe Pham
Vic Heintz
2004-10-18 15:25:40 UTC
Permalink
Post by d***@netzero.com
Stephen, here go you. com_samsungat has commonn/generic calls to
support Samsung AT commands. com_samsungscha650, as a subclass to
com_samsungat, implements its specific features. I plan to add
com_samsungscha310 to implement A310 features. The only other change
is a change to gui to make A650 available for selection. My carrier
is Verizon. Please let me know if you have any questions or comments.
-Joe Pham
---------- Forwarded Message ----------
Stephen, I've been working to add support to the Samsung SCH-A650
phones and I've been able to retrieve phonebook data from a phone to
BP using AT commands. I'm working on saving data from BP back to the
phone. I could post what I have so far if you think it could help you
started going.
-Joe Pham
Hi Joe,
Can you confirm that you have actually used your code in BitPim to get
phonebook information from your phone?

I looked at your com_samsungscha650.py module and it seems that the
a650 apparently responds much the same to AT commands as my a670 does
and as the a610 does. Yet when I used your module in bitpim (adding the
necessary line to guiwidgets) and pretended my phone was an a650, I got
an exception when attempting to "Get Phone Data". According to the
exception it is timing out in readsome in commport.py. It appears to be
waiting for a response to AT command "E0V1" . (On my A670 the only
response I get to "ATE0V1" is "OK".)

Using Kermit I have not been able to figure out the syntax of any of
the supposed AT write commands. So I have not been able to change
anything on the phone with AT commands. What is the plan? How is this
accomplished on other supported phones? I hear discussions about "brew
mode" and don't really understand what that means. Is that some other
protocol for reads and writes other than AT? Or is that the mode we are
in when we send AT#PMODE=1 ? Is it possible that my phone is somehow
already in the PMODE=1 state when the exception occurs and doesn't
understand the ATE0V1 command?

Sorry if this is a bunch of newbie questions from someone who really
doesn't understand what is going on "under the hood."

Vic Heintz
Stephen Wood
2004-10-18 16:03:44 UTC
Permalink
On Mon, 2004-10-18 at 11:25, Vic Heintz wrote:
...
Post by Vic Heintz
I looked at your com_samsungscha650.py module and it seems that the
a650 apparently responds much the same to AT commands as my a670 does
and as the a610 does. Yet when I used your module in bitpim (adding the
necessary line to guiwidgets) and pretended my phone was an a650, I got
an exception when attempting to "Get Phone Data". According to the
exception it is timing out in readsome in commport.py. It appears to be
waiting for a response to AT command "E0V1" . (On my A670 the only
response I get to "ATE0V1" is "OK".)
Using Kermit I have not been able to figure out the syntax of any of
the supposed AT write commands. So I have not been able to change
anything on the phone with AT commands. What is the plan? How is this
accomplished on other supported phones? I hear discussions about "brew
mode" and don't really understand what that means. Is that some other
protocol for reads and writes other than AT? Or is that the mode we are
in when we send AT#PMODE=1 ? Is it possible that my phone is somehow
already in the PMODE=1 state when the exception occurs and doesn't
understand the ATE0V1 command?
ATE0V1 is a standard modem command. (I think it should still work with
PMODE=1, try it with kermit) It means turn off echoing and turn on
verbose mode. I have written some low level communication commands that
don't care if the echoing is on or not, so the E0V1 won't be needed once
the a650 code is modified to use these commands.

I am not sure why this code doesn't work (I have not tried it myself),
but there are a couple of possiblities. One is that it can be a little
tricky keeping reads and write synchronized. The sendatcommand in
commport.py flushes out the read buffer before sending the command which
should help with this.

The other possiblity is that you have not power cycled your phone since
retrieving pictures or browsing the filesystem, so your phone is still
in "Brew mode". The only way I know to get out of Brew mode is to
reboot the phone. I will add code to detect if the phone is in Brew
mode and reboot it, if needed. (This takes about a minute. We need a
way to keep the user from getting impatient. Perhaps having the
progress bar move slowly to show some motion.)

Brew mode, also known as diagnostics mode. It is a binary protocol with
checksums. For the non-samsung phones, all the phonebook/calendar/file
communications are done in this mode. For the Samsung the ASCII AT
protocol is used instead. But somethings like pictures and ringers
probably have to be done in Brew mode.

To write to the phone, you need to know the appropriate Write command.
This is often made be replacing R with W. So writing a phonebook entry
is done with AT#PBOKW.

Stephen
Vic Heintz
2004-10-18 16:55:11 UTC
Permalink
Post by Stephen Wood
The other possiblity is that you have not power cycled your phone since
retrieving pictures or browsing the filesystem, so your phone is still
in "Brew mode". The only way I know to get out of Brew mode is to
reboot the phone. I will add code to detect if the phone is in Brew
mode and reboot it, if needed.
Eureka! It must have been in brew mode. I DID succeed in downloading my
phonebook information on my a670 by using the A650 code! But I don't
think just turning off the phone is the fix. I had done this before and
had quit Bitpim and restarted. Bitpim remembers the fact that in a
prior session i had turned on filesystem view and had made it the
active tab. So when it started up it was again the active tab. This
time I turned off filesystem view and selected the Phonebook tab before
running "Get Phone Data" and it worked.

Making progress. At least now I have a way to back up my phonebook.
True value will come when we can write it to the phone.

Vic
Vic Heintz
2004-10-18 18:02:50 UTC
Permalink
Post by Stephen Wood
To write to the phone, you need to know the appropriate Write command.
This is often made be replacing R with W. So writing a phonebook entry
is done with AT#PBOKW.
The A670's response to "at#PBOKW=?" is "#PBOKW:
(1-500),(0-4),22,32,32,0" but I am not sure what that is telling me.
What exactly is to follow "AT#PBOKW"? Is there an "=" sign? Is the data
quoted? in parentheses? comma separated?
And what is the data it expects? 1-500 undoubtedly refers to a memory
location. 0-4 could refer to number type ID (home,work,etc.) or group
(friends,family, etc), 22 and 32 look familiar as string lengths for
name and number.

Or is the above response to at#PBOKW=? meaningless and the write record
somehow mirrors the "AT#PBOK R=" format? Does anyone have a working
example of an AT#PBOKW command for any phone?

Vic
Stephen Wood
2004-10-18 18:41:48 UTC
Permalink
Post by Stephen Wood
To write to the phone, you need to know the appropriate
Writecommand.
This is often made be replacing R with W. So writing a phonebook entry
is done with AT#PBOKW.
The A670's response to"at#PBOKW=?" is
"#PBOKW:(1-500),(0-4),22,32,32,0" but I am not sure what that is
telling me.What exactly is to follow "AT#PBOKW"? Is there an "=" sign?
Is thedata quoted? in parentheses? comma separated?
And what is the data it expects? 1-500 undoubtedly refers to a
memorylocation. 0-4 could refer to number type ID (home,work,etc.) or
group(friends,family, etc), 22 and 32 look familiar as string lengths
forname and number.
Or is the above response to at#PBOKW=? meaningless and the writerecord
somehow mirrors the "AT#PBOK R=" format? Does anyone have aworking
example of an AT#PBOKW command for any phone?
I think AT#PBOKR=? and AT#PBOKW=? just give the same information. To
write a record, you send back a line formatted just like what you get
from PBOKR. So writing into slot 38, an entry that has speed dial # 10,
the command would begin

AT#PBOKW=38,10, ...

To delete what is in slot 38, do

AT#PBOKW=38


It looks like Joe's code does some of the bookkeeping that needs to be
done before writing to the phone, but he hasn't implemented any actual
writing.

Stephen
Vic Heintz
2004-10-18 19:32:52 UTC
Permalink
Post by Stephen Wood
I think AT#PBOKR=? and AT#PBOKW=? just give the same information. To
write a record, you send back a line formatted just like what you get
from PBOKR. So writing into slot 38, an entry that has speed dial #
10,
the command would begin
AT#PBOKW=38,10, ...
I tried sending back the the exact string returned from an AT#PBOKR=n
with an AT#PBOKW=string and it gave me an ERROR.
SInce the last field of that string is an apparent timestamp, I
wouldn't be surprised if that is not supposed to be set in the write
command. I would expect the phone to want to set that itself. But just
dropping that field doesn't work either. I also would not be surprised
if the phone did not want you to arbirarily choose the "slot" because
it most likely would choose the next available one. So what is the
syntax? Seems like an impossible amount of guesswork to figure it out.
Isn't this information shared somewhere or is this a Samsung secret?
Post by Stephen Wood
To delete what is in slot 38, do
AT#PBOKW=38
Yes, I discovered this by accident.

Vic

Loading...