Re: bluetooth file transfer in python



On 12 Feb, 10:50, chartsoft <charts...@xxxxxxxxx> wrote:
I am a teacher and need to set up a computer with a bluetooth dongle
to poll for mobile phones with bluetooth switched on in the area then
send them a jpg file.

I guess you'd use OBEX to send the file, specifically using the "push"
mode of OBEX. Various tools such as hcitool and sdptool (found on GNU/
Linux distributions) and their counterparts exposed by Python
libraries such as PyBluez [1] would be appropriate for scanning for
devices.

I understand that python is capeable of this.

1.) is it worth learning python to do this or can someone out there do
it for me for a v small fee?

2.) If I am going to do it can anyone give me pointers in the best way
to do it so I do not spend hours wasting time.

I've previously done OBEX-related things, mostly fetching things from
mobile phones, using the obexftp program [2] which is part of the
OpenOBEX project [3]. Naturally, you can call the obexftp program from
Python and interpret the responses and exit codes using functions in
the os, popen2 and subprocess modules. I believe that obexftp also
supports "push" mode, but you could probably find something else
related to OpenOBEX if it does not.

Since Bluetooth communications are supported using sockets in GNU/
Linux distributions and in Python (provided that the Bluetooth support
is detected and configured), you could communicate with phones using
plain network programming, but this would probably require you to
implement the OBEX protocols yourself - not a straightforward task for
a number of reasons, including one I mention below. Thus, it's
probably easier to go with obexftp at least initially.

There are a number of awkward things with obexftp and OpenOBEX,
however. Some phones do not follow the "standards" and the maintainer
of OpenOBEX wouldn't or just didn't include support for various
deviating Sony Ericsson phones, for example, thus requiring me to
patch the library myself. Although there may be a Python wrapper for
OpenOBEX, it's easier to just call obexftp as mentioned above, but
this means that you're limited to what that program can do.

Finally, and most significantly, OBEX isn't a totally free standard:
if you didn't already get the standards documents while they were
freely available, you now have to sign up with the quaintly named
Infrared Data Association [4] - a "pay to play" organisation with
restrictive redistribution terms on their specifications. Although I'd
recommend that anyone doing brand new stuff with mobile devices just
uses real standards instead of OBEX, I doubt that you have the choice.

Anyway, I hope that this helps you understand the subject area a bit
more.

Paul

P.S. It does also occur to me that desktop environments like KDE have
Bluetooth controls which could be automated in some way in order to
send files, but I haven't investigated this at all.

[1] http://org.csail.mit.edu/pybluez/
[2] http://triq.net/obexftp.html
[3] http://dev.zuckschwerdt.org/openobex/
[4] http://www.irda.org/
.



Relevant Pages

  • Re: Verizon BlueTooth
    ... >> enable them you can't call them bluetooth... ... >> All I wanted was full obex which now comes on razr's, ... >> crippled it intentionally by turning off the full functionality thats ... alot of the specs would have no function or usefullness on ...
    (alt.cellular.verizon)
  • Re: Time for a new phone
    ... less if you use Bluetooth to any extent... ... The BlueTrek didn't suit ... Sony Ericsson 'phones it's dog-slow. ... lookup system Motorola still insist on using. ...
    (uk.rec.motorcycles)
  • Re: [Full-disclosure] Bluetooth DoS by obex push [CORRECTED]
    ... Bluetooth, we discovered a simple but effective DoS attack using OBEX push. ... We confirmed the attack to work on the following phones: ... This could be easily extended to target all visible devices. ...
    (Full-Disclosure)
  • Re: Safari will not start
    ... Where would those other bluetooth property files be, ... I haven't lost a single setting with any of the mobile phones that are paired with my two machines and 5 systems! ... That has nothing at all to do with settings like whether or not ask for password on wake up / screen saver is checked, and the selected screen saver module! ... Desktop picts or screensavers haven't changed on any of the machines I've served, neither has preset login informations of any kind. ...
    (comp.sys.mac.apps)
  • Re: OBEX?
    ... this context, when people say "OBEX", they mean the File Transfer ... This profile is what several VZW Bluetooth ... neither VZW phone can initiate a transfer, this is why two VZW phones ...
    (alt.cellular.verizon)