Discussion:
[Bitpim-devel] wxPython instructions for Debian?
Mike Schiraldi
2004-09-07 02:25:10 UTC
Permalink
If there's anyone on this list who runs Debian and was able to get wxPython
installed in such a way that BitPim can be run from CVS -- and remembers how
they did it -- could you take a look at what i did (detailed at
http://schiraldi.org/bitpim-cvs-howto.html) and tell me what you did
differently?

As i've mentioned in an earlier message, i get stuck at the following
exception:

Traceback (most recent call last):
File "bp.py", line 93, in ?
import gui
File "/tmp/bitpim/gui.py", line 23, in ?
import wx
File "/opt/wx/2.5.2.8/wxPython/wx/__init__.py", line 42, in ?
from wx._core import *
File "/opt/wx/2.5.2.8/wxPython/wx/_core.py", line 4, in ?
import _core_
ImportError: /opt/wx/2.5.2.8/wxPython/wx/_core_.so: undefined symbol:
_ZN5wxApp10InitializeERiPPw

I've determined that it actually is missing all of the following symbols:

_ZN5wxApp10InitializeERiPPw
_ZN12wxStringBase10ConcatSelfEjPKwj
_ZN12wxStringBaseaSEPKw
_ZN12wxStringHash16wxCharStringHashEPKw
_ZN8wxString6PrintfEPKwz
_ZN12wxStringBase8InitWithEPKwjj

Those symbols are defined by an object file which, on my system, is located
at /opt/wx/2.5.2.8/lib/libwx_gtk2u_core-2.5.so. Was this supposed to be part
of my wxPython installation?

I tried export LD_PRELOAD=/opt/wx/2.5.2.8/lib/libwx_gtk2u_core-2.5.so, but
then i ended up with:

python: relocation error: /opt/wx/2.5.2.8/lib/libwx_gtk2u_core-2.5.so:
symbol _ZN18wxMessageOutputLog6PrintfEPKwz, version WXU_2.5 not defined in
file libwx_baseu-2.5.so.2 with link time reference
Roger Binns
2004-09-07 04:46:31 UTC
Permalink
Post by Mike Schiraldi
If there's anyone on this list who runs Debian and was able to get
wxPython installed in such a way that BitPim can be run from CVS --
and remembers how they did it
Here is how I did it.

# apt-get install alien
# apt-get install libgtk2.0-dev freeglut3-dev python2.3-dev
# wget http://voxel.dl.sourceforge.net/wxpython/wxPythonGTK2-py2.3-2.5.2.8-1.src.rpm
# rpmbuild --rebuild wxPythonGTK2-py2.3-2.5.2.8-1.src.rpm
# cd /usr/src/rpm/RPMS/i386
# alien *py2.3*
# dpkg -i *py2.3*.deb

wxPython builds perfectly and BitPim works fine if you do that.

Roger
Mike Schiraldi
2004-09-08 03:39:24 UTC
Permalink
Post by Roger Binns
Here is how I did it.
[...]
wxPython builds perfectly and BitPim works fine if you do that.
Worked great. I've added that to my HOWTOs -- if any other Debian users are
having trouble getting things to work, you can point them to the URLs i've
posted earlier.

I hate to say it, though (because i've seen bitpim-user-no-support.htm), but
i'm having trouble getting the CVS version of BitPim to find my phone. The
RPM version finds it, though. And it's not a matter of code: I even tried
"cvs up -d -r BITPIM_0_7_17" to get my CVS tree to match the codebase used
in my RPM. RPM works, CVS doesn't. I can run one, then the other, going back
and forth without unplugging the phone, and it's the same results each time.

The phone's at /proc/bus/usb/001/013. When i run the RPM version of BitPim,
i see:

===== Available Ports =====
USB Device - Vendor LG Electronics Product VX 4400/4500/4600/6000 Phone
(Interface Diagnostics Interface)
[...]

...and when i select it, it puts usb::001::013::2 in the textbox and i can
browse my phone's file system. But when i run the CVS version, even as root,
i just see:

Automatic
===== Inoperable Ports =====
USB to serial convertor (/dev/ttyUSB0)
USB to serial convertor (/dev/ttyUSB1)
[...]
USB to serial convertor (/dev/ttyUSB9)

If i select "Automatic", it says it can't find a usable port.


Since i know these kinds of problems are hard to debug, and people post
about them to the list all the time, i understand if nobody has time to help
me out with this.. at least now i can run the code, so i can start adding
debug statements and such. But if anyone has any tips, i'd love to hear
them.
Roger Binns
2004-09-08 03:50:36 UTC
Permalink
Post by Mike Schiraldi
Since i know these kinds of problems are hard to debug,
Not in this case. Go to

http://bitpim.org/developer.html

Read the bit titled "Build usb library (optional)"

Roger
Mike Schiraldi
2004-09-12 23:30:18 UTC
Permalink
I'm happy to say that i've now got both the RPM and CVS versions of BitPim
working on my Debian-testing box. If anyone is having trouble with this
specific OS, feel free to contact me for info.

Additionally, the weird bug i was having (where right-clicking on direcories
showed the regular-file context menu) isn't present in the current CVS.

For a while, i was having problems backing up my entire directory tree -- my
CPU would go up to 100%, and after about 180 of 330 files, my throughput
would drop to about 10 bits/sec. I realized this was because i had Protocol
Logging on; turning this off made everything work great. Maybe a warning
should pop up if a user tries to do a full backup with Protocol Logging on
(or a backup of more than n files)

So now i'm getting started figuring out how to add support for my phone, the
LG VX-7000. If there's anyone else interested in participating, let me know.
Roger Binns
2004-09-12 23:39:23 UTC
Permalink
my throughput would drop to about 10 bits/sec. I realized this was
because i had Protocol Logging on; turning this off made everything
work great. Maybe a warning should pop up if a user tries to do a
full backup with Protocol Logging on (or a backup of more than n
files)
I don't have any intention of protecting users from themselves,
except in the default settings. ie the defaults should be sane
and sensible.

Protocol logging is off by default. The help page explicitly says:

http://bitpim.org/testhelp/tab-protocollog.htm

This tab contains detailed information on all data sent to and
received from your phone. It is off by default and needs to be
turned on in the View menu.

This will consume vast amounts of memory and slow your machine down,
so only use it for low level debugging purposes.

The real reason why there is a problem is because the underlying
GTK widget doesn't actually support an AppendText method. What
wxWidgets actually ends up doing is getting the current contents,
adding the new text and then reparsing to find each end of line.
This takes exponentially more time as the contents get larger.
So now i'm getting started figuring out how to add support for my
phone, the LG VX-7000. If there's anyone else interested in
participating, let me know.
Your first step is to make one phonebook entry with every field
set to its maximum length value and get BitPim to read that one
entry (set the phone to be a VX4400). On the other LG phones you
can actually make a backup of the pim directory, clean out all
files in there and reboot the phone. Then do experiments and when
you are finished restore the backup and reboot.

Once you have the one entry dumped, post the hex to this group.

Roger
Mike Schiraldi
2004-09-13 02:30:06 UTC
Permalink
Post by Roger Binns
Your first step is to make one phonebook entry with every field
set to its maximum length value and get BitPim to read that one
entry (set the phone to be a VX4400).
Before wiping out any data (even though i do have it all backed up now), i
thought i'd give it a try with my current phone book. I set my phone type to
4400 and did a Get Phone Data with just "PhoneBook" selected. I got the
following exception. Was that because i didn't follow your directions -- do
you expect it will work if i have just one maxed-out entry in my phonebook?

I could just use the Filesystem browser to back up the files and hexdump
them, right?

21:05:26.585 LG-VX4400: Now in brew mode
21:05:26.648 LG-VX4400: Reading number of phonebook entries
21:05:26.725 LG-VX4400: Now in phonebook mode
21:05:26.894 LG-VX4400: There are 24 entries
21:05:27.165 Exception: An unexpected exception has occurred.
Please see the help for details on what to do.

Traceback (most recent call last):
File "/usr/src/bitpim/gui.py", line 150, in run
res=call()
File "/usr/src/bitpim/gui.py", line 90, in __call__
return apply(self.method, self.args+args, d)
File "/usr/src/bitpim/gui.py", line 1146, in getdata
i[1](results)
File "/usr/src/bitpim/com_lgvx4400.py", line 152, in getphonebook
res=self.sendpbcommand(req, self.protocolclass.pbreadentryresponse)
File "/usr/src/bitpim/com_lg.py", line 128, in sendpbcommand
res.readfrombuffer(buffer)
File "/usr/src/bitpim/p_lgvx4400.py", line 306, in readfrombuffer
self.__field_entry.readfrombuffer(buf)
File "/usr/src/bitpim/p_lgvx4400.py", line 722, in readfrombuffer
self.__field_entrysize.readfrombuffer(buf)
File "/tmp/bitpim/prototypes.py", line 193, in readfrombuffer
raise ValueError("The value read should be a constant of %d, but was %d instead" % (self._constant, self._value))
ValueError: The value read should be a constant of 514, but was 385 instead

Variables by last 8 frames, innermost last

Frame run in /usr/src/bitpim/gui.py at line 140
e = <prototypes.ValueError instance at 0x4350c30c>
res = None
self = <WorkerThread(BitPim helper, started daemon)>
item = (<gui.Request instance at 0x42547eac>, <gui.Callback instance at 0x4323dbec>)
call = <gui.Request instance at 0x42547eac>
ex = <prototypes.ValueError instance at 0x4350c30c>
resultcb = <gui.Callback instance at 0x4323dbec>
first = 0

Frame __call__ in /usr/src/bitpim/gui.py at line 90
self = <gui.Request instance at 0x42547eac>
args = ()
d = {}
kwargs = {}

Frame getdata in /usr/src/bitpim/gui.py at line 1146
count = 1
i = (<bound method GetPhoneDialog.GetPhoneBookSetting of <guiwidgets.GetPhoneDialog;
self = <WorkerThread(BitPim helper, started daemon)>
req = <guiwidgets.GetPhoneDialog; proxy of C++ wxDialog instance at _401a5b08_p_wxDial
willcall = [(<bound method GetPhoneDialog.GetPhoneBookSetting of <guiwidgets.GetPhoneDialog
results = {'sync': {'phonebook': 'MERGE'}, 'wallpaper-index': {1: {'origin': 'builtin', 'n
sync = {'phonebook': 'MERGE'}
st = 0

Frame getphonebook in /usr/src/bitpim/com_lgvx4400.py at line 152
pbook = {}
dupecheck = {}
problemsdetected = False
i = 0
res = <p_lg.pbinforesponse object at 0x425ca46c>
numentries = 24
req = <p_lg.pbreadentryrequest object at 0x43588f2c>
l = [(8, 1), (9, 0), (11, 2), (14, 1), (17, 2)]
result = {'sync': {'phonebook': 'MERGE'}, 'wallpaper-index': {1: {'origin': 'builtin', 'n
buf = <prototypes.buffer instance at 0x4323dc8c>
self = <com_lgvx4400.Phone instance at 0x4323db0c>
speeds = {0: [(8, 1), (9, 0), (11, 2), (14, 1), (17, 2)], 1: [(4, 255), (10, 5)], 3: [(13
sd = <p_lgvx4400.speeddials object at 0x4355460c>

Frame sendpbcommand in /usr/src/bitpim/com_lg.py at line 128
origdata = '\xff\x13\x03\x00\x01\x00\x00\x00\x81\x01\x01\x00\x00\x00\x00\x00Martin\x00\x00\
d = 0
responseclass = <class 'p_lgvx4400.pbreadentryresponse'>
buffer = <prototypes.buffer instance at 0x4350c3ec>
res = <p_lgvx4400.pbreadentryresponse object at 0x435545ec>
callsetmode = True
firsttwo = '\xff\x13'
request = <p_lg.pbreadentryrequest object at 0x43588f2c>
crc = 'gC'
data = '\xff\x13\x03\x00\x01\x00\x00\x00\x81\x01\x01\x00\x00\x00\x00\x00Martin\x00\x00\
self = <com_lgvx4400.Phone instance at 0x4323db0c>

Frame readfrombuffer in /usr/src/bitpim/p_lgvx4400.py at line 306
buf = <prototypes.buffer instance at 0x4350c3ec>
self = <p_lgvx4400.pbreadentryresponse object at 0x435545ec>
dict = {}

Frame readfrombuffer in /usr/src/bitpim/p_lgvx4400.py at line 722
buf = <prototypes.buffer instance at 0x4350c3ec>
self = <p_lgvx4400.pbentry object at 0x4350c24c>
dict = {'sizeinbytes': 2, 'constant': 514}

Frame readfrombuffer in /tmp/bitpim/prototypes.py at line 193
shift = 16
self = <prototypes.UINTlsb object at 0x4350c2ec>
dummy = 1
buf = <prototypes.buffer instance at 0x4350c3ec>
res = 385
Roger Binns
2004-09-13 02:52:21 UTC
Permalink
Post by Mike Schiraldi
I set my phone
type to 4400 and did a Get Phone Data with just "PhoneBook" selected.
I got the
following exception. Was that because i didn't follow your directions -- do
you expect it will work if i have just one maxed-out entry in my phonebook?
Nope, it is because the phonebook entry data structure is different
on almost every model of LG phone. BitPim will fall over on the
very first one. That is why you need to have only one entry and
for that entry to have the maximum sizes on all fields. Turn
on the protocol logging first.

Email the last packet in the log.
Post by Mike Schiraldi
I could just use the Filesystem browser to back up the files and
hexdump them, right?
Nope. We don't access the raw files. We use the LG phonebook
protocol. Run the analyser on examples/vx4400phonebookread.txt
to get an idea of what it should look like.

You should also read http://bitpim.org/papers/phonespecs/

Roger

Loading...