Тёмный

Raspberry Pi to Android SPP Bluetooth communication 

Mandal TechTV
Подписаться 48
Просмотров 20 тыс.
50% 1

Опубликовано:

 

12 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@vadimpanin1551
@vadimpanin1551 2 года назад
thank god I found you. I was stuck in bluetooth communication in my term project since I had no experience on it. I was about to lose my hope but then god sent you to me. Thank you so much sir. This video will save thousands of lives
@mostafamedhat6840
@mostafamedhat6840 Год назад
Habeeebii 💖💖 .. Many thanks from EGYPT
@TheMalleges
@TheMalleges 3 года назад
Only Tutorial that still works in 2021. Thank you so damn much!
@princser
@princser Год назад
Thanks a lot man !!!!!!!!!! still work in 2023
@noob_coder001
@noob_coder001 8 месяцев назад
still this works in 2024 love you so much😘🤩
@supundasanthakuruppu3496
@supundasanthakuruppu3496 Год назад
Thank you! This was really helpful.
@jmac2543
@jmac2543 2 года назад
Good tutorial. Worked for me.
@michelndjock
@michelndjock 3 года назад
Hi there ! 😊 Thanks for this great video ! I have a project on which I receive serial data from a DHT11 sensor via an Arduino uno connected to my Raspberry Pi 3. The data is a simple string I obtain trough the Serial.println function on the Arduino program. I need my Raspberry Pi 3 to send that data to my android smartphone via Bluetooth the way you did in this video, *except* it has to be continuous (well, at the very least a few times per second, since I need to plot the evolution of temperature or humidity over time on my Android device). How would you recommend I should proceed please? Will I need a python script for that ? (I am totally new to both raspberry and python, but I can try to work something out). Thanks !!
@mandaltechtv5734
@mandaltechtv5734 3 года назад
I would recommend : start by defining a packet size for your data. for example: you can use a two byte packet and use one of the packets for indicating temperature/humidity, the second packet can be used for the value of the parameter you are measuring with Arduino. A byte can store 256 values, if you need to send higher than 256 values then you need to add additional packets in your data exchange. In future iterations, you can also add a checksum byte to ensure data quality.
@jayatidutta1941
@jayatidutta1941 2 года назад
Does it work for RaspPi 4 also..because the serial bluetooth is not connecting to the RPi 4
@slaps_zrz
@slaps_zrz 2 года назад
I have problems setting up the file at the beginning. So in open the file in the terminal and then type the 2 lines in there, right? now I reboot my Pi and nothing changed. Or what du I have to do?
@krishnar754
@krishnar754 3 года назад
Hello sir, great explanation. Thanks. Can I do this setup on a Jetson nano , is the steps same . Please do reply sir.
@mandaltechtv5734
@mandaltechtv5734 3 года назад
I have not played with Jetson Nano but I may acquire one after reading your comments. What are you planning on using Jetson Nano for? I checked Jetson Nano Nvidia link and found that it supports M.2 Key E connectivity. You will need an additional bluetooth card of M.2 Key E type, if you plan on interacting with Jetson Nano over bluetooth.
@krishnar754
@krishnar754 3 года назад
@@mandaltechtv5734 yes, actually I have wifi and bluetooth adapter installed. I believe it is of intel which is also shown in Jetson hacks channel. My requirement at the moment is, I need to configure wifi through the flutter app which I'm currently working on over bluetooth. Till now I have been searching how to achieve this and found out that, serial port communication can be done to get the wifi ssid and PWD over bluetooth serial. Once I get the details then, I believe there is some python progs to configure wifi. Any suggestions is highly appreciated sir. Thanks in advance 😀
@krishnar754
@krishnar754 3 года назад
@@mandaltechtv5734 sir, i actually tried this on my ubuntu laptop and it worked perfectly fine. i am yet to receive my jetson module.. since jetson also runs ubuntu 18.04, will it work the same in that too ??
@ivanduran8976
@ivanduran8976 3 года назад
Excelente, this method is useful 16-jul-2021, rasp pi 3 , thanks
@renancruzmeireles1704
@renancruzmeireles1704 3 года назад
Obrigado!!! Parabéns por compartilhar o seu conhecimento conosco!!! Funcionou perfeitamente!!! Agora estarei complementando este conhecimento em meu trabalho!!!!
@mandaltechtv5734
@mandaltechtv5734 3 года назад
Obrigado!!
@dominikholl7903
@dominikholl7903 Год назад
i love you :) #fullHomo
@danielvega971
@danielvega971 3 года назад
Thanks, it worked! But how can I connect from my PC to Raspberry Pi, which app do you recommend?
@danielvega971
@danielvega971 3 года назад
Well if anybody has the same question i used TeraTerm but i was missing to assign a COM port to the Raspberry Pi in Windows device properties under service Tab
@mandaltechtv5734
@mandaltechtv5734 3 года назад
Glad to hear that! I use Real VNC to connect to Raspberry Pi from both Mac and Windows. You need install the Real VNC server on Raspberry Pi.
@musacarab3830
@musacarab3830 3 года назад
can you share how you did this? or even share the code?
@cromia2025
@cromia2025 4 года назад
we like these kinds of things here at Mandal tech
@natep9744
@natep9744 4 года назад
How would you write this in thonny python? i got the phone to connect and for the raspberry pi to receive input from phone but i cant get it to go the other way, like send a message from raspberry pi to bluetoooth app
@mandaltechtv5734
@mandaltechtv5734 4 года назад
Please copy the four lines of code starting at 8:30 of this video in your thonny python IDE. let me know if you run into any issue.
@RekhaMeeniga
@RekhaMeeniga 5 месяцев назад
Hello sir, while connecting it to the raspberry pi 4 B it is showing some error as serial bluetooth connection failed:read failed,socket might closed or timeout,read ret:-1. How to fix it .And Is it possible to read the dht22 sensor readings and transfer it from the raspberry pi 4 B using the app
@misterinfinityy
@misterinfinityy 4 года назад
i have this Problem: File "Weitermachen.py", line 33, in server_socket.bind(("",port)) #Auf Port binden und warten File "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", line 178, in bind return self._sock.bind (addrport) _bluetooth.error: (98, 'Address already in use')
@sumantamandal3762
@sumantamandal3762 4 года назад
Hi Nico, it seems blue.py bluetooth port is being used by something else. Can you share the full python file?
@GamerXD7
@GamerXD7 3 года назад
Hello, Thank you for this video. It works for one device. Now I want to connect another device, how can I make this?
@mandaltechtv5734
@mandaltechtv5734 3 года назад
One serial port can connect to only one device. you need to create multiple serial ports.
@GamerXD7
@GamerXD7 3 года назад
​@@mandaltechtv5734 Okey thank you for the answer, but what do I have to do? Is this even possible with the raspberry pi? Do I have to edit the /etc/systemd/system/dbus-org.bluez.service file?
@mandaltechtv5734
@mandaltechtv5734 3 года назад
@@GamerXD7 At 5:57 minute of the video try: sudo rfcomm watch hci0 3 for the second connection. rfcomm watch will take an optional parameter to specify the channel, which will default to '1'
@GamerXD7
@GamerXD7 3 года назад
This works to open an other channel but I can't connect an device to an other channel instead of "Channel 1"
@andygoh1463
@andygoh1463 2 года назад
@@mandaltechtv5734 Unable to connect the device to other channels. Only able to connect to channel 1
@pedroivobezerramoreira1325
@pedroivobezerramoreira1325 3 года назад
Using this method, can I run any python script that I have? I am trying to find a way to send to an android the results of a python script in the Raspberry Pi4 that I made that uses the OpenCV lib
@evanbarnes9984
@evanbarnes9984 3 года назад
Same question! Made any progress?
@joshscotland10
@joshscotland10 4 года назад
Every time i try to connect with the terminal i get a connection failed socket might be closed or timeout? Ive tried hciconfig hci0 up and used the rfkill list but nothing works?
@sumantamandal3762
@sumantamandal3762 4 года назад
Thanks Josh for your comments. What version of raspberry pi are you using? Can you paste your exact error?
@frriiday
@frriiday 4 года назад
@@sumantamandal3762 I have the same issue, I'm using raspberry pi4 Model B and I get "Connection failed: read failed, socket might closed or timeout, read red: -1" in the bluetooth terminal on my phone
@mandaltechtv5734
@mandaltechtv5734 4 года назад
@@frriiday Have you made changes to the dbus-org.bluez.service as I have mentioned at 1:43 of the video.?
@frriiday
@frriiday 4 года назад
@@mandaltechtv5734 I had missed to add the second line. Now it works, thank you
@mandaltechtv5734
@mandaltechtv5734 3 года назад
@@frriiday Glad to hear about your success! :)
@sarathkumar-gq8be
@sarathkumar-gq8be 3 года назад
help..... After reboot of system i cannot select any menu like terminal, internet globe,
@sarathkumar-gq8be
@sarathkumar-gq8be 3 года назад
can you please help me, y that problem
@herynurdiansyah7357
@herynurdiansyah7357 5 лет назад
How i can write code sudo rfcomm watch hci0 in python program?
@sumantamandal3762
@sumantamandal3762 4 года назад
import os os.system("sudo rfcomm watch hci0")
@danielvega971
@danielvega971 3 года назад
@@sumantamandal3762 i did that and got connected to my pc, but then how to send data from Rpi? In the same script after os.system..... i tried writing: ser = serial.Serial('/dev/rfcomm0') ser.write(b'Hello PC') But i get the following error can't bind rfcomm socket address already in use
@mandaltechtv5734
@mandaltechtv5734 3 года назад
@@danielvega971 Can you try: sudo rfcomm release 0
@danielvega971
@danielvega971 3 года назад
​@@mandaltechtv5734 thanks for your fast reply, now i don't have the error but don't get the Hello message on my PC, just successful connection msg, any suggestion?
@juancarlosdavid2
@juancarlosdavid2 2 года назад
Not works
Далее
Авто уровни Happy Glass level 604 - 606
00:49
Pair with your Raspberry Pi.  APRSDroid over Bluetooth!
20:00
Arduino - Read Serial Communication with Raspberry Pi
21:42
SPI: The serial peripheral interface
33:00
Просмотров 687 тыс.
Raspberry Pi Network Music Player
10:21
Просмотров 67 тыс.
Remote GPIO control over Bluetooth | Raspberry Pi 4
7:43
How To Reverse Engineer A Bluetooth Device
11:53
Просмотров 47 тыс.
Raspberry PI3 PI4 Solution to UART PermissionDenied
7:40