Discussion:
[Bitpim-devel] Samsung SCH-A650 Phonebook support
d***@netzero.com
2004-10-23 03:26:07 UTC
Permalink
The A650 phonebook feature BITPIM is now available for testing, review, and checking-in into the BITPIM tree. The main modules are com_samsung and com_samsungscha650. There's also a one-line change to module guiwidgets that adds the A650 option to the selection dialog. If you need a prebuilt BITPIM exe for WinXP (w/o USB support) for testing, please let me know and I'd email it to you (~7.5MB zip).

Please let me know if you have any other questions or comments.

Thanks

-Joe Pham
Vic Heintz
2004-10-23 21:18:58 UTC
Permalink
Post by d***@netzero.com
The A650 phonebook feature BITPIM is now available for testing,
review, and checking-in into the BITPIM tree. The main modules are
com_samsung and com_samsungscha650. There's also a one-line change to
module guiwidgets that adds the A650 option to the selection dialog.
If you need a prebuilt BITPIM exe for WinXP (w/o USB support) for
testing, please let me know and I'd email it to you (~7.5MB zip).
Please let me know if you have any other questions or comments.
Thanks
-Joe Pham
<com_samsung.py><com_samsungscha650.py><guiwidgets.py>
I tried running bitpim with these modules and my A670 phone. Get Phone
Data seemed to work fine, When I tried Send Phone Data, it behaved as
if it were working but nothing was changed on the phone. I investigated
by changing save_phone_entry in com_samsung.py as follows:
from
def save_phone_entry(self, entry_str):
return self._send_at_cmd("#PBOKW="+entry_str)==self.__OK_str
to
def save_phone_entry(self, entry_str):
myResponse = self._send_at_cmd("#PBOKW="+entry_str)
print myResponse
return myResponse==self.__OK_str

I got "ERROR" echoed to my terminal window for each attempted write. So
the AT#PBOKW commands are clearly failing with my A670 but the code is
ignoring the errors. If it indeed works correctly for your A650 then
there must be a difference in the phones even though the read operation
works the same.

Vic
d***@netzero.com
2004-10-23 22:32:49 UTC
Permalink
Vic, thanks for checking it out. It sounds like there're some minor incompatibilities beween the A650 and the A670. I'm not surprised since I also found incompatibilities between my A650 and A310. BTW, if you have the "Log" view on, it'd tell you that the save of a particular entry fails. Please let me know what I can do to help. Good luck.

-Joe Pham
Post by d***@netzero.com
The A650 phonebook feature BITPIM is now available for testing,
review, and checking-in into the BITPIM tree. The main modules are
com_samsung and com_samsungscha650. There's also a one-line change to
module guiwidgets that adds the A650 option to the selection dialog.
If you need a prebuilt BITPIM exe for WinXP (w/o USB support) for
testing, please let me know and I'd email it to you (~7.5MB zip).
Please let me know if you have any other questions or comments.
Thanks
-Joe Pham
<com_samsung.py><com_samsungscha650.py><guiwidgets.py>
I tried running bitpim with these modules and my A670 phone. Get Phone
Data seemed to work fine, When I tried Send Phone Data, it behaved as
if it were working but nothing was changed on the phone. I investigated
by changing save_phone_entry in com_samsung.py as follows:
from
def save_phone_entry(self, entry_str):
return self._send_at_cmd("#PBOKW="+entry_str)==self.__OK_str
to
def save_phone_entry(self, entry_str):
myResponse = self._send_at_cmd("#PBOKW="+entry_str)
print myResponse
return myResponse==self.__OK_str

I got "ERROR" echoed to my terminal window for each attempted write. So
the AT#PBOKW commands are clearly failing with my A670 but the code is
ignoring the errors. If it indeed works correctly for your A650 then
there must be a difference in the phones even though the read operation
works the same.

Vic



