bluetooth file transfer in python

C

chartsoft

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 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.

Many thanks

chartsoft
 
D

Dennis Lee Bieber

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 understand that python is capeable of this.
Uhm... I'm not the one to lay down any laws but...

Bluetooth and WiFi are all matters of the underlying OS, as to how
they appear to application programs.

Python with base libraries doesn't, to my knowledge, have anything
relevant.

http://org.csail.mit.edu/pybluez/
http://org.csail.mit.edu/mode/index.php/Bluetooth_and_Python
http://snippets.dzone.com/posts/show/129

For the most part, once a device is identified, it is a matter of
fairly common network protocols -- file transfer is a version of FTP, I
believe -- finding devices AND BEING ABLE TO PAIR WITH THEM is the key.
Unless the device accepts an attempt to pair, you are out of luck -- so
if the idea is to send a warning graphic to, say, bluetooth phones that
"cheating" by sending data is not wanted, you may be out of luck; the
recipient device may not accept a connection attempt.

--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
P

Paul Boddie

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

python\bluetooth / wsgi / apache 2.2 0
Python Bluetooth 4
File transfer with python 8
File transfer on network 5
file transfer in python 2
Pointers in python? 1
PDF File Code 4
finding bluetooth serial port 2

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top