Remote GPIO control over Bluetooth | Raspberry Pi 4

  Рет қаралды 28,099

MAKERDEMY

MAKERDEMY

Күн бұрын

Join our email list by clicking on the link below for free technology-related reports, educational content, and deals on our courses.
sendfox.com/makerdemy
Remote GPIO control over Bluetooth
In this video, we are going to learn how to control the GPIO pins of the Raspberry Pi 4 wirelessly using Bluetooth from an Android smartphone, and later you will be given an activity to build a remote-control robot using the blue dot library.
(If you liked this video and would like to buy our course, you are in for a pleasant surprise. Please click on the link below to buy the course for $25 ONLY. Original price is $195.
utm.io/upAv)
We are going to use a nifty Bluetooth library called Blue Dot, to establish remote control between the raspberry pi and the smartphone. This library also provides functions to control one Raspberry PI from another Raspberry Pi. The Blue dot library uses a client-server model to establish communication. The BlueDot class inside the library creates a Bluetooth server, on the server device, that is the Raspberry Pi, and the Blue Dot application installed on the client device will connect to this server via Bluetooth Communication. The transmission of data from client to server or server to the client is a simple stream of data. No acknowledgments or data is sent in response to commands when using the Blue dot library.
Now, let's install the Bluedot library. Open the terminal and first type
sudo apt install python3-dbus
This module is a prerequisite for working with the bluedot library. This library provides an abstraction layer for the bluedot library to do inter-process communication for the Bluetooth interface.
Now enter the following to install bluedot
sudo pip3 install bluedot
If your Raspbian OS version, already has bluedot, it is always a good thing to check for any updates and upgrade it using the following command
sudo pip3 install bluedot - - upgrade
The next step is to Pair your raspberry pi to the android phone. Go to your android device’s settings, and inside the Bluetooth configuration menu, make your device discoverable and then enable the Bluetooth. Now go to your Raspberry Pi Desktop and click the Bluetooth icon and select “Make discoverable”, then click “Add device”. Your phone will appear in the list, select it and enter a pin code for pairing. Now on the android phone, enter the same pin code when prompted and touch “Ok”.
You have now successfully paired your phone with the Pi. Now go to the play store in your android phone and search for the Blue dot app. Install the one made by martin, and open the app. It will ask for permission to use Bluetooth. Please accept it. Now you can see our Pi on the list of connected devices. Select it, and you can see a blue dot.
The Blue Dot is a joystick as well as a button. You can tell if the dot was pressed in the middle, on the top, bottom, left or right. The app can send the information of the exact relative position of touch within the dot to your Pi via the Bluetooth. We are going to leverage this data incoming to implement wireless projects using the Raspberry Pi.
First, let’s control an LED using Bluetooth. Wire up a Red LED on the breadboard, with a current limiting resistor, and connect it to the GPIO Pin 17 as we did in the last section. Now, in the Thonny IDE, open the Bluetooth LED.py file from the repository and run the code. Now, on your Blue Dot app, if you press the blue dot, the LED will become ON. It will be ON till you release the blue dot in the app. In the code, we have imported the BlueDot Class from the Bluedot module with the first command. This class consists of all the methods also known as APIs, that allow us to establish and communicate with the client device.
Summary
In this video, we have covered the following topics
● Setting up the Pi with the Blue Dot Library
● Implementing GPIO Control over Bluetooth
● Remote Controlled Robot Project
"For Blue Dot Application to work, you must follow a specific sequence of steps in a particular order, which is not mentioned in the video. You can download the document to these steps here"
docdro.id/10dQewX
(If you liked this video and would like to buy our course, you are in for a pleasant surprise. Please click on the link below to buy the course for $25 ONLY. Original price is $195.
utm.io/upAv)
Check us out on
Website : makerdemy.com
Catalogue : makerdemy1.teachable.com
Facebook : / makerdemy
Twitter : / makerdemy
LinkedIn : / makerdemy
Instagram : / makerdemy
Email : support@makerdemy.com