-------------------------------------------------------
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
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Vic Heintz
2004-10-24 00:38:59 UTC
Permalink
Post by d***@netzero.com
Vic, thanks for checking it out. It sounds like there're some minor
incompatibilities beween the A650 and the A670. I'm not surprised
since I also found incompatibilities between my A650 and A310. BTW,
if you have the "Log" view on, it'd tell you that the save of a
particular entry fails. Please let me know what I can do to help.
Good luck.
-Joe Pham
Your com_samsungscha650.py module has these lines near the beginning:

desc="SCH-A650"

serialsname='scha650'

__groups_range=xrange(5)

__ phone_entries_range =xrange(1,501)

__pb_max_entries=25

__pb_max_speeddials=99

I arbitrarily changed the first two by replacing 650 with 670. Is that
ok? Or do they need to actually match something that is returned from
the phone? I believe my a670 can have 500 phone number entries ranging
from 1 to 500 and I can assign speed dial entries up to 500. Should I
change phone_entries_range to xrange(1,500)? I changed pb_max_entries
to 500 (and am puzzled by your setting of 25). I also changed
pb_max_speeddials to 500.

I turned on protocol logging and I see entries like

AT#PBOKW=0,1,1,4,0,"Voice
Mail",0,0,*86,0,,,,,,,,,,,,,"",4,0,20041023T194126,0,0,...,0.

where the 0,0,...,0. refers to 425 comma-separated zeroes after the
timestamp field. That seems like an excessive amount of non-data. Is
that my problem? What do the strings look like that are sent on your
phone? And how did you determine what string to write?

Vic
Roger Binns
2004-10-24 19:32:02 UTC
Permalink
Should I change phone_entries_range to xrange(1,500)? I changed pb_max_entries
to 500 (and am puzzled by your setting of 25). I also changed
pb_max_speeddials to 500.
range(1,5)
[1, 2, 3, 4]
"abcdefghijklmnop"[1:5]
'bcde'

Although this may seem silly initially, it turned out to be exactly the
right thing to do, and I experience very few off by one errors compared
to other programming languages.

The second half of this page contains brief introductions for programmers
and non-programmers which will quickly get you up to speed:

http://python.org/doc/Intros.html

Roger
Vic Heintz
2004-10-24 15:34:38 UTC
Permalink
OK, I have answered a few of my own questions. See below.
Post by Vic Heintz
Post by d***@netzero.com
Vic, thanks for checking it out. It sounds like there're some minor
incompatibilities beween the A650 and the A670. I'm not surprised
since I also found incompatibilities between my A650 and A310. BTW,
if you have the "Log" view on, it'd tell you that the save of a
particular entry fails. Please let me know what I can do to help.
Good luck.
-Joe Pham
desc="SCH-A650"
serialsname='scha650'
__groups_range=xrange(5)
__ phone_entries_range =xrange(1,501)
__pb_max_entries=25
__pb_max_speeddials=99
I arbitrarily changed the first two by replacing 650 with 670. Is that
ok? Or do they need to actually match something that is returned from
the phone? I believe my a670 can have 500 phone number entries ranging
from 1 to 500 and I can assign speed dial entries up to 500. Should I
change phone_entries_range to xrange(1,500)? I changed pb_max_entries
to 500 (and am puzzled by your setting of 25). I also changed
pb_max_speeddials to 500.
I turned on protocol logging and I see entries like
AT#PBOKW=0,1,1,4,0,"Voice
Mail",0,0,*86,0,,,,,,,,,,,,,"",4,0,20041023T194126,0,0,...,0.
where the 0,0,...,0. refers to 425 comma-separated zeroes after the
timestamp field. That seems like an excessive amount of non-data. Is
that my problem? What do the strings look like that are sent on your
phone? And how did you determine what string to write?
Vic
The number of trailing zeroes is apparently tied to the
"__pb_max_entries=25" line. Since I changed the 25 to 500, I got a
huge number of trailing ",0"s. I haven't studied your code well enough
to understand what is going on here.

Using kermit I was able to send the following AT#PBOKW command to my
phone, getting an OK instead of ERROR:
at#pbokw=0,1,1,4,0,"Voice
Mail",0,0,*86,0,,,,,,,,,,,,,"",4,0,"",20041024T101549.

The key difference between the a650 and the a670 apparently is that I
need one more additional field just before the timestamp field. (This
field is a text entry for the path to the image that is associated with
this phonebook entry.) I'm guessing that I will need the line
"__pb_max_entries=26" in an analogous "com_samsungscha670.py" module.
I'm starting to investigate what else I will need to change to make
this work. Guidance would be appreciated.

Vic
Vic Heintz
2004-10-24 18:41:12 UTC
Permalink
I made modifications of Joe Pham's com_samsungscha650.py to make a
working com_samsungscha670.py that both reads from and writes to the
a670 phonebook. I can make this module available as requested.

The key to using AT#PBOKW appears to be putting "0," in front of the
string that is returned from AT#PBOKR and putting "." after. I would
guess that this may be generally true for all similar Samsung phones.
(I don't know how Joe knew this but I had to guess this fact by looking
at his code.) Here is an example of what works when talking to the A670
using Kermit:

at#pbokr=31
#PBOKR: 31,10,0,0,"Test
Entry",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4,0,"",20
041024T124839

OK
at#pbokw=0,31,10,0,0,"New
TestEntryName",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4
,0,"",20041024T124839.
OK
at#pbokr=31
#PBOKR: 31,10,0,0,"New
TestEntryName",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4
,0,"",20041024T124839

OK

I hope this info is helpful. I'll be turning my attention to making
Stephen's A620 wallpaper code for downloading camera images work on the
a670.

Vic
Stephen Wood
2004-10-24 22:01:39 UTC
Permalink
Post by Vic Heintz
I made modifications of Joe Pham's com_samsungscha650.py to make a
working com_samsungscha670.py that both reads from and writes to the
a670 phonebook. I can make this module available as requested.
Can you send this to me and I'll check it in.
Post by Vic Heintz
The key to using AT#PBOKW appears to be putting "0," in front of the
string that is returned from AT#PBOKR and putting "." after. I would
guess that this may be generally true for all similar Samsung phones.
(I don't know how Joe knew this but I had to guess this fact by looking
at his code.) Here is an example of what works when talking to the A670
I just noticed this too. Sorry I didn't post the info.
...
Post by Vic Heintz
I hope this info is helpful. I'll be turning my attention to making
Stephen's A620 wallpaper code for downloading camera images work on the
a670.
The trick with supported both wallpaper/ringer transfers and phonebook
is that the files are transferred in diagnostics mode and the phonebook
in modem mode. Going from Phonebook mode to DM is easy, but going the
other way requires a reboot of the phone.

Roger, do you have any suggestions on how we can keep the number of
reboots per transfer session to one. I think we will need DM to
properly do getfundamentals (I don't know of a way to list all
downloaded ringers and images with AT commands). Perhaps if Samsung
modules can let guiwidgets know that wallpaper/ringer stuff happens
first followed by phonebook/calendar?

Also, we may need a way to tell the user to be patient, as it takes
about a minute to reboot the phone. (Although I still need to determine
how soon after power on the phone starts accepting and properly handling
AT commands.)

Stephen
Roger Binns
2004-10-25 02:41:10 UTC
Permalink
Post by Stephen Wood
Roger, do you have any suggestions on how we can keep the number of
reboots per transfer session to one. I think we will need DM to
properly do getfundamentals (I don't know of a way to list all
downloaded ringers and images with AT commands). Perhaps if Samsung
modules can let guiwidgets know that wallpaper/ringer stuff happens
first followed by phonebook/calendar?
Wallpaper and ringtone names only need to be returned by getfundamentals
if you can explicitly set them for a phonebook entry. If phonebook entries
don't take them, then just return blank lists.

What do the phones allow?

