Discussion:
[BitPim-devel] updated code for the LG PM325
Brent Roettger
2005-12-06 05:57:51 UTC
Permalink
### BITPIM
###
### Copyright (C) 2005 Brent Roettger <***@msn.com>
###
### This program is free software; you can redistribute it and/or modify
### it under the terms of the BitPim license as detailed in the LICENSE
file.
###
### $Id: com_lgpm325.py,v 1.3 2005/11/20

"""Communicate with the LG LX325/PM325 (Sprint) cell phone"""

# standard modules
import re
import time
import cStringIO
import sha

# my modules
import p_lgpm325
import p_brew
import common
import commport
import com_brew
import com_phone
import com_lg
import com_lgvx4400
import prototypes


class Phone(com_lgvx4400.Phone):
"Talk to the LG LX325/PM325 cell phone"

desc="LG LX325/PM325"
wallpaperindexfilename="setas/amsImageIndex.map"
ringerindexfilename="setas/amsRingerIndex.map"
protocolclass=p_lgpm325
serialsname='lgpm325'

ringtonelocations=(
# offset, index file, files location, type, maximumentries
( 2, ringerindexfilename, "user/sound/ringer", "ringers", 30),
)

builtinimages=('Starfish', 'Goldfish', 'Leaves', 'Bicycle', 'Speed',
'Autumn', 'Island', 'Winter', 'Bamboo', 'Yellow Flowers',
'Snow')

