manniru / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

OBEX file transfer speed #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've created a simple app to push a file to phones using blucove obex
(version 2.0.3) and I did speed test using both native obex file
transferring systems(mac osx and ubuntu) and my simple java app....

the result is (transferring 4MB large file to Nokia N95):
using my app ~ 3min(in mac) 2min(in linux)
using native program ~ 40sec(in both operating systems)

this is code that I wrote:

Connection connection = Connector.open(_connectionURL);

ClientSession cs = (ClientSession)connection;
HeaderSet hs = cs.createHeaderSet();

cs.connect(hs);

InputStream is = new FileInputStream(file);
byte filebytes[] = new byte[is.available()];
is.read(filebytes);
is.close();

hs = cs.createHeaderSet();
hs.setHeader(HeaderSet.NAME, file.getName());
hs.setHeader(HeaderSet.TYPE, fileType);
hs.setHeader(HeaderSet.LENGTH, new Long(filebytes.length));

Operation putOperation = cs.put(hs);

DataOutputStream outputStream = putOperation.openDataOutputStream();
outputStream.write(filebytes);

outputStream.close();
putOperation.close();
cs.disconnect(null);
connection.close();
connection = null;

Those times are acceptable?
or there is any improvement to do? or another better way to transfer files
using bluecove?

thanx for advance.
ishan.

Original issue reported on code.google.com by ishanf@gmail.com on 2 Dec 2008 at 4:05

GoogleCodeExporter commented 9 years ago
Can you read the file into buffer of 1K and send only proportions, Not complete 
4MB
as one array?

Also try: http://www.bluecove.org/bluecove-examples/obex-install/index.html
Just drag and drop the file to the running application.  The app is using 
Buffers of
256 characters.

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 4:20

GoogleCodeExporter commented 9 years ago
how can i do that? can you give me any reference or sample code please?
thanx...

ishan.

Original comment by ishanf@gmail.com on 2 Dec 2008 at 4:35

GoogleCodeExporter commented 9 years ago
http://bluecove.googlecode.com/svn/trunk/bluecove-examples/obex-install/src/main
/java/net/sf/bluecove/obex/ObexBluetoothClient.java

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 4:54

GoogleCodeExporter commented 9 years ago
thanx...
i tried to use buffer option, but that take also same time to transfer... 
however i
tried to use "uuid" both 1105 and 1106... it's same for both...

have you any idea?
any way thank you very much...

ishan.

Original comment by ishanf@gmail.com on 2 Dec 2008 at 5:29

GoogleCodeExporter commented 9 years ago
There is bluecove-tester
http://www.bluecove.org/bluecove-examples/bluecove-tester/index.html

Can you install it on device as Midlet start the services and  from PC run the 
Speed
test.  What are the numbers you are getting.  This is just should test just 
RFCOMM speed.
See my number:  
http://www.bluecove.org/bluecove-examples/bluecove-tester/speed.html

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 5:42

GoogleCodeExporter commented 9 years ago
well... sorry if i described badly...
main goal of my app is to send a file to device without using any midlet on it, 
so it
uses device-os file receiving function. therefore times may be different from 
your
numbers. isn't it?

ishan. 

Original comment by ishanf@gmail.com on 2 Dec 2008 at 6:05

GoogleCodeExporter commented 9 years ago
I want to identify the problem. So I want exclude all the variables first.

If you want to help then it would be appreciated.

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 7:21

GoogleCodeExporter commented 9 years ago
well.. these are my testing result convert to bit/s

Mac OSX --> N95 (without midlet): 173,333 bit/s
Linux/Ubuntu (BlueZ) --> N95 (without midlet): 260,000 bit/s

i didn't use any midlet on device, these result is same for both "OBEX File 
Transfer
Profile" (uuid:1106) and "OBEX Object Push Profile" (uuid:1105).

i did those tests on MacOSX and Ubuntu installed MacBook, using simple obex file
transferring app that i described above.

these speeds seems to be very slow respect for operating-system (OSX or Linux) 
native
obex file transfer programs.

i got same result also using "avetanaBluetooth" library.

so, i need to, is it a problem bind with java bluetooth libraries and other 
libraries
or a problem in my implementation ?

Thanx

ishan.

Original comment by ishanf@gmail.com on 2 Dec 2008 at 8:56

GoogleCodeExporter commented 9 years ago
For OS X  the 173,333 bit/s is the best we can get with current implementation.

As to Ubuntu. Do you have Linux/Ubuntu under VMWare in OSx? I would expect 
better
results. I got  660,000 bit/s while sending to Sony Ericson.

But any way this is the numbers I observed as well. Currently I don't know if I 
can
speed the thing up...

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by skarzhev...@gmail.com on 2 Dec 2008 at 9:08

GoogleCodeExporter commented 9 years ago
no, it(ubuntu) isn't under virtual machine... any way i used ubuntu 8.10 with 
bluez
3.7 and bluecove-2.0.3/bluecove-gpl-2.0.3.

Original comment by ishanf@gmail.com on 2 Dec 2008 at 9:45

GoogleCodeExporter commented 9 years ago
Tested using BlueCove WIDCOMM to Nokia 5310
2MB in 87 sec - > 200,000 bit/sec

Tested using BlueCove WIDCOMM to SE K790
2MB in 75 sec - > 213,000 bit/sec

Tested using BlueCove MS Stack to BlueCove WIDCOMM
2MB in 154 sec - > 103,000 bit/sec

Tested using BlueCove MS Stack to SE K790
2MB in 131 sec - > 121,000 bit/sec

Original comment by skarzhev...@gmail.com on 3 Dec 2008 at 4:56

GoogleCodeExporter commented 9 years ago
Also I used Native WIDCOMM to SE K790  43 sec for the same 1,955K  file

And I remember a way to make BlueCove OBEX faster.
-Dbluecove.obex.mtu=40000
Or create a file bluecove.obex.mtu  
see http://code.google.com/p/bluecove/wiki/Documentation
Default MTU is 1024

BlueCove WIDCOMM to SE K790
1,955K completed in 53 sec 297,190 bit/s
(MTU selected 4096)

BlueCove WIDCOMM to Nokia 5310
1,955K completed in 51 sec 312,890 bit/s
(MTU selected 32767)

Original comment by skarzhev...@gmail.com on 3 Dec 2008 at 6:41

GoogleCodeExporter commented 9 years ago
Thank u very much...

i could improve the file transferring speed changing MTU as u described.
for example these are the numbers that i got:

Nokia 6131, MTU: 1024, 370813 bit/s 
Nokia 6212, MTU: 1024, 347393 bit/s 
Nokia N95, MTU: 1024, 272746 bit/s

Nokia 6131, MTU: 4096, speed: 785770 bit/s
Nokia 6212, MTU: 4096, speed: 891956 bit/s 
Nokia N95, MTU: 4096, speed: 804936 bit/s 

thanx again...
ishan.

Original comment by ishanf@gmail.com on 3 Dec 2008 at 10:24

GoogleCodeExporter commented 9 years ago
The last results are from Linux I believe?

Original comment by skarzhev...@gmail.com on 3 Dec 2008 at 1:58

GoogleCodeExporter commented 9 years ago
yap linux/ubuntu installed on macbook, using bluez 3.x and bluecove 2.0.3

Original comment by ishanf@gmail.com on 3 Dec 2008 at 2:05