Coder Social home page Coder Social logo

bluetooth-connection's Introduction

Bluetooth-connection

Bluetooth ๐ŸŒ

Bluetooth is a wireless technology standard managed by the Bluetooth Special Interest Group (SIG) and with IEEE 802.15.1 standard. Used for the exchange of data between fixed and mobile devices over short distances using UHF radio waves of short wavelength of 2,400 to 2,485 GHz, widely used to build personal area networks (PAN).

Basic steps ๐Ÿ“–

These instructions allow you to communicate the two raspberry pi3, through bluetooth technology.

1. Mac Address ๐Ÿ“‹

We have to know the bluetooth addresses or the mac address of each device.

For this we go to the terminal and type the command

hciconfig

For my example the MAC of my first raspberry will be B8: 27: EB: 6A: E1: BD and the second raspberry will be B8: 27: EB: FC: 72: 30.

2.RFCOMM โš™๏ธ

Now we must configure the rfcomm.com file.

For that, we use the command:

sudo nano /etc/bluetooth/rfcomm.conf

After executing this command, we will modify the file as follows (On each device):

rfcomm1{
        bind yes;
        device MAC;
        channel 1;
        comment "Bluetooth"  
    }

โš NOTE: Where it says MAC, we will replace with the address we found earlier.

Install library ๐Ÿ“‚

On each device, uses Bluez for Linux. We are going to install the library that will allow us serial communication, by the following command in the terminal

sudo apt-get install bluez python-bluez

โš NOTE: Taken from Rfcomm y PyBluez

Scripts ๐Ÿ“„

We need to use the two scripts in this repository, one is going to pretend to be a gas station and the other will be a car.

โš NOTE: Run the Station script first and then the car script.

1. Station โ›ฝ

The script execution command of the station is:

python GasStation.py

2. Car ๐Ÿš—

The script execution command of the car is:

python CarGasStation.py

Finally ๐Ÿ“ฆ

After this, we can modify the scripts according to what we need. Here we can configure the connection form and even the protocols

Author โœ’๏ธ

  • Nico Patalagua - Repository - Github

If you liked this repostory ๐ŸŽ

  • Share it ๐Ÿ“ข
  • Invite me a beer ๐Ÿบ
  • Improve it ๐Ÿค“.

By ๐Ÿ“Œ

NicoPatalagua ๐Ÿ˜Ž

bluetooth-connection's People

Contributors

nicolasuarez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.