builtinringtones=( 'Tone 1', 'Tone 2', 'Tone 3', 'Tone 4', 'Tone 5',
'Tone 6',
'Alert 1', 'Alert 2', 'Alert 3', 'Alert 4', 'Alert
5', 'Alert 6',
'Jazztic', 'Rock & Roll', 'Grand Waltz', 'Toccata and
Fugue',
'Sunday Afternoon', 'Bumble Bee', 'Circus Band',
'Cuckoo Waltz',
'Latin', 'CanCan', 'Play tag', 'Eine kleine
Nachtmusik',
'Symphony No.25 in G Minor', 'Capriccio a minor',
'Moonlight',
Stephen Wood
2005-12-06 15:10:01 UTC
Permalink
I have checked in the updates. If there are any PM325 users with the
development code running, please update and give this a try.

Brent, the code that you sent again came through with long lines wrapped.
Perhaps next time you could put your updates in a zip or tar file first. I
did the best I could to undo the wrapped lines, but you might want to check
these out from the CVS and make sure that they work as you expect.

Thanks, Stephen
Here is the updated code for the LG PM325 phone. It currently supports
reading and writing of the phonebook. I have cleaned up the code quite a
bit from the previous version by removing a lot of unused and untested code.
The biggest problem right now is that the phone it is not currently being
auto-detected. If I set brew_required=True the phone is not detected at
all. If I set it to false, the phone is detected , but on the modem port
instead.
Can I get this code checked in? Does anyone have time to do some testing
and let me know how it works for you?
Thanks,
Brent Roettger
Baltz, Philip
2005-12-07 14:39:06 UTC
Permalink
Here is the updated code for the LG PM325 phone. It currently supports
reading and writing of
the phonebook. I have cleaned up the code quite a bit from the
previous version by removing
a lot of unused and untested code.
The biggest problem right now is that the phone it is not currently
being auto-detected. If I
set brew_required=True the phone is not detected at all. If I set it
to false, the phone is
detected , but on the modem port instead.
Can I get this code checked in? Does anyone have time to do some
testing and let me know how
it works for you?
Thanks,
Brent Roettger
I tried bitpim 8.0.4 developer release on my LG 325. I was able to
download phonebook data from the phone. I added a new entry and then
tried to upload the phonebook. The only option available was to replace
all data instead of just the new entry. The update started and received
the below exception. This garbled my phonebook: deleting some entries
and mixing data from others.

-phil

An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "C:\projects\bitpim\gui.py", line 174, in run
res=call()
File "C:\projects\bitpim\gui.py", line 114, in __call__
return apply(self.method, self.args+args, d)
File "C:\projects\bitpim\gui.py", line 1681, in senddata
apply(func, args)
File "C:\projects\bitpim\gui.py", line 1698, in writephonebook
return self.commphone.savephonebook(data)
File "C:\projects\bitpim\com_lgpm325.py", line 357, in
savephonebook
res=self.sendpbcommand(req,
self.protocolclass.pbupdateentryresponse)
File "C:\projects\bitpim\com_lg.py", line 121, in
sendpbcommand
raise common.CommsDataCorruption("LG packet failed CRC
check", self.desc)
CommsDataCorruption: LG LX325/PM325: LG packet failed CRC check

Variables by last 8 frames, innermost last

Frame __bootstrap in C:\Program Files\Python23\lib\threading.py
at line 442
self = <WorkerThread(BitPim helper, started daemon)>

Frame run in C:\projects\bitpim\gui.py at line 167
e = <common.CommsDataCorruption instance at
0x03425490>
res = None
self = <WorkerThread(BitPim helper, started daemon)>
item = (<gui.Request instance at 0x03425850>,
<gui.Callback instance at 0x034257D8>)
call = <gui.Request instance at 0x03425850>
ex = <common.CommsDataCorruption instance at
0x03425490>
resultcb = <gui.Callback instance at 0x034257D8>
first = 0

Frame __call__ in C:\projects\bitpim\gui.py at line 114
self = <gui.Request instance at 0x03425850>
args = ()
d = Keys []
{}
kwargs = Keys []
{}

Frame senddata in C:\projects\bitpim\gui.py at line 1681
count = 0
self = <WorkerThread(BitPim helper, started daemon)>
args = [{'phonebook':
{'c65411d061100e8af992c98194158271f1759cda': {'serial1': 27, 'gro
xx = (<bound method WorkerThread.writephonebook of
<WorkerThread(BitPim helper, start
dict = Keys ['categories', 'groups', 'phonebook',
'ringtone-index', 'speeddials', 'uniqueserial', 'wallpaper-index']
{'phonebook':
{'c65411d061100e8af992c98194158271f1759cda': {'serial1': 27, 'grou
func = <bound method WorkerThread.writephonebook of
<WorkerThread(BitPim helper, starte
todo = [(<bound method WorkerThread.writephonebook
of <WorkerThread(BitPim helper, star
desc = 'Phonebook'

Frame writephonebook in C:\projects\bitpim\gui.py at line 1698
self = <WorkerThread(BitPim helper, started daemon)>
data = Keys ['categories', 'groups', 'phonebook',
'ringtone-index', 'speeddials', 'uniqueserial', 'wallpaper-index']
{'phonebook':
{'c65411d061100e8af992c98194158271f1759cda': {'serial1': 27, 'grou

Frame savephonebook in C:\projects\bitpim\com_lgpm325.py at line
357
existingpbook = Keys [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
{0: {'serial1': 22, 'number': 22, 'name':
'Zoran Nikolic'}, 1: {'serial1': 21, '
pbook = Keys
['031d519a3fcfa4c740afb7d3f688bdb87f1d32d7',
'207e7340bf9c645b5a5acc861e4bd0e2bf4926f8',
'27b1c360e0cfcfdca4ec41ca1ab36f75ef25b446',
'2b5304d0c999368a6a385c129caf6c3cacf3bd2b',
'3013ca64c889dbfe143ce2415236e7a506e88642',
'45b3bd08ba9ada59811bd0c58a350da9dac0b4bb',
'4b206ec53190004b34c5ac4942f1e00202c1f86b',
'53874d0de67d68d0eee10be43a5461bd1d422c01',
'54bc3132fdd2a9a5ac90fc13ba319ef13d34fe25',
'59d2e8d89ac1366de720a09adf39454b9ad6c6b8',
'5f664f22ac095cfb2dd882050820c06332f543b5',
'74596931fdfd93a05ae6c175e3f514bc368b841a',
'748f2166908cd438f37f99c77cd4325ce83a8ff9',
'7ae337e9a66c17b103171b838b9b79d99ebabfbf',
'7f9ce6e2f5370694adb48106a06126c4417612eb',
'8715f40904c608d0e267f715b57ae3dbd6c66bdf',
'952665a1903c97bc11b2ce531a85d58d572d50c6',
'96c5f5a8a0ae0057975d220f8e622efc431a4e3a',
'9ecea2adc6af3ad12fc053e3b85f47bdf06c5364',
'ab44caeeccf33b6b95c494c7afb82c3fc86d80a8',
'ab5228bec92325a5acf7ccf00231ef38ebe315fc',
'c4956d70f2281fedb777aad719f150603820e917',
'c65411d061100e8af992c98194158271f1759cda',
'd734864cee774f320e23763a11078c7deb8785c5',
'd99a3dae08a0bd7b9ad05955883dc419ab6fcc5c',
'daa1d3117ba5e266cf697028cbb11553c2ceb766',
'f21315c490d2a14f1c6ebcdee5f7970d13927708',
'f3dfccf6bd73e636c5b13c5a4eccc9b24d4a0b1d',
'f7068bd6b16d32d0745179c34d49e02091cfd337',
'f9216b11041edd55b4515ecee860f7d297b4a378']
{'c65411d061100e8af992c98194158271f1759cda':
{'serial1': 27, 'group': 0, 'name':
req = <p_lgpm325.pbupdateentryrequest object at
0x03429110>
keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 2
i = 25
res = <p_lg.pbupdateentryresponse object at
0x0344BAB0>
self = <com_lgpm325.Phone instance at 0x0341CD00>
counter = 26
progressmax = 89
data = Keys ['categories', 'groups', 'phonebook',
'ringtone-index', 'speeddials', 'uniqueserial', 'wallpaper-index']
{'phonebook':
{'c65411d061100e8af992c98194158271f1759cda': {'serial1': 27, 'grou
serialupdates = [({'sourcetype': 'bitpim', 'id':
'7ae337e9a66c17b103171b838b9b79d99ebabfbf'}, {'
ii = Keys ['bitpimserial', 'emails', 'group',
'memo', 'name', 'numbers', 'numberspeeds', 'numbertypes', 'ringtone',
'secret', 'serial1', 'url', 'wallpaper']
{'serial1': 4, 'group': 0, 'name':
'Concepcions', 'url': '', 'memo': '', 'wallpa
item = '74596931fdfd93a05ae6c175e3f514bc368b841a'
numexistingentries = 29
existingserials = [22, 21, 20, 19, 18, 17, 16, 15, 29, 14, 13,
1, 12, 11, 10, 9, 8, 28, 7, 6, 5, 2
progresscur = 55
entry = <p_lgpm325.pbentry object at 0x0341E070>
serial = 2
dellist = []
loop = xrange(29)

Frame sendpbcommand in C:\projects\bitpim\com_lg.py at line 121
origdata =
'\x14\xff\x04\x92\x01\x04\x00\x00\x00n\x02\x19\x00\x00\x00Co\x00\xe1\xdd
~'
d = 1
responseclass = <class 'p_lg.pbupdateentryresponse'>
buffer = <prototypes.buffer instance at 0x03425300>
data =
'\xff\x04\x92\x01\x04\x00\x00\x00n\x02\x19\x00\x00\x00Co\x00'
callsetmode = True
firsttwo = '\xff\x04'
request = <p_lgpm325.pbupdateentryrequest object at
0x03429110>
crc = '\xe1\xdd'
calccrc = '\x802'
self = <com_lgpm325.Phone instance at 0x0341CD00>
Brent Roettger
2005-12-07 16:18:53 UTC
Permalink
<html><div style='background-color:'><DIV class=RTE> <P>Phil,</P> <P>I am sorry that it messed up your phonebook.&nbsp; I have never seen the CRC error and I have syched my pm325 about a hundred times.&nbsp; Did you retry syncing after turning your phone off and back on again?</P> <P>All - what could cause this CRC error?&nbsp; is it a bad data cable or dirty connector?</P> <P>regards,</P> <P>Brent<BR><BR></P></DIV> <DIV></DIV> <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #a0c6e5 2px solid; MARGIN-RIGHT: 0px"><FONT style="FONT-SIZE: 11px; FONT-FAMILY: tahoma,sans-serif"> <HR color=#a0c6e5 SIZE=1> <DIV></DIV> <P>From:&nbsp;&nbsp;<I>"Baltz, Philip" &lt;***@ti.com&gt;</I><BR>Reply-To:&nbsp;&nbsp;<I><A href="mailto:bitpim-***@lists.sourceforge.net">bitpim-***@lists.sourceforge.net</A></I><BR></P> <P>&gt;I tried bitpim 8.0.4 developer release on my LG 325.&nbsp;&nbsp; I was able to<BR>&gt;download phonebook data from the phone.&nbsp;&nbsp;I added a new entry and then<BR>&gt;tried to upload the phonebook.&nbsp;&nbsp;The only option available was to replace<BR>&gt;all data instead of just the new entry.&nbsp;&nbsp;The update started and received<BR>&gt;the below exception.&nbsp;&nbsp;This garbled my phonebook: deleting some entries<BR>&gt;and mixing data from others.<BR>&gt;<BR>&gt;-phil<BR>&gt;<BR>&gt; An unexpected exception has occurred.<BR>&gt; CommsDataCorruption: LG LX325/PM325: LG packet failed CRC check<BR></P></FONT></BLOCKQUOTE></div></html>
Stephen Wood
2005-12-07 16:28:14 UTC
Permalink
Brent:

I would suggest that you ask Philip to send you (privately) a complete dump
of the protocol log so that you can see what happened leading up to the
exception (did it fail on the first entry, or somewhere in the middle, was
there something unusual about the entry on which it failed?). Also, you
could ask for a copy of his bitpim data directory so that you could try
sending his phonebook to your phone to see if it is a particular issue with
his data.

Stephen
Phil,
I am sorry that it messed up your phonebook. I have never seen the CRC
error and I have syched my pm325 about a hundred times. Did you retry
syncing after turning your phone off and back on again?
All - what could cause this CRC error? is it a bad data cable or dirty
connector?
regards,
Brent
------------------------------
Post by Baltz, Philip
I tried bitpim 8.0.4 developer release on my LG 325. I was able to
download phonebook data from the phone. I added a new entry and then
tried to upload the phonebook. The only option available was to replace
all data instead of just the new entry. The update started and received
the below exception. This garbled my phonebook: deleting some entries
and mixing data from others.
-phil
An unexpected exception has occurred.
CommsDataCorruption: LG LX325/PM325: LG packet failed CRC check
------------------------------------------------------- This SF.net email
is sponsored by: Splunk Inc. Do you grep through log files for problems?
Stop! Download the new AJAX search engine that makes searching your log
files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click_______________________________________________ BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Baltz, Philip
2005-12-07 16:29:23 UTC
Permalink
________________________________

From: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of Brent
Roettger
Sent: Wednesday, December 07, 2005 10:19 AM
To: bitpim-***@lists.sourceforge.net
Subject: RE: [BitPim-devel] updated code for the LG PM325



Phil,

I am sorry that it messed up your phonebook. I have never seen
the CRC error and I have syched my pm325 about a hundred times. Did you
retry syncing after turning your phone off and back on again?

All - what could cause this CRC error? is it a bad data cable
or dirty connector?

regards,

Brent


It didn't mess up the phone bad. I just had to edit some entries and
re-add a few. That's what development is all about. Fortunately the
entries were saved in bitpim history so the data was easy to find.

I did reconnect and was able to download the phonebook data again, but
when I tried to upload I still got the same error. So in summary I
downloaded multiple times (3 or 4) successfully, but two upload attempts
failed with the same results.

-phil
Baltz, Philip
2005-12-07 16:38:49 UTC
Permalink
________________________________

From: bitpim-devel-***@lists.sourceforge.net
[mailto:bitpim-devel-***@lists.sourceforge.net] On Behalf Of Stephen
Wood
Sent: Wednesday, December 07, 2005 10:28 AM
To: bitpim-***@lists.sourceforge.net
Subject: Re: [BitPim-devel] updated code for the LG PM325


Brent:

I would suggest that you ask Philip to send you (privately) a
complete dump of the protocol log so that you can see what happened
leading up to the exception (did it fail on the first entry, or
somewhere in the middle, was there something unusual about the entry on
which it failed?). Also, you could ask for a copy of his bitpim data
directory so that you could try sending his phonebook to your phone to
see if it is a particular issue with his data.

Stephen



Stephen,

I can answer a few of these questions. I was able to upload several
entries before it failed. The two times I attempted the upload it
failed on different entries so I don't think it was an unusual entry
problem.

Brent,

I'd be happy to send whatever you need to debug this.

-phil

Loading...