I'm trying to connect my rpi0 w to any android device via Bluetooth LE(low energy) , i can pair but i can't connect them ,an error always showed (Connection failed,No usable services on this device ) on vnc and (Failed to connect:org.bluez.Error.Failed) in terminal , i tried with stretch and Jessie version but no connection!i followed the tutorial of adafruit with the new version of bluez 5.50 [https://www.youtube.com/watch?v=5fQR2PHMDWE] but i found the same problem , please help !
-
1I read that for some old jessie/stretch config, Rpi3B+ BLE crashes with Rpi built UART. A similar thing is that Rpi Console crashes with Rpi built in UART. So my suggestion are: (1) use Rpi USB UART instead of Rpi built in UART. (2) for initial testing, do not use SSH/VNC (disable console and enable UART in the Rpi config menu), to avoid above possible conflicts. (3) To make sure your Rpi software (python smbus) and hardware wiring is OK, try looping back test. – tlfong01 May 27 '19 at 03:09
-
Actually beside Console serial, Blue Tooth, SHS, VNC etc, all other serial stuff might clash with Rpi built in UART. For example, if you are using "One Wire" to talk to sensors such as DHT22, you also need to disable "One Wire" in the RpiConfig menu, beside Console Serial. The annoying thing is that if you don't disable "OneWire", the Rpi built in UART just ignores your serial commands and do nothing, WITHOUT giving you any warning or error messages, – tlfong01 May 27 '19 at 06:09
-
Thank you for your response , i'm new to rpi so i took a little time to understand your suggestion , i haven't an Rpi USB UART i have to connect just with the rpi 0 w , but i've tried to disable ssh/vnc/1-wire /console serial like u said it gives me the same error , did i have to setup the UART on my rpi to enable it ! Is the Rpi USB UART necessary fo connection without error ? thank you in advance – ninpi May 28 '19 at 00:08
-
If it's necessary Is that cable what you mean ?https://shop.pimoroni.com/products/usb-to-uart-serial-console-cable – ninpi May 28 '19 at 00:24
-
I seem to have misunderstood your situation. If your Rpi has successfully "paired" with the Android device, say an android smart phone, then they are "connected". Now you can transfer files using an "transfer files" app, or "FTP server" app. Perhaps you can let us know if you have another BLE device such as HC10 BLE serial adapter between Rpi and Android phone. – tlfong01 May 28 '19 at 06:00
-
And if you are not using any BLE serial adapter, then you don't need to use any cable. In other words, the cable you linked is NOT necessary if you directly link Rpi to Android. I assume you are using Rpi3B which already have BLE built in, so no USB BLE adaptor/dongle is required. – tlfong01 May 28 '19 at 06:03
-
Or you might like to read the following instructable to see if it is similar to what you want - Transfer MP3 Songs in Raspberry Pi to Android Phone Using Bluetooth - mirza irwan osman in Raspberry Pi https://www.instructables.com/id/Transfer-MP3-songs-in-Raspberry-Pi-to-Android-Phon/ – tlfong01 May 28 '19 at 06:05
-
Just now I tried to do it myself, using my Rpi3B+ and SamSung smart phone Galaxy C9 Pro. I download an File send app and used phone to pair to Rpi to send something. I got error messages like no FTP and BlueZ service at target. So I installed FTP and BlueZ in Rapi and tried again. But I still go the same error message. So I need to try harder. I also found that when paired, the app still says "connecting" when trying to send. So I must be confused with the terms "pairing" and "connecting". You are right in saying that after paired does not mean connected. My apologies for confusion. – tlfong01 May 28 '19 at 07:26
-
I tried again, installed more ftp bluetooth services for Rpi, but still got similar error messages. I guess my app Android "Bluetooth File Transfer" is not compatible with the Rpi Raspbian stretch. So I need to google further. For now, I don't have enough knowledge to suggest any help. My apologies. – tlfong01 May 28 '19 at 08:00
-
Thank you anyway, but i want to know if you still have doubt about the UART problems , it can't be the cause? – ninpi May 28 '19 at 13:13
-
Ah, yes, the UART problem only appears if you use BLE serial module. So there is very little chance it will cause a problem. I don't use SSH/VNC, but still cannot do FTP. I am only 80% sure, anyway. – tlfong01 May 28 '19 at 13:29
1 Answers
Question
Connect my RpiZW to Android device through BLE,Bluez 5.5
Can pair but can't connect them,
Error "Connection failed, No usable services" on VNC,
Error “Failed to connect:org.bluez.Error.Failed) in terminal
Answer
Update 2019aug04hkt1110
I tried to pair the following BlueTooth headphone with Rpi4B buster and found a similar problem: can pair but cannot connect.
1MORE iBFree Sport Bluetooth 4.2 CSR Bluetooth chip in-ear headphones review - digit.in 2018jul17
1 More iBFree BlueTooth Headphone
Update 2019jul31hkt1246
Test Setup
I use the following to test three Bluetooth speakers:
SamSung Galazy C9 Pro
Acer Aspire Intel Core i5 Win 10 PC with USB Bluetooth dongle, Bluetooth Driver Intel 14/11/2016 19.30.1646.851
Rpi4B Raspbian 10 buster 2019jul10 version, preinstalled bluez utitilies
I tested the following three Bluetooth speakers:
Creative MUVO 2,
Rapoo A500,
Mi NDZ-03-GB
Test Results
SamSung Galazy C9 Pro all three Bluetooth speaker paired easily and smoothly.
Acer Aspire WinPC Intel Bluetooth river can pair MUVO2, Rapoo A500, but never Mi NDZ03GB
Rpi4B onboard Bluetooth can only pair and connect Creative MUVO2 paired and connected smoothly. Can pair other two, but cannot connect.
Easy and Stable Pairing Tricks
Reboot Rpi4B every time before trying to pair/connect.
Uncomment the following two line in file "/etc/bluetooth/main.conf" the following two lines to disable timeouts:
DiscoverableTimeout = 0
PairableTimeout = 0
Conclusion
Rpi4B on board Bluetooth is weak comparing to SamSung smart phone and WinPC with Bluetooth dongle.
Next Step
Next step is to try to use an USB Bluetooth adapter dongle to see if it improves Rpi4B's Bluetooh pairing/connecting performance.
Update 2019jul30hkt1505
Rpi4B Raspbian 10 buster and three BlueTooth Speaker Evaluation Notes
Some months ago I tried to pair/connect a couple of Bluetooth devices with my Rpi3B+ and found everything disappointing: difficult/unreliable/intermittent failing to discover/pair/connect the BT devices. I googled and found no useful help around. So I gave up, waiting for Rpi4B to come along. I also bought two more Bluetooth speakers to try.
Now the time has come for me to try again. I first tried to pair the three speakers with my Samsung smart phone and everything went well, implying both BT speakers are working OK.
I then tried the following with all three speakers, Creative, XiaoMi, Rapoo. The procedure is:
(a) reboot Rpi4B (important to get repeatable/reliable results),
(b) GUI Deskop top right hand corner BT icon to discover/pair the speaker,
(c) when paired, click the speaker icon (beside WiFi icon) to check "connection" and adjusting volume,
(d) play a mp3 file using VLC media player. I found that I can always pair and "connect" (VLC to connect to speaker) with the Creative BT speaker. But for the XiaoMi and Rapoo BT speakers, I can always "pair", but never "connect" (system error message is "cannot use "default"speaker, or speaker icon always red crossed)
So my conclusion is that Rpi4B BT works reliably with my Creative speaker but not XiaoMi or Rapoo. Creative speaker costs twice of the other two, so I think its power is perhaps also twice bigger or sensitive. Anyway, I tried to do more evaluation, I found I could no longer detect nor pair, not to mention connect. I guessed the Rpi4 chips must had been heated up and became crazy. So I waited for 20 minutes or and and also added heat sinks to the chips. Then everything comes back normal again. My second quick and dirty conclusion is that Rpi4B, if heated up, might go crazy!
So for now I am only using the Creative Bluetooth speaker which I found very stable and reliable. Every time I want to use my VLC media player to play music, I do the following:
(1) Reboot Rpi4B Raspbian 10 Buster Jul 10,
(2) Pair speaker (clicking BlueTooth icon),
(3) Connect speaker and adjust volume (clicking speaker icon),
(4) Use VLC to play music. The pairing is smooth, almost detected /pairing smoothly first time, very stable, no disconnecting/dispairing for the 2 hours testing.
I once thought about using an USB BT dongle to replace on board weak BT guy, but too lazy to do it now. :)
Installing BlueTooth, BlueZ, and FTP packages for Raspbian stretch 9
I first installed the bluetooh and ftp packages for testing.
Testing Android Smart Phone Samsung Galaxy C9 Pro App to connect to Rpi3B+ using Bluetooth
I then tried the Android apps ftp server/client and send files (Bluetooth File Transfer), but found both not working. Error message is something like no ftp blue services, ...
I guess there is some incompatability problem with stretch 9 and the androd app. I need to try again later.
I once found it OK to connect Rpi to Bluetooh serial modules HC05/HC05, and also HC05/HC06 to android phone and found everything OK communicating using text (serial 9600N81). So I think I better try again with BLE HC10, to see if I missed anything important. Then I will come back to try Rpi direct bluetooth to android again.
/ to continue, ...
References
JDY10 BlueTopoth 4.0 CC2541 Compatible BLE Serial Slave Module CC2541 - ¥7.80
AliExpress JDY10 CC2541 Compatible Bluetooth 4.0 BLE Serial Slave Module - US$2.14
Operating voltage: 1.9 - 3.6 V
Communication distance: 100 meters
Bluetooth 4.0, 2.4 GHZ, GFSK, 8db, 80 metres
Cypress Wireless Connectivity to Rpi3B+ - 2018mar15
Cypress Wi-Fi + Bluetooth Combos
7 Best Bluetooth Modules for Raspberry Pi - Tayyaba Dar 2019jun03
(8) Developer Study Guide: Deploying BlueZ v5.50 on Raspberry Pi Board
(9) Bluetooth Mesh Models Technical Overview
.END

- 4,665
- 3
- 10
- 24
-
Hi, The problem is that i am obliged to use only the bluetooth LE integrated in the RpI, I can't use other parts! – ninpi May 28 '19 at 13:17
-
I see. I found that if you use Rpi directly use BLE connected to Android phone, then you can use FTP app to transfer files, or phone number files etc. You can set up FTP server/client. If you use BLE serial module, then you can do serial communication, using either Rpi or Android phone as text terminal. As I said earlier, I tried the FTP direct connect method and but no luck. Perhaps I will try later. – tlfong01 May 28 '19 at 13:26
-
Thank you for your help despite not understanding where the error comes from! please if you find a solution let me know ! – ninpi May 28 '19 at 19:37
-
Problem. You too and good luck. Actually I think this is a BLE newbie FAQ. I hope other ninjas can help us. – tlfong01 May 29 '19 at 00:33
-
@ninpi I am making little progress on bluetooth stuff.
I found bluez not that newbie friendly and I read the following discussion saying bad words about it. https://raspberrypi.stackexchange.com/questions/96207/what-is-the-status-of-bluez-and-where-is-the-man-page – tlfong01 Jun 09 '19 at 01:42 -
Thank you for this information, I already changed the connection protocol because of the constraint of time, I will not use the bluetooth despite that I lost a lot of time in it, but it's ok! Thanks again – ninpi Jun 09 '19 at 12:13
-
Thank you for your reply. I agree that we both lost a lot of time. But perhaps we both learnt something, such that Rpi is not that ideal, and we need to change our direction if we found schedule too tight. I am lucky not to have any deadline. So I will go slowly, and in case of any good news, I will remember to share with you, and other visitors of this post. Good luck to your project! – tlfong01 Jun 09 '19 at 13:22
-
@ninpi, Bad news. I have been trying to pair and connect 4 different BlueTooth speakers and headphone to Rpi4B with Raspbian 10 buster. I found only one of the four can always easily and smoothly pair and connect, the other three can sometimes pair, but never connect. In short, my results is same as yours. I conclude that BlueZ is still not mature with Rpi4B. A get around is use an external BT dongle – tlfong01 Aug 05 '19 at 03:28
-
Thank you for sharing with me, although this is bad news but it still a plus for me and for those who will try in the future this method, thank you again ! – ninpi Aug 06 '19 at 22:28