Bluetooh OBEX file distribution
In the past month quite a number of people contacted me about bulk sending files using OBEX. Bluetooth spamming, bluntly put.
Common goals are mostly:
- small, cheap, low-power, wifi-enabled
- bulk sending, largely in parallel
Here are a few tips on that.
Hardware ————
The common request here is for small form factor, cheap of-the-shelf hardware, optionally battery powered and wifi controlled if possible.
OpenOBEX and ObexFTP support a wide range of platforms. There are prebuilt distributions for well-known open routers like Linksys WRT54G or newer AVM Fritz!Box models. You can as well go with something like a Soekris, NSLU, or alike (openbrick still around?).
- OpenWRT seems to have some support for ObexFTP
- Freetz has a module for ObexFTP
If you’ve got some project in that regard or even prebuilt binaries, let me know!
Software ————
The software requirements are specific to each project. Mostly there are basic requirements like automatic detection and bulk sending. And then, obviously, the capacity to process transfers in parallel.
These two requirements can not be intertwined easily. Automatic proximity detection requires a device inquiry loop which is a lengthy process and ties down bt resources. Upon detection you’ll then need to queue (more on this below) a SDP browse and eventually the file sending. Browsing the devices SDP records will tell you if the device accepts OBEX PUSH and on which service channel it’ll be. You can then decide to start pushing a file to the device.
Even if the software layer will support concurrency your bt hardware most likely will not. You’ll need to process packets in a round-robin fashion for all connections. And there a serious limitations on the number of connections per bt interface — 2-4 concurrent connections are common. A bunch of bt dongles (spaced with e.g. some usb cable!) will improve this. Be advised that threading won’t help you here. The hardware is restricted and threading will get you into lots of trouble like blocking the hardware. Please use an event loop, esp. on low-end hardware this yields consistent and fast processing.
You can roll your own event loop, use a higher language (like e.g. python) to run the event loop or try the GLIB extension and it’s event loop. Users reported success on all of them. I’ve got some work-in-progress patches and C examples for the GLIB event loop, let me know if you are interested in testing and improving those.


Comments
Openwrt packages for openobex and obexftp
Hi!
Possibly of interest to somebody.
I have compiled openobex and obexftp for OpenWRT, kamikaze 8.09.1.
Packages can be found at www.opentelecare.org/Software.html
Cheers!
Rob
library dependencies
You should contact the package maintainer about that. Most likely the bluetooth package was updated without recompiling ObexFTP. If you want to run two dongles you should consider setting up a cross compiler and roll your own program based on ObexFTP. It'll be much easier to do the logic in C than e.g. shell scripts.
Interesting
Hi
thanks for the great post, not gonna spend too much time on threading...;)
I'm trying to do the same with a Linksys NSLU2 with OpenWRT/UnSlung/Debian and a usb hub with 2 or more Bluetooth dondgles.
I have managed to connect to the phone with Debian but couldn't be successful for sending files due to different endians between some libs and NSLU2 CPU.
on the OpenWRT and Unslung we get some errors for obexftp couldn't connect due to missing library "libbluetooth.so.1" but all there is in the packages are "libbluetooth.so" and "libbluetooth.so.2". sym linking wouldn't help.
any Idea for this problem? or maybe any other way to do so?
Commercial solution
Aron, great to hear that. If you like please tell about the hardware/software specs.
(Note that I deleted personal information from your post)
Proximity Marketing (Bluetooth spam)
I'm glad to let You know that the solution for Bluetooth mass sending is already on the market. It's a combined hardware-software solution, with enough Bluetooth chips, so one can keep inquiring while the others do the sending. [Look for Bluefire]
Event loop
Samy,
you can read about event loops on the 'nets, e.g. Wikipedia. It drives every UI and stuff, basicly. As a language choice "C" is fine. And GLIB is a very common OOP library for "C". You might have read about it along the lines of GTK and GNOME.
Have fun and post a link to your project someday :)
Interesting...
Hi!
Quite interesting your article. I'll do my ¿final degree project? about this! My main problem is that I have to use parallel sendings and I thought that threading would help me but it seems not. So, the hard part is to find a way to use the 2-4 connections per bluetooth because I haven't seen anyone yet! How could I do that?
On the other thing, you recommend to use a bunch of dongles so that one can use 4-5 BT * 2-4 connections = ~10-15 connections at once. But threading won't help here as you have said, you recommend to use a higher language (is "C" OK?) and to use an event loop. What do you exactly mean by an event loop? or the GLIB extension?
Well, thanks a lot for your time!
Samy
Post new comment