Discussion:
[Bitpim-devel] Building the usb library
mdell
2004-07-31 19:39:11 UTC
Permalink
I was hoping to get a little help with this.

I am trying to identify why I cannot communicate with my phone using bitpim when I can with other Software. Specifically SnapSync.
It appears as though the mask and timeout values are different when SnapSync communcates with the phone as oppased to Bitpim.
To this end I have downloaded the software required to test the bitpim code as per the web page http://bitpim.sourceforge.net/developer.html

However my problem is that I am using a FutureDial USB to Serial cable with the latest drivers.

When I try to communicate via the bitpim code I get several errors. I assume this means that I need to Build the usb library.
On the web page it says to run the relevant build script, however I only see build.bat.

It seems to want to run programs that I do not have: pexports, dlltool, and gcc.
I managed to find a version of pexports on the web, however I am not sure that I have the necessary version. I am also having difficulty finding dlltool or gcc.

I do have a c++ compiler on my machine Microsoft Visual C++ 6.0, but I am usure as to how to change the build script to make it work, or to do it manually.

It has actually been a while since I have spent a significant amount of time programming in C++.
I do program in other languages. VB, .NET, and multiple scripting languages. I am also just beginning my experiences with python.

By the way I am running Microsoft Windows 2000 on my machine.

Again I believe my problem is with trying to Build the usb library.

Any help that can be provided would be of great help.

Shaggie
Roger Binns
2004-08-01 00:58:20 UTC
Permalink
Post by mdell
I am trying to identify why I cannot communicate with my phone
using bitpim when I can with other Software. Specifically SnapSync.
It appears as though the mask and timeout values are different when
SnapSync communcates with the phone as oppased to Bitpim.
You should start by posting what your phone is, and what the symptoms
are. Also what is a mask? On the user list I posted how to change
the timeout BitPim uses.
Post by mdell
When I try to communicate via the bitpim code I get several errors.
I assume this means that I need to Build the usb library.
On the web page it says to run the relevant build script, however I only see build.bat.
That is the relevant build script. However you are chasing up the
wrong alley. USB to serial cables include a chip that does the
conversion and speak their own protocol. BitPim does not support
that protocol and you have to use the device drivers with your
operating system and BitPim then talks to the device as a regular
comm port.
Post by mdell
It seems to want to run programs that I do not have: pexports,
dlltool, and gcc. I managed to find a version of pexports on the
web, however I am not sure that I have the necessary version.
I am also having difficulty finding dlltool or gcc.
It is all part of mingw/msys.
Post by mdell
Again I believe my problem is with trying to Build the usb library.
Not even close.

Read this:

http://www.catb.org/~esr/faqs/smart-questions.html

Roger
mdell
2004-08-01 08:05:20 UTC
Permalink
Post by Roger Binns
Post by mdell
I am trying to identify why I cannot communicate with my phone
using bitpim when I can with other Software. Specifically SnapSync.
It appears as though the mask and timeout values are different when
SnapSync communcates with the phone as opposed to Bitpim.
You should start by posting what your phone is, and what the symptoms
are. Also what is a mask? On the user list I posted how to change
the timeout BitPim uses.
Sorry. My phone is an AudioVox 8600 on the Bell Mobility network.

I used portmon from sysinternals to monitor the communication with the phone
to try to determine why SnapSync can communicate, but bitpim can't.
The following is what portmon specifies that I referred to as a mask.
0.00000950 SnapSync.exe IOCTL_SERIAL_SET_WAIT_MASK fd_dmdm0 SUCCESS
Mask:RXCHAR

I found your log about changing the comm timeout & it worked once using
bitpim. I determined that it was because I done done something with my
computer while last using snapsync that left my phone in offline mode.
I removed the timeout setting and bitpim still worked. Once I power cycled
the phone it no longer worked again. I have found a workaround of ending
the snapsync process while it is communicating with the phone.

According to PortMon, that setting allows me to change one of the timeout
values, but what about the others. (See RC)
0.00000223 bitpim.exe IOCTL_SERIAL_SET_TIMEOUTS fd_dmdm0 SUCCESS RI:0 RM:0
RC:15000 WM:0 WC:0
Post by Roger Binns
Post by mdell
When I try to communicate via the bitpim code I get several errors.
I assume this means that I need to Build the usb library.
On the web page it says to run the relevant build script, however I only see build.bat.
That is the relevant build script. However you are chasing up the
wrong alley. USB to serial cables include a chip that does the
conversion and speak their own protocol. BitPim does not support
that protocol and you have to use the device drivers with your
operating system and BitPim then talks to the device as a regular
comm port.
I had originally thought the same thing, but I received an error that
mentioned the comm port when I tried to run the code.
I was then thinking that possibly because the cable plugs into a USB port on
the computer that I would need to run the USB build script.
Post by Roger Binns
Post by mdell
It seems to want to run programs that I do not have: pexports,
dlltool, and gcc. I managed to find a version of pexports on the
web, however I am not sure that I have the necessary version.
I am also having difficulty finding dlltool or gcc.
It is all part of mingw/msys.
I had actually found mingw/msys shortly before your reply, but was not sure
that was the correct tool.

I think it would be useful if this was mentioned on the web page
http://bitpim.sourceforge.net/developer.html
Everything else that is needed is mentioned & even where to get it. I
easily could do a google search if i knew what the recommended tool I should
search for is.

Since you say my problem is not with needing to build the usb library, I
will post my exact problem with running the bitpim code as "Communication
Error running code with USB to Serial Cable"

Mark
Roger Binns
2004-08-01 09:07:32 UTC
Permalink
Post by mdell
The following is what portmon specifies that I referred to as a mask.
0.00000950 SnapSync.exe IOCTL_SERIAL_SET_WAIT_MASK fd_dmdm0 SUCCESS
Mask:RXCHAR
That is just how they deal with knowing when the incoming data is
complete (analogous to when BitPim waits for the ~ ending each
packet).
Post by mdell
timeout values, but what about the others. (See RC)
0.00000223 bitpim.exe IOCTL_SERIAL_SET_TIMEOUTS fd_dmdm0 SUCCESS RI:0
RM:0 RC:15000 WM:0 WC:0
That is a 15 second timeout.
Post by mdell
I had originally thought the same thing, but I received an error that
mentioned the comm port when I tried to run the code.
I was then thinking that possibly because the cable plugs into a USB
port on the computer that I would need to run the USB build script.
Nope. The USB support in BitPim is of little value on Windows.
libusb-win32 can only provide access to a USB device if there
is already a driver installed for it. If there is a driver
then BitPim sending USB packets is pointless. It is of great
value on Linux and Mac since they have drivers for USB modems,
but not for the diagnostics interfaces on LG phones.

However this really doesn't matter in your case since the Audiovox
phones only use a single interface and you have drivers for it
on Windows, and have to use drivers on Linux and Mac.
Post by mdell
I think it would be useful if this was mentioned on the web page
http://bitpim.sourceforge.net/developer.html
In general you are expected to get the normal version of BitPim
working first and then worry about trying to hack the code.
Trying to hack the code when you don't have something that already
works is not going to be very productive.
Post by mdell
Everything else that is needed is mentioned & even where to get it. I
easily could do a google search if i knew what the recommended tool I
should search for is.
It will be in this groups archives now.
Post by mdell
Since you say my problem is not with needing to build the usb
library, I will post my exact problem with running the bitpim code as
"Communication Error running code with USB to Serial Cable"
And all those masks etc are red herrings. The issue will come down
to what baud rates are used and what characters are sent.

I have recently received an Audiovox CDM8410 to play with and
so will be investigating with that. There may be something
extra these models need that the CDM 8900 didn't.

I did also notice that the CDM 8900 is very fussy about exactly
when it will communicate. Various combinations of when the
cable is plugged in, the phone being powered on, and the flip
being open or shut can result in it refusing to talk, or my
favourite of it shutting down if you pull the cable out.

Roger
Roger Binns
2004-08-01 09:23:38 UTC
Permalink
Post by Roger Binns
I have recently received an Audiovox CDM8410 to play with and
so will be investigating with that. There may be something
extra these models need that the CDM 8900 didn't.
When using a straight USB cable, it just works. When using a
USB to serial cable I had to change a setting in the phone.

##7678 [end]
choose option 2 (data)
choose RS232C

Roger
mdell
2004-08-03 00:55:55 UTC
Permalink
That code has no affect on my CDM 8600.
I have looked and have not found an equivalent code for my phone.


----- Original Message -----
From: "Roger Binns" <***@rogerbinns.com>
To: <bitpim-***@lists.sourceforge.net>
Sent: Sunday, August 01, 2004 5:23 AM
Subject: Re: [Bitpim-devel] Re: Audiovox and USB to serial
Post by Roger Binns
Post by Roger Binns
I have recently received an Audiovox CDM8410 to play with and
so will be investigating with that. There may be something
extra these models need that the CDM 8900 didn't.
When using a straight USB cable, it just works. When using a
USB to serial cable I had to change a setting in the phone.
##7678 [end]
choose option 2 (data)
choose RS232C
Roger
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Bitpim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
mdell
2004-08-02 23:01:11 UTC
Permalink
My phone is an AudioVox 8600 on the Bell Mobility network.

I used portmon from sysinternals to monitor the communication with the phone
to try to determine why SnapSync can communicate, but bitpim can't. Bitpim
just times out, and setting the timeout value in the registry has no effect.
It does change the RC value.

Some of the Data recorded by portmon from Bitpim for the port is this
0.00000196 bitpim.exe IOCTL_SERIAL_SET_TIMEOUTS fd_dmdm0 SUCCESS RI:0 RM:0
RC:3000 WM:0 WC:0
0.00000782 bitpim.exe IOCTL_SERIAL_SET_WAIT_MASK fd_dmdm0 SUCCESS Mask: ERR

Where the data recorded by portmon from SnapSync is this.
0.00001201 SnapSync.exe IOCTL_SERIAL_SET_WAIT_MASK fd_dmdm0 SUCCESS Mask:
RXCHAR
0.00000196 SnapSync.exe IOCTL_SERIAL_SET_TIMEOUTS fd_dmdm0 SUCCESS RI:-1
RM:0 RC:1000 WM:0 WC:0

I am only showing the data that I notice is different. You will also notice
that bitpim sets the mask after where SanpSync sets it before. I have also
seen the WM value set to 1 and 2 before.

I was told that the Mask is irrelevant, however the fact that it appears as
though the bitpim Mask is ERR makes me wonder.

I also noticed that Snapsync soemtimes does a purge.
0.00000531 SnapSync.exe IOCTL_SERIAL_PURGE fd_dmdm0 SUCCESS Purge: RXABORT
RXCLEAR

I have determined that Bitpim can communicate with the phone. If I start
SnapSync and then end the Process while the Phone is offline, bitpim can
then communicate with the phone.

In an attempt to solve this problem myself I have downloaded the bitpim code
& other needed software as directed to on
http://bitpim.sourceforge.net/developer.html
When I try to communicate via the bitpim code I get this list of errors.


Traceback (most recent call last):
File "C:\Projects\bitpim\gui.py", line 152, in run
res=call()
File "C:\Projects\bitpim\gui.py", line 92, in __call__
return apply(self.method, self.args+args, d)
File "C:\Projects\bitpim\gui.py", line 1199, in dirlisting
self.setupcomm()
File "C:\Projects\bitpim\gui.py", line 1112, in setupcomm
configparameters=comcfg)
File "C:\Projects\bitpim\commport.py", line 59, in __init__
self._openport(self.port, *self.params)
File "C:\Projects\bitpim\commport.py", line 88, in _openport
self.ser=serial.Serial(useport, baud, timeout=timeout,
rtscts=hardwareflow, xonxoff=softwareflow)
File "C:\Python23\Lib\site-packages\serial\serialutil.py", line 132, in
__init__
self.port = port
File "C:\Python23\Lib\site-packages\serial\serialutil.py", line 177, in
setPort
self.portstr = self.makeDeviceName(port)
File "C:\Python23\Lib\site-packages\serial\serialwin32.py", line 164, in
makeDeviceName
return device(port)
File "C:\Python23\Lib\site-packages\serial\serialwin32.py", line 30, in
device
return r'\\.\COM%d' % (portnum+1)
TypeError: coercing to Unicode: need string or buffer, int found

Variables by last 8 frames, innermost last

Frame dirlisting in C:\Projects\bitpim\gui.py at line 1199
path = ''
self = <WorkerThread(BitPim helper, started daemon)>
recurse = 0

Frame setupcomm in C:\Projects\bitpim\gui.py at line 1112
name = u'COM3'
self = <WorkerThread(BitPim helper, started daemon)>
autofunc = None
comcfg = {'baud': 115200, 'hardwareflow': 0, 'softwareflow': 0,
'retryontimeout': 0, 'tim
klass = <class commport.CommConnection at 0x01D6BE10>

Frame __init__ in C:\Projects\bitpim\commport.py at line 59
baud = 115200
autolistargs = (<module 'com_othercdma' from
'C:\Projects\bitpim\com_othercdma.pyc'>,)
self = <commport.CommConnection instance at 0x01E25120>
hardwareflow = 0
autolistfunc = None
timeout = 9
logtarget = <WorkerThread(BitPim helper, started daemon)>
configparameters = {'baud': 115200, 'hardwareflow': 0, 'softwareflow': 0,
'retryontimeout': 0, 'tim
softwareflow = 0
port = u'COM3'

Frame _openport in C:\Projects\bitpim\commport.py at line 95
baud = 115200
dummy = 0
useport = u'\\\\?\\COM3'
description = None
self = <commport.CommConnection instance at 0x01E25120>
hardwareflow = 0
timeout = 9
softwareflow = 0
port = u'COM3'

Frame __init__ in C:\Python23\Lib\site-packages\serial\serialutil.py at line
132
parity = 'N'
baudrate = 115200
bytesize = 8
self = (Exception occurred printing value)
xonxoff = 0
rtscts = 0
timeout = 9
stopbits = 1
port = u'\\\\?\\COM3'

Frame setPort in C:\Python23\Lib\site-packages\serial\serialutil.py at line
177
was_open = False
port = u'\\\\?\\COM3'
self = (Exception occurred printing value)

Frame makeDeviceName in C:\Python23\Lib\site-packages\serial\serialwin32.py
at line 164
self = (Exception occurred printing value)
port = u'\\\\?\\COM3'

Frame device in C:\Python23\Lib\site-packages\serial\serialwin32.py at line
30
portnum = u'\\\\?\\COM3'





Your help in determining the cause of my errors with the software is greatly
appreciated.

Mark
mdell
2004-08-04 02:45:30 UTC
Permalink
I should have mentioned that I am looking for help in determining why I am
getting the error running the bitpim code.

Loading...