For the ESN stuff, all we actually need is some way of uniquely identifying
the phone. For the DM mode phones, just checksumming the ESN file was fine
and also had the bonus that we weren't storing the actual ESN anywhere. You
could just make a sha-1 of the ESN and get the same effect.

Roger
Stephen Wood
2004-10-24 22:06:47 UTC
Permalink
Joe:

I checked in your com routines (I havn't changed guiwidgets.py yet).

Your versions are presently available on the CVS. (version 1.3 of each
file)

I would like to try to use the sendatcommand in commport.py for your
phone instead of your routine. I have made edits to com_samsung.py and
com_samsungscha650.py so that they use sendatcommand. These are
verisons 1.4 of each file. (They have not shown up on the public CVS
yet.) Could you let me know if these changes work (might take some
tweaking on your part.) and if you have any objection to using
sendatcommand instead of _send_at_cmd.

Thanks, Stephen
Post by d***@netzero.com
The A650 phonebook feature BITPIM is now available for testing, review, and checking-in into the BITPIM tree. The main modules are com_samsung and com_samsungscha650. There's also a one-line change to module guiwidgets that adds the A650 option to the selection dialog. If you need a prebuilt BITPIM exe for WinXP (w/o USB support) for testing, please let me know and I'd email it to you (~7.5MB zip).
Please let me know if you have any other questions or comments.
Thanks
-Joe Pham
d***@netzero.com
2004-10-25 03:02:34 UTC
Permalink
Vic, sounds like you've been doing a bit of good detective work. It appears that the A670 can associate an image with a phone entry. Yes, please post your changes to the code. I assume that you're using the 'Wallpaper' field to manage the image info in phonebook.

Thanks,

-Joe Pham

-- Vic Heintz <***@rochester.rr.com> wrote:
I made modifications of Joe Pham's com_samsungscha650.py to make a
working com_samsungscha670.py that both reads from and writes to the
a670 phonebook. I can make this module available as requested.

The key to using AT#PBOKW appears to be putting "0," in front of the
string that is returned from AT#PBOKR and putting "." after. I would
guess that this may be generally true for all similar Samsung phones.
(I don't know how Joe knew this but I had to guess this fact by looking
at his code.) Here is an example of what works when talking to the A670
using Kermit:

at#pbokr=31
#PBOKR: 31,10,0,0,"Test
Entry",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4,0,"",20
041024T124839

OK
at#pbokw=0,31,10,0,0,"New
TestEntryName",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4
,0,"",20041024T124839.
OK
at#pbokr=31
#PBOKR: 31,10,0,0,"New
TestEntryName",3,0,,,,,,,3456789012,0,,,Bogus,0,,,"***@fake.address",4
,0,"",20041024T124839

OK

I hope this info is helpful. I'll be turning my attention to making
Stephen's A620 wallpaper code for downloading camera images work on the
a670.

Vic



-------------------------------------------------------
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
_______________________________________________
Bitpim-devel mailing list
Bitpim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel


________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
d***@netzero.com
2004-10-25 03:07:41 UTC
Permalink
Stephen,

I'd be more than happy to use sendatcommand from commport. I don't have access to CVS right now, so could you please either post or email me your changes including commport. I'll test it out and let you know.

Thanks,

-Joe Pham

________________________________________________________________
Speed up your surfing with NetZero HiSpeed.
Now includes pop-up blocker!
Only $14.95/ month - visit http://www.netzero.com/surf to sign up today!
Vic Heintz
2004-10-25 03:24:19 UTC
Permalink
Post by Roger Binns
For the ESN stuff, all we actually need is some way of uniquely
identifying
the phone. For the DM mode phones, just checksumming the ESN file was
fine
and also had the bonus that we weren't storing the actual ESN
anywhere. You
could just make a sha-1 of the ESN and get the same effect.
I'm not really sure what this is all about but I can tell you that
there is no $SYS.ESN file anywhere in the filesystem tree of the
Samsung a670 phone (at least when viewed in the Filesystem tab of
bitpim.) When I told this to Stephen earlier he seemed surprised,
saying "Interesting. That seemed to be pretty much a constant over
many phones."

Vic
Roger Binns
2004-10-25 04:08:11 UTC
Permalink
Post by Vic Heintz
I'm not really sure what this is all about but I can tell you that
there is no $SYS.ESN file anywhere in the filesystem tree of the
Samsung a670 phone
I would assume that its presence is a standard part of the Qualcomm
reference code. Samsung probably puts more effort into making its
phones similar across the GSM and CDMA lines and hence omits the
file.

Roger
Vic Heintz
2004-10-25 15:04:56 UTC
Permalink
Was working...now broken
I checked in com_samsungscha670.py as you sent it as version 1.1.
Version 1.1 the send_at replaced with sendatcommand.
I decided at this point to get a clean update from cvs and now none of
the phonebook stuff works. I believe it is failing in a basic "AT"
initialization stage. I can provide exception or protocol log text.

Vic
Stephen Wood
2004-10-25 16:04:10 UTC
Permalink
Yeah, I broke it. If you get an exception, send that.

I'll start trying to use the stuff in com_samsung.py with the A620 so
that I can unbreak what I broke.

Make sure you have version 1.3 of com_samsungscha670.py. Roger fixed an
indentation error that perhaps matters.

Stephen
Post by Vic Heintz
Was working...now broken
I checked in com_samsungscha670.py as you sent it as version 1.1.
Version 1.1 the send_at replaced with sendatcommand.
I decided at this point to get a clean update from cvs and now none of
the phonebook stuff works. I believe it is failing in a basic "AT"
initialization stage. I can provide exception or protocol log text.
Vic
-------------------------------------------------------
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
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Stephen Wood
2004-10-25 17:47:50 UTC
Permalink
Post by Stephen Wood
Yeah, I broke it. If you get an exception, send that.
I found one problem in com_samsung.py.

Seems I have a problem with the Truth. I had a bunch of True/False
return codes swapped in routines like is_online, pmode_on, etc in
com_samsung.py. I have comitted the fixes.


Stephen
Mike Young
2004-10-25 18:05:12 UTC
Permalink
I am happy to report that Vic's and Joe's code for reading and parsing
the phonebook data DOES WORK on my Verizon SCH-A610.

Next: I will try to write the phonebook data back to the phone and see
what happens...

--Mike
Vic Heintz
2004-10-25 18:32:05 UTC
Permalink
I want to rectify something I have been living with for a while now.
When I first downloaded DSV, the setup script did not seem to copy it
anywhere that Python knew about. My solution was to put DSV.py in my
bitpim source directory and patch importexport.py as follows:
< from DSV import DSV
---
import DSV
It works but is not correct. Where is DSV.py supposed to live in Unix
(MacOS)?

Vic
Roger Binns
2004-10-26 03:17:18 UTC
Permalink
Post by Vic Heintz
When I first downloaded DSV, the setup script did not seem to copy it
anywhere that Python knew about.
It always has for me on Windows and Linux. A directory named DSV
is created in the site-packages directory, and then DSV.py is
placed in that subdirectory.

On Linux the directory is /usr/lib/python2.3/site-packages and
on Windows it is c:\python23\lib\site-packages

Roger

Vic Heintz
2004-10-25 20:14:06 UTC
Permalink
Post by Mike Young
I am happy to report that Vic's and Joe's code for reading and parsing
the phonebook data DOES WORK on my Verizon SCH-A610.
Next: I will try to write the phonebook data back to the phone and see
what happens...
--Mike
It may well be too late, but if you select A650 as your phone you will
likely find that it deletes all of your phone numbers. I discovered
that too late. Fortunately I was able to restore them all when I
created com_samsungscha670.py which writes the correct format for my
phone with the extra "image assignment" field.
Loading...