Bluetooth control raspberry pi

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

The first official release of the easiest and fastest script to manage your Raspberry Pi Bluetooth. A state of the art shell script 🙂

License

cbusuioceanu/Raspberry-Pi-Bluetooth-Manager

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Raspberry Pi Bluetooth Manager aka RPiBTman

The first official release of the easiest and fastest script to manage your Raspberry Pi Bluetooth. A state of the art shell script 🙂

Raspberry Pi Bluetooth Manager, aka RPiBTman, helps you manage your bluetooth devices connected to and from RPi. It has a lot of fail safe features so, even if you are a total beginner, you can’t break anything. Not unintentionally 😄

Running this script the first time, you will see a notification that will tell you this is the first time running it. That notification will show up only once. There are two «if’s» that can change the notification behaviour: 1. If you decide to remove the script config file, the notification will appear again. 2. If the first time config process fails. No need to worry about any of these.

The most important functions of this script (for the moment)
👑 Receive/Give Internet from your phone/tablet/laptop etc to your Raspberry Pi
👑 Transmit Internet from your Raspberry Pi to any device via Bluetooth
What can you do with Raspberry Pi Bluetooth Manager?
✔️ List available BT controllers ✔️ View Bluetooth status ✔️ Show paired BT device info
✔️ Turn bluetooth on/off ✔️ Select default BT controller ✔️ View Discoverable status
✔️ Trust/Untrust BT devices ✔️ Make bluetooth discoverable on/off ✔️ Set/Reset BT controller alias (name)
✔️ View pairable status ✔️ Block/Unblock BT devices ✔️ Make bluetooth pairable on/off
✔️ List scanned/paired BT devices ✔️ Scan for BT devices ✔️ Remove BT devices
✔️ Check needed dependencies ✔️ Configure network bridge ✔️ Configure ISC-DHCP-SERVER
✔️ Configure iptables ✔️ Configure services ✔️ Disconnect devices
Читайте также:  Геймпад икс бокс блютуз

You’ll need a Raspbery Pi 3 or a Raspberry Pi 4 with Raspbian OS (32 or 64bit) to use this script. If this is the first time you use this, stay close: the setup is fully automated!

git clone https://github.com/cbusuioceanu/Raspberry-Pi-Bluetooth-Manager.git rpibtman && cd rpibtman && sudo bash rpibtman.sh

The first time configuration of the system & script will start. Make sure the configuration ends cleanly and you are redirected to the Main Menu of the script. Main Menu has detailed options and is pretty simple for everyone. I will also detail everything here.

LEGEND: BT=Bluetooth; devs=Devices;

  • 1. Available BT controllers -> list them
  • 2. Select default BT controller -> e.g. if you have for example the RPi BT controller and a USB one, choose one of them
  • 3. Set/Reset BT controller alias -> change the broadcast name of your Pi bluetooth or reset it to default (raspberry)
  • 4. List scanned/paired BT devices -> list scanned or paired bluetooth devices with RPi
  • 5. Bluetooth status -> is controller on or off
  • 6. Discoverable status -> is discoverability on or off
  • 7. Pairable status -> is pairability on or off
  • 8. Receive Internet from phone -> give your Raspberry Pi an Internet connection from your Smartphone/Tablet/Smartwatch etc
  • 9. Transmit Internet from RPi -> give your smart devices an Internet connection from RPi
  • 10. Scan for Bluetooth devices -> start scanning for local active bluetooth devices
  • 11. Show paired BT device info -> view your paired bluetooth devices info
  • 12. Trust/Untrust BT devices -> trust/untrust a paired bluetooth device
  • 13. Block/Unblock BT devices -> block/unblock a paired bluetooth device
  • 14. Remove BT device -> remove a paired bluetooth device
  • 15. Disconnect BT device -> disconnect a device from your RPi
  • q. Exit
  • 4s. List scanned BT devs -> directly list scanned devices via menu 4
  • 4p. List paired BT devs -> directly list paired devices via menu 4
  • 50. Bluetooth off -> turn bluetooth off
  • 51. Bluetooth on -> turn bluetooth on
  • 60. Discoverable off -> turn rpi discoverable off
  • 61. Discoverable on -> turn rpi discoverable on
  • 70. Pairable off -> turn rpi pairing off
  • 71. Pairable on -> turn rpi pairing on

You can use this any time but all of these steps will be automatically run at first time config.

  • c1. Check dependencies
  • c2. Config Bridge
  • c3. Config ISC-DHCP-SERVER
  • c4. Config iptables
  • c5. Config services

About

The first official release of the easiest and fastest script to manage your Raspberry Pi Bluetooth. A state of the art shell script 🙂

Источник

How to setup and connect to other devices using Bluetooth on Raspberry Pi

You want to enjoy your free time by listening to some good music on Bluetooth handsfree, but you don’t know how to connect these Bluetooth headsets to your Raspberry Pi, then no worries this write-up will solve your problem by explaining the procedure of setting up the Bluetooth devices with Raspberry Pi.

What is a Bluetooth device

Bluetooth is a wireless technology that connects the different devices on a particular wavelength with each other and the data is transferred between these devices. The Bluetooth devices can be connected with each other if they are in the range of 30 meters but when the obstacles come between the devices like walls then this range may be decreased. This is the secure way to transfer data between two devices and can be used to connect mobiles, laptops, or peripheral devices like headsets and keyboards.

Читайте также:  Asus как отключить bluetooth

How to setup Bluetooth on Raspberry Pi using the terminal

It is considered a good practice that whenever you start the Raspberry Pi OS, first update as well as upgrade all the packages of the repository of Raspberry Pi using the command:

After making sure that all the packages are up to date, we will find the status of our Bluetooth service using the command:

In the output, it is cleared that the Bluetooth service is in active status, we can stop the service of Bluetooth using the command:

Again check the status of Bluetooth service using the systemctl command:

To start the Bluetooth service, we will execute the command in the Raspberry Pi terminal:

In order to find out the name of our Bluetooth through the terminal, we will use the command:

In the above output, we can see that the name of our Bluetooth device “hci0”, using this name, we will scan the devices that are in the range of our Bluetooth:

The “DESKTOP-BSDBLIB” is the device to which we want to connect and its MAC address is E4:A4:71:79:78:D5, we will initialize the Bluetooth by using the command:

Once we are in the Bluetooth environment, we will turn on the Bluetooth module using the command:

Once again scan nearby Bluetooth devices which are in the range of our Bluetooth:

Pair the device with MAC address E4:A4:71:79:78:D5 by using the trust command:

Connect the device using its MAC address:

If you want to disconnect the Bluetooth device, execute the command:

How to setup Bluetooth on Raspberry Pi using the GUI

Another way to connect the Bluetooth device is much more convenient as it is GUI (graphical user interface) based, click on the Bluetooth icon on the right top of the screen and a drop-down menu will appear, select the “Add Device”:

Click on the device to which you want to connect through Bluetooth and click on the “Pair” button, in our case the device is “DESKTOP-BSDBLIB”:

The device will be added, a red cross is showing the device is not yet connected, click on the added device, another menu will appear to choose the “Connect”:

The red color icon will turn into the green color which indicates the device is connected successfully:

For disconnection, again click on the device and choose “Disconnect” to disconnect the device with Raspberry Pi:

Conclusion

Bluetooth technology is very popular nowadays, to connect various devices such as wireless headsets, and speakers. One of the reasons behind the popularity of these Bluetooth devices is that they are easy to handle as they do not contain a mess of wires with them. In this write-up, setting up the Bluetooth devices on Raspberry Pi has been explained through the command-line interface as well as the graphical user interface.

About the author

Hammad Zahid

I’m an Engineering graduate and my passion for IT has brought me to Linux. Now here I’m learning and sharing my knowledge with the world.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Читайте также:  One touch bluetooth глюкометр

clopresti/rpi-bluetooth

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Using Bluetooth With The Raspberry Pi

The following instructions show how to setup and use a USB Bluetooth adapter with the Raspberry Pi. Please note that these instructions only apply to the latest Raspbian Jessie distribution. If you are using a different distribution or an older Raspbian build such as Wheezy some of the instructions will need to be changed as the Bluetooth stack and utilities have changed with the Jessie release and BlueZ 5.23.

A lot of the instructions I found online were relating to the older wheezy builds and it took some extra time to find the correct way to do things with Jessie. There were also a few configuration changes that needed to be made in order to work around some known issues/bugs relating to the RFCOMM (serial over Bluetooth) communication on the Pi. I have documented all this and hopefully I can save you some time if you are trying to do a similar things.

I am using a USB Bluetooth 4.0 adapter with a Broadcom BCM20702 chipset but there are many other supported Bluetooth adapters including those with CSR (Cambridge Silicon Radio) chipsets. I tested on a Raspberry Pi 2 but all this should work with any version of the Raspberry Pi as long as you are running the latest Raspbian Jessie distribution.

First make sure your Pi is up to date:

> sudo apt-get update > sudo apt-get upgrade > sudo rpi-update > sudo reboot 

Insert your USB Bluetooth adapter into one of the USB ports on the Pi and enter:

You should see output similar to the following:

If you used an adapter with a different chipset like CSR you might see ‘Cambridge Silicon Radio’ insead of ‘Broadcom Corp’. If you do not see something similar to this it might mean that there is something wrong with your adapter or it is not recognized/supported.

Next install the bluez and bluetooth manager packages:

> sudo apt-get install bluetooth blueman bluez python-gobject python-gobject-2 

Now you can check you your adapter state:

You should see output similar to the following:

BD Address: XX:XX:XX:XX:XX:XX UP RUNNING PSCAN ISCAN 

The [XX:XX:XX:XX:XX:XX] part is the MAC address of your Bluetooth adapter If you do not see «UP RUNNING» enter the following to turn on Bluetooth:

Part 2. Paring and Connecting Devices

Start the command line Bluetooth manager

You should see a line similar to:

Controller XX:XX:XX:XX:XX:XX raspberrypi [default] 

‘raspberrypi’ is the default name you will see when pairing/connecting to the Pi from other devices

Источник

Оцените статью
Adblock
detector