Пікірлер: 25
@astronut3830
@astronut3830 4 жыл бұрын
Very good video, your explenations apper as very followable to me. Keep up this clean and great quality.
@MAKERDEMY
@MAKERDEMY 3 жыл бұрын
Thank you very much!
@RBotics
@RBotics 2 жыл бұрын
Very good video. Excelent work!
@MAKERDEMY
@MAKERDEMY 2 жыл бұрын
Thank you very much!
@HarishKumarC007
@HarishKumarC007 3 жыл бұрын
Hello, I found that it is using client and server architecture,could it be done using serial data transmission which is done in Arduino microcontrollers
@MAKERDEMY
@MAKERDEMY 3 жыл бұрын
Hi Harish Kumar, Yes, it is possible. We have covered UART, SPI, and I2C Implementation in the course along with Projects for each Implementation. You can find the course link in the description if you are interested in working with Raspberry Pi 4. Thank You.
@jakeflores517
@jakeflores517 2 жыл бұрын
Hi, when I try to use the sudo pip3 install bluedot command, it tells me that it could not find a version that satisfies the requirement bluedot or no matching distribution found for bluedot. Did I do something wrong?
@MAKERDEMY
@MAKERDEMY 2 жыл бұрын
Hi, Kindly type “sudo pip3 install BlueDot” in place of “sudo pip3 install bluedot”
@smashthonypro6830
@smashthonypro6830 4 жыл бұрын
When ever I open bulluedot on my phone I get an error that it can't connect
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
Hi Samshthony, If you read the official documentation of Bluedot here: bluedot.readthedocs.io/en/latest/pairpiandroid.html You can see that they have mentioned that you may face connection error prompts, and you should ignore them and continue if the initial pairing was done successfully. Please, move on to the implementation part and observe the working. Thank You
@aimiliospetroulas7812
@aimiliospetroulas7812 4 жыл бұрын
@@MAKERDEMY i face the same issue, when i select my raspberrypi in the blue dot app the blue dot doesnt appear and i i get a "unable to connect" message. How can i ignore it and do the led test without pressing the blue dot?
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
Hi Amilios Petorulas, To test the LED, you have to select the Blue Dot, as this project works on the BlueDot Library. When we implemented this, we used to get the "unable to connect" message, but the BlueDot used to appear after some time, and we were able to continue with the Project. Due to the COVID lockdown situation, we are unable to test the latest version on the hardware, to rule out any new bugs. We will get back to you, once we get a change to test out the project again, with the latest version of the library and app. Meanwhile you can try this out: github.com/BehindTheSciences/Raspberry-Pi-Bluetooth-GPIO-Control. We hope this was helpful. Thank You
@nczioox1116
@nczioox1116 2 жыл бұрын
Can this be done from a laptop?
@MAKERDEMY
@MAKERDEMY 2 жыл бұрын
The Blue Dot app can be installed on laptops as well. We are sharing a link to download Blue Dot on laptop : napkforpc.com/apk/com.wcg.driver.app.mobile/
@commandgames4857
@commandgames4857 4 жыл бұрын
Hi
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
Hello Command Games
@jeffegg2
@jeffegg2 4 жыл бұрын
don't have android. can this use iphone?
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
Hi jeffegg2, As of now the bluedot library is not compatible with the iOS. From our research on the App Store for iOS, there are only general purpose BLE/Bluetooth apps. This means that while you can indeed connect your Pi to you iOS device and establish two-way communication, it will not be as easy as using the bluedot library. You might want to check out the Bluepy Python library that has good documentation. You should also check out these resources: medium.com/@superlopuh/raspberry-pi-ios-communication-in-bluetooth-c7599e257f2 raspberrypi.stackexchange.com/questions/51134/connect-an-iphone-to-a-pi-3b-with-bluetooth-low-energy learn.adafruit.com/pibeacon-ibeacon-with-a-raspberry-pi/overview We hope this was helpful. Thank You
@smashthonypro6830
@smashthonypro6830 4 жыл бұрын
Im a little confused on how to run the script
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
Hi Smashthony Pro, In this video, we have used the Thonny Python Editor to run our code. First, pause the video at 3:53, and refer the code and type it in a python file created by the Thonny IDE. Once the code is saved, you may click the green "Run" icon on the menu bar. Once it is running, the Bluedot service will get enabled in the background, then you can control the LED with the Bluedot App, once paired and connected. Thank You
@me0and0the0piano
@me0and0the0piano 3 жыл бұрын
what if you have an iphone?
@MAKERDEMY
@MAKERDEMY 2 жыл бұрын
Hi. Apologies for superlate response. As of now the bluedot library is not compatible with iOS. From our research on the App Store for iOS, there are only general purpose BLE/Bluetooth apps. This means that while you can indeed connect your Pi to your iOS device and establish two-way communication, it will not be as easy as using the bluedot library. You might want to check out the Bluepy Python library that has good documentation. You should also check out these resources: medium.com/@superlopuh/raspberry-pi-ios-communication-in-bluetooth-c7599e257f2 raspberrypi.stackexchange.com/questions/51134/connect-an-iphone-to-a-pi-3b-with-bluetooth-low-energy learn.adafruit.com/pibeacon-ibeacon-with-a-raspberry-pi/overview We hope this was helpful.
@stevesixpence738
@stevesixpence738 4 жыл бұрын
Anyone else think he sounds a little like Jauffrey from Oblivion?
@MAKERDEMY
@MAKERDEMY 3 жыл бұрын
😊
@MAKERDEMY
@MAKERDEMY 4 жыл бұрын
"For Blue Dot Application to work, you must follow a specific sequence of steps in a particular order, which is not mentioned in the video. You can download the document to these steps here" docdro.id/10dQewX
Top 10 Uses for a Raspberry Pi (400th EC video!)
11:24
ExplainingComputers
Рет қаралды 237 М.
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
That's how money comes into our family
00:14
Mamasoboliha
Рет қаралды 10 МЛН
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 5 МЛН
Control ANY COMPUTER with these Pi KVMs!
17:46
Jeff Geerling
Рет қаралды 801 М.
12 NEW Raspberry Pi Projects you must try!!!
8:38
ToP Projects Compilation
Рет қаралды 539 М.
How To Reverse Engineer A Bluetooth Device
11:53
Hacking Modern Life
Рет қаралды 43 М.
Basic usage of the Raspberry Pi GPIO pins
13:44
Engineer Man
Рет қаралды 95 М.
Tutorial: Control Raspberry Pi GPIO via HTTP Web Server
7:19
Software Sage
Рет қаралды 58 М.
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН