Help needed, new python Obex implementation

143 views
Skip to first unread message

Manuel Naranjo

unread,
Jun 1, 2010, 1:23:41 PM6/1/10
to openpr...@googlegroups.com
Hello guys,

I modified a package called PyOBEX to make it async, now I need your
help to test it.

If you're willing too then you need to install python-bluetooth package
(check your distro instructions) and grab this package
http://groups.google.com/group/openproximity/web/async_PyOBEX.zip

Then do
unzip async_PyOBEX.zip
cd PyOBEX/src
python test.py <BT Address> <BT channel> <file name on device> <complete
path to file on disk>

You can get the bluetooth address by running: hcitool scan, then the bt
channel by running:
sdptool browse <BT Address>

The channel you need to use is the one which says "obex object push" 0x1105

If you can help then please test it with as many cellphones as possible
and test 4 situations: Non available, Reject, timeout and accept. Start
in range then go out of range might fail, need to test that.

Please mail me your results. BTW this should work even on ARM as there's
no native code other than Python socket library and Python bluetooth
binding which are all ready available on most distros.

Cheers,
Manuel

manu.polline

unread,
Jun 1, 2010, 7:35:52 PM6/1/10
to Open Proximity
With my Nokia :

On Reject i get :
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x962aeac>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}

and for many times i get always the same answer ( and i dont' get any
message on my cell)
----> It isn't OK

on Ignored i get :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x889beec>}
error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
----> It's OK

on Non available i get :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x8784eac>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
----> It's OK

On My HTC :

connecting rfcomm
connect_ex
callback () {}
connected rfcomm () {}
sending 7
data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
195 3 3
callback () {'response': <PyOBEX.responses.UnknownResponse instance at
0x8ead4ec>}
connected obex <PyOBEX2.asyncoop.Client object at 0x8ea8aec>
<PyOBEX.responses.UnknownResponse instance at 0x8ead4ec>
Traceback (most recent call last):
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncsocket.py", line
144, in poll_pending_read
i.read_ready(len(i.read_buffer))
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncsocket.py", line
50, in read_ready
self.__read_ready(self, *args, **kwargs)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line
104, in data_ready
self.internal_callback(response=response)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line 53,
in internal_callback
return self.callback(*args, **kwargs)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line 43,
in callback
self.__callback(self, *args, **kwargs)
File "test.py", line 17, in callback
client.put(sys.argv[3], file(sys.argv[4], 'rb').read())
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line
242, in put
max_length = self.remote_info.max_packet_length
AttributeError: UnknownResponse instance has no attribute
'max_packet_length'
----> It isn't OK

That's all for now

Manuel



Manuel Naranjo

unread,
Jun 1, 2010, 9:26:00 PM6/1/10
to openpr...@googlegroups.com
Manuel,
> With my Nokia :
>
Which Nokia? I tested a 5530 and a 6311 (or so)

> On Reject i get :
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x962aeac>}
> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>
> and for many times i get always the same answer ( and i dont' get any
> message on my cell)
> ----> It isn't OK
>
This is OK, it's the same than my test. I don't get why you say it's not
right.

> on Ignored i get :
>
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x889beec>}
> error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
> ----> It's OK
>

Good same as I do.


> on Non available i get :
>
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x8784eac>}
> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
> ----> It's OK
>

Good, what about success?

> On My HTC :
>
> connecting rfcomm
> connect_ex
> callback () {}
> connected rfcomm () {}
> sending 7
> data_ready 3
> BluetoothAsyncSocket.recv 3 0 3
> pending 0
> BluetoothAsyncSocket.recv 0 0 0
> pending 0
> 195 3 3
> callback () {'response':<PyOBEX.responses.UnknownResponse instance at
> 0x8ead4ec>}
> connected obex<PyOBEX2.asyncoop.Client object at 0x8ea8aec>
> <PyOBEX.responses.UnknownResponse instance at 0x8ead4ec>
>

ok not good, I will add more debugging information. Which HTC are you
testing? Which OS is it running?

Manuel

Manuel Naranjo

unread,
Jun 2, 2010, 11:00:42 AM6/2/10
to openpr...@googlegroups.com
Manuel,

> ok not good, I will add more debugging information. Which HTC are you
> testing? Which OS is it running?
>
Would you mind testing this new version
http://groups.google.com/group/openproximity/web/async_PyOBEX_2.zip

And sending me the output.

Manuel

manu.polline

unread,
Jun 2, 2010, 11:06:25 AM6/2/10
to Open Proximity
Hi Manuel

> Which Nokia? I tested a 5530 and a 6311 (or so)
The nokia is 2323-c2

> This is OK, it's the same than my test. I don't get why you say it's not
> right.
because on my cell after the first reject no message appear if i try
to run test.py again and again.
After some minute i start test.py again and the message appear.

> Good, what about success?
It's work good on all my phone

> ok not good, I will add more debugging information. Which HTC are you
> testing? Which OS is it running?
the HTC is htc 3g touch with Windows Mobile OS

Manuel

Manuel Naranjo

unread,
Jun 2, 2010, 11:12:13 AM6/2/10
to openpr...@googlegroups.com
Manuel,

>> This is OK, it's the same than my test. I don't get why you say it's not
>> right.
>>
> because on my cell after the first reject no message appear if i try
> to run test.py again and again.
> After some minute i start test.py again and the message appear.
>
A cellphone setting I guess then. Good to know.

>> Good, what about success?
>>
> It's work good on all my phone
>
So you get <PyOBEX.responses.Success instance at 0xb703464c> as one of
the last lines?

>> ok not good, I will add more debugging information. Which HTC are you
>> testing? Which OS is it running?
>>
> the HTC is htc 3g touch with Windows Mobile OS
>
>

Ok good please test the new code, I'm worried about the not known
response, are you asked for any pairing on this cellphone when you do
obex push?

Manuel

manu.polline

unread,
Jun 2, 2010, 12:47:09 PM6/2/10
to Open Proximity
Hi Manuel,

On Nokia 3600 slide :

on rejected :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x9749eec>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}

and it do the same as the nokia 2323-c2 but after the second
"rejected"

on Ignored :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x9030f2c>}
error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}

on Accepted:

data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
160 3 3
decode A0 00 03
callback (<PyOBEX.responses.Success instance at 0x845cf2c>,) {}
uploaded completed

on Non Avalaible :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x93fdeec>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}

p.s IMPORTANT : with this cell on the last openproximity2 devel
versione i get always : "Failed to retrieve services"

With Nokia 2323-c2:

on Rejected :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x8e92eec>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}

and now after the SECOND reject no message appear if i try
to run test.py again and again.
After some minute i start test.py again and the message appear.

on accepted:

data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
160 3 3
decode A0 00 03
callback (<PyOBEX.responses.Success instance at 0x9ebdf2c>,) {}
uploaded completed

on Ignored:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x878af2c>}
error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}

on Non Avalaible :

connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x8cfceec>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}

On My HTC 3g Touch i get the same of the prevuoius test version :

connecting rfcomm
connect_ex
callback () {}
connected rfcomm () {}
sending 7
sending 80 00 07 10 00 FF FF
data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
195 3 3
decode_connection C3 00 03
callback () {'response': <PyOBEX.responses.UnknownResponse instance at
0x9cb75cc>}
connected obex <PyOBEX2.asyncoop.Client object at 0x9cb2b2c>
UnknownResponse C3 3
Traceback (most recent call last):
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncsocket.py", line
148, in poll_pending_read
i.read_ready(len(i.read_buffer))
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncsocket.py", line
50, in read_ready
self.__read_ready(self, *args, **kwargs)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line
104, in data_ready
self.internal_callback(response=response)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line 53,
in internal_callback
return self.callback(*args, **kwargs)
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line 43,
in callback
self.__callback(self, *args, **kwargs)
File "test.py", line 17, in callback
client.put(sys.argv[3], file(sys.argv[4], 'rb').read())
File "/home/manu/Scrivania/PyOBEX/src/PyOBEX2/asyncoop.py", line
242, in put
max_length = self.remote_info.max_packet_length
AttributeError: UnknownResponse instance has no attribute
'max_packet_length'


> A cellphone setting I guess then. Good to know.>> Good, what about success?
Yes maybe, but with this version the massages stop after the SECOND
try

> Ok good please test the new code, I'm worried about the not known
> response, are you asked for any pairing on this cellphone when you do
> obex push?
no pairing

Manuel

Manuel Naranjo

unread,
Jun 2, 2010, 1:15:44 PM6/2/10
to openpr...@googlegroups.com
Manuel,
> on rejected :

> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>
great
> on Ignored :

> error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
>
good

> on Accepted:


> callback (<PyOBEX.responses.Success instance at 0x845cf2c>,) {}
>

perfect

> on Non Avalaible :


>
> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
>

great

> p.s IMPORTANT : with this cell on the last openproximity2 devel
> versione i get always : "Failed to retrieve services"
>

Weird, I test with that cellphone as well.

> With Nokia 2323-c2:
>
> on Rejected :

> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>

> on accepted:


> callback (<PyOBEX.responses.Success instance at 0x9ebdf2c>,) {}
>

> on Ignored:


> error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
>
> on Non Avalaible :

> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
>

exactly the same values I get.

> On My HTC 3g Touch i get the same of the prevuoius test version :
>

> decode_connection C3 00 03
>
Ok this is not good, 0xC3 header in obex means not accepted. Can you use
obexftp with this guy? Can you send me the hcidump -X -V output for this?

>> A cellphone setting I guess then. Good to know.>> Good, what about success?
>>
> Yes maybe, but with this version the massages stop after the SECOND
> try
>

Weird. I have seen some weird things with a broken BT chip I bought a
few weeks ago. It tells you it's trying to connect but the cellphone
never gets the request.

Manuel

Xavi Ramon

unread,
Jun 2, 2010, 5:35:01 PM6/2/10
to Open Proximity
Manuel, this is my results with a NOKIA-6100

On Timeout:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d5698>}
error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}

On Reject:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d5698>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}

On Accepted:
connecting rfcomm
connect_ex
callback () {}
connected rfcomm () {}
sending 7
data_ready 7
BluetoothAsyncSocket.recv 3 0 7
pending 4
BluetoothAsyncSocket.recv 4 0 4
pending 0
160 7 7
callback () {'response': <PyOBEX.responses.Success instance at
0x1d5760>}
connected obex <PyOBEX2.asyncoop.Client object at 0x4028dd10>
<PyOBEX.responses.Success instance at 0x1d5760>
sending 31
data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
144 3 3
data_ready 3
BluetoothAsyncSocket.recv 3 0 3
pending 0
BluetoothAsyncSocket.recv 0 0 0
pending 0
160 3 3
callback (<PyOBEX.responses.Success instance at 0x1d56c0>,) {}
uploaded completed

On No device:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}



Manuel Naranjo

unread,
Jun 2, 2010, 6:02:34 PM6/2/10
to openpr...@googlegroups.com
Xavi,

> Manuel, this is my results with a NOKIA-6100
>
Ok this is pretty similar to mine, only with a better screen. Still S40
based.
> On Timeout:

> error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
>
> On Reject:
> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>
> On Accepted:
> callback (<PyOBEX.responses.Success instance at 0x1d56c0>,) {}
>
> On No device:

> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
>
Great same results I get. Unfortunately we have no results from non
Nokia devices other than the HTC Manu has. I have an examn next Monday
so it's rather complicated for me to go to a mall and run a few tests
(you know this takes lots of time). But we're on the good track.

Cheers,
Manuel

Xavi Ramon

unread,
Jun 2, 2010, 6:18:27 PM6/2/10
to Open Proximity
OK Manuel,
Maybe tomorrow I can do the test with a motorola and samsung, maybe I
need to get my mother's phone and brother's too. :))

Xavi Ramon

unread,
Jun 3, 2010, 4:14:15 PM6/3/10
to Open Proximity
Manuel, this is my test with samsung F480

On Timeout:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}


On Reject:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}


On Accepted:
callback (<PyOBEX.responses.Success instance at 0x1d56c0>,) {}
uploaded completed


On No device:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}

When I ignore the incoming bluetooth message in this phone the time
that the message appears in the phone is short and error is returned


With Motorola W337

On Timeout:
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}


On Reject:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 13: EACCES () {}


On Accepted:
I need to put PIN, I've tried with 1234 and 0000 and all are wrong.



On No device:
connecting rfcomm
connect_ex
err_callback () {'error': <PyOBEX2.common.ErrnoError instance at
0x1d56c0>}
error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}


Regards


On Jun 3, 12:02 am, Manuel Naranjo <man...@aircable.net> wrote:

Manuel Naranjo

unread,
Jun 3, 2010, 4:28:40 PM6/3/10
to openpr...@googlegroups.com
Xavi,

> Manuel, this is my test with samsung F480
>
> On Timeout:
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x1d56c0>}
> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>
Weird it never got the rfcomm connection at all. So we can't distinguish
a timeout from a reject in this case. Not even by timing.

> On Reject:
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x1d56c0>}
> error CONNECTING_RFCOMM Errno error 111: ECONNREFUSED () {}
>

> On Accepted:


> callback (<PyOBEX.responses.Success instance at 0x1d56c0>,) {}
> uploaded completed
>

Good.

> On No device:
> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
>

Good.

> When I ignore the incoming bluetooth message in this phone the time
> that the message appears in the phone is short and error is returned
>

That's up to the cellphone.

> With Motorola W337
>
> On Timeout:
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x1d56c0>}
> error CONNECTING_RFCOMM Errno error 107: ENOTCONN () {}
>

Good.


> On Reject:
> connecting rfcomm
> connect_ex
> err_callback () {'error':<PyOBEX2.common.ErrnoError instance at
> 0x1d56c0>}
> error CONNECTING_RFCOMM Errno error 13: EACCES () {}
>

Good. Just a different errno, but still different from timeout.


> On Accepted:
> I need to put PIN, I've tried with 1234 and 0000 and all are wrong.
>

It's up to your pin manager. Don't know what you set up. This is not
part of the python obex implementation.


> On No device:
> connecting rfcomm

> error CONNECTING_RFCOMM Errno error 112: EHOSTDOWN () {}
>

Yes this should always be the same.


Manuel

Manuel Naranjo

unread,
Jun 4, 2010, 12:32:47 PM6/4/10
to openpr...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages