Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Bluetooth in Python

bluetooth python raspberry pi

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1 Bob2580

Bob2580

    CC Lurker

  • New Member
  • Pip
  • 9 posts

Posted 19 October 2014 - 08:05 AM

Hi guys,

 

I was trying to learn something about bluetooth in python, but there is just so less on the internet.

I want to make a programm that looks a bit like this:

 

If my phone is connected to the raspberry pi, then print: hello

If my phone is NOT connected to the raspberry pi, then print: bye

 

Could anyone help me with this ?

 

Thanks !

Bob



#2 JonElias

JonElias

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 201 posts

Posted 19 October 2014 - 02:06 PM

Python bluetooth libary:
https://code.google.com/p/pybluez/

The documentation on that libary:
https://code.google....i/Documentation

Tutorial:
http://people.csail....rt/bluez-intro/
Google pybluez tutorial

In the documentation you will find an example called inquiry.py
You need to use it to search for your phone
Then if the name of the phone you find matches with your phone say hello, but that is when you are neaeby not connected to the raspberry

You will probably find what you need in
Those links
"computers are useless they only give you answers" Pablo Picasso
And yes he was alive when the first programmable computer was made

#3 JonElias

JonElias

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 201 posts

Posted 20 October 2014 - 08:06 AM

Did you get the answer you needed
"computers are useless they only give you answers" Pablo Picasso
And yes he was alive when the first programmable computer was made




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download