Upload speed using bluetooth

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: 99jonathan, roger, imaqine

Upload speed using bluetooth

Postby dst » Sat Feb 07, 2009 9:51 pm

Hi,

what kind of upload speed do you get?

I get for a 21832 byte program 37047 milliseconds. That is less than 600 byte per second. Slow...

Cheers,
Dirk
Dirk
dst
Novice
 
Posts: 34
Joined: Tue Dec 30, 2008 4:41 pm
Location: Germany

Postby gloomyandy » Sat Feb 07, 2009 11:14 pm

Hi,
Are those times just for the upload or do they also include the time taken to locate and open the connection? I always tend to use a USB connection for downloads....

Here are some figures I put together a while ago, for raw comms speed...

First I measured the round trip time (or latency), using a simple program
to send a single byte and echo it back. The results are:
USB PC->NXT : 1.8ms
BT PC->NXT : 53.8ms
BT NXT->NXT : 46.6ms
RS485 NXT->NXT rtt: 5.7ms

The second test increased the transmitted data size from 1 byte to 512
bytes with a single byte response. The table below shows the (average)
time taken for a single 512 byte packet with the resultant bandwidth in
brackets:
USB PC->NXT : 5.1ms (100KB/s)
BT PC->NXT : 67.3ms (7.6KB/s)
BT NXT->NXT : 132.4ms (3.9KB/s)
RS485 NXT->NXT 512 + ack: 22.0ms (23.4KB/s)

Finally I tested the transmission of a 512 byte data packet, but without
any form of acknowledgement (so the data was in effect streamed):
USB PC->NXT : 3.9ms (131KB/s)
BT PC->NXT : 26.7ms (19KB/s)
BT NXT->NXT : 45.2ms (11.3KB/s)
RS485 NXT->NXT 512: 19.1ms (26.8KB/s)


Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3635
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby dst » Sun Feb 08, 2009 10:40 am

Hi Andy,

no, I did put the adress into the preferences. If not it takes about 5 seconds more :-(

Dirk
Dirk
dst
Novice
 
Posts: 34
Joined: Tue Dec 30, 2008 4:41 pm
Location: Germany

Postby gloomyandy » Sun Feb 08, 2009 5:01 pm

Hi Dirk,
So your times do include the time to open the connection (but not to perform a search)... On my system (using Lawrie's latest pccomms code that caches Bluetooth addresses, which I think is the same as specifying an address)... I uploaded a program 22757 bytes long in 4094 milliseconds so that is 5.5K/s which is pretty much in line with my test results...

This is with the brick next to my computer and using a Belkin Bluetooth dongle which is a class 1 device (most are class 2).... My upload was from NetBeans (using the standard leJOS nxjupload command)...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3635
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby dst » Mon Feb 09, 2009 4:10 pm

Hi Andy,

I suspect a incompatibility between my dongle and the NXT. Sometimes it works better, sometimes worse...

Anyway, let's close the thread, I now know, that this is a problem in my setup...

Cheers,
Dirk
Dirk
dst
Novice
 
Posts: 34
Joined: Tue Dec 30, 2008 4:41 pm
Location: Germany

Round trip latency ~750ms

Postby mcgann » Fri Dec 11, 2009 6:50 pm

Hi Andy (or anyone else),

This post pertains to expected round-trip latencies over Bluetooth (PC <-> NXT) and why I might be seeing times an order of magnitude slower than your results. I am new to leJOS and Bluetooth.

I am testing the performance of Bluetooth connectivity. This snippet of code from the PC writes an int and reads it back. On the NXT it reads and writes back. No other delays. dos and dis are data output and input streams respectively:

long t0 = System.currentTimeMillis();
dos.writeInt((i*30000));
dos.flush();
dis.readInt();
long t1 = System.currentTimeMillis();
System.out.println("Executed round trip in " + (t1 - t0) + " ms.");

The results are in the 750ms range pretty reliably which is way higher than you were reporting. This is with the brick beside my computer.

I am using Snow Leopard. It is a Broadcom bluetooth device - class 1.

If you have any insight into why these numbers are so high, or if indeed others find similarly high numbers, I owuld be much obliged.

m
mcgann
New User
 
Posts: 4
Joined: Tue Dec 01, 2009 1:12 am
Location: California

Postby gloomyandy » Fri Dec 11, 2009 8:00 pm

Hi,
Is that a one off test or do you run it in a loop? I suspect that sometimes the initial packet is slower. The figures I gave are all for doing a number of round trips and then taking an average... I can certainly confirm the streaming data rate with my PC to NXT as being around 18Kbytes/S as I've recently been doing some work that required greater than 15Kbytes to function. This was on Windows 7 (my previous tests used Windows XP), so it looks like the MS Bluetooth stack works pretty well in both versions.

Other than that sorry can't really help. Perhaps it is the hardware or software you are using?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3635
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Latency

Postby mcgann » Fri Dec 11, 2009 9:17 pm

Hi Andy,

I am running it in a loop - the times are pretty consistent.

Thanks for taking the time.

If anyone has data for a mac stack perhaps they could let me know.

m
mcgann
New User
 
Posts: 4
Joined: Tue Dec 01, 2009 1:12 am
Location: California

Postby gloomyandy » Fri Dec 11, 2009 10:20 pm

Hi,
Just to be sure I've just re-run my test. I basically took the BTSend and BTReceive samples (with BTSend running on the PC), I commented out the code that displays the read data on the NXT and added timing code around the send loop. So the program basically sends an integer and reads back the echo from the NXT, 100 times. On my system this takes 5867ms or 58ms per round trip. Which is pretty much in line with my earlier figures (which used a single byte and more iterations)....

All the best

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3635
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby gloomyandy » Sat Dec 12, 2009 9:45 pm

Hi,
You might find this thread of interest...
http://forums.nxtasy.org/index.php?showtopic=4320

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3635
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff