# Bluetooth pairing problem

**URL:** <https://forums.balena.io/t/bluetooth-pairing-problem/62044>\
**Category:** Product support\
**Tags:** raspberrypi3\
**Created:** [February 7, 2020, 12:47pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044 "2020-02-07T12:47:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickrock](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nickrock](https://forums.balena.io/u/nickrock)\
**Post date:** [February 7, 2020, 12:47pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/1 "2020-02-07T12:47:01Z")

</div>

I have installed balenaos and balena sound on raspberrypi3 using balena cloud ,everything seems fine the device is discoverable but it doesn’t pair successfully.

errors from logs when trying to pair are :

localhost daemon.warn bluetoothd[851]: Authentication attempt without agent  
localhost daemon.err bluetoothd[851]: Access denied: org.bluez.Error.Rejected

---

<div class="post-metadata">

**Author:** ![\_Page](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/_page/32/22_2.png) [@\_Page](https://forums.balena.io/u/_Page)\
**Post date:** [February 7, 2020, 3:52pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/3 "2020-02-07T15:52:19Z")

</div>

Hey, what’s the bluetooth device you’re trying to pair? Also would you be able to grant support access for someone to take a look?

---

<div class="post-metadata">

**Author:** ![nickrock](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nickrock](https://forums.balena.io/u/nickrock)\
**Post date:** [February 7, 2020, 9:27pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/6 "2020-02-07T21:27:34Z")

</div>

Hey , first of all thnx for answering .  
The device is a Motorola G5S (XT1794), i finally managed to connect trusting and pairing  
with phones Bluetooth mac address from console using below commands

[bluetooth]# power on  
[bluetooth]# agent on  
[bluetooth]# default-agent  
[bluetooth]# scan on  
[NEW] Device XX:XX:XX:XX:XX:XX moto g5s  
[bluetooth]# scan off  
[bluetooth]# trust XX:XX:XX:XX:XX:XX  
[bluetooth]# pair XX:XX:XX:XX:XX:XX

but everytime i want to connect to ras i need to pair it all over again from phone.  
Also the sound is Jittery and get errors on log file

bluetooth-audio /usr/bin/bluealsa: SBC decoding error: No such process  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 5 != 4  
bluetooth-audio /usr/bin/bluealsa: SBC decoding error: No such file or directory  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 23 != 22  
bluetooth-audio /usr/bin/bluealsa: SBC decoding error: No such file or directory  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 25 != 24  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 46 != 45  
bluetooth-audio /usr/bin/bluealsa: SBC decoding error: No such file or directory  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 64 != 63  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 78 != 76  
bluetooth-audio /usr/bin/bluealsa: SBC decoding error: No such file or directory  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 167 != 166  
bluetooth-audio /usr/bin/bluealsa: Missing RTP packet: 790 != 789

Support Access UUID  
ff717467b4d045f4f76a6792ae4f4457 - 1 day

thnx in advance.

---

<div class="post-metadata">

**Author:** ![sradevski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sradevski/32/1609_2.png) [@sradevski](https://forums.balena.io/u/sradevski)\
**Post date:** [February 10, 2020, 10:20am UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/9 "2020-02-10T10:20:33Z")

</div>

Hi, regarding the pairing issue, you might be able to improve the process if you enable a PIN code, see [here](https://github.com/balenalabs/balena-sound#set-bluetooth-pin-code-optional). Regarding the jitter, we have witnessed this on some devices, and are trying to narrow down what causes the problem, but we don’t have a solution yet. What you might want to try is increase the buffer size [here](https://github.com/balenalabs/balena-sound/blob/8ccd6fac9fddcca43d013248e874a6c63ee0d3ff/bluetooth-audio/start.sh#L58) and see if that helps.

---

<div class="post-metadata">

**Author:** ![nickrock](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nickrock](https://forums.balena.io/u/nickrock)\
**Post date:** [February 16, 2020, 11:27am UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/12 "2020-02-16T11:27:35Z")

</div>

Hi , thnx for your suggestions and your help.  
Pin code actually made it worst didn’t connect at all, i pushed the balena sound and did some updates and the bluetooth works now.  
buffer size was the same with the script from the link u send me so that did nothing for me.  
I tried a bluetooth dongle but can’t make it to connect to my phone i get errors.

---

<div class="post-metadata">

**Author:** ![ffissore](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ffissore/32/2842_2.png) [@ffissore](https://forums.balena.io/u/ffissore)\
**Post date:** [February 17, 2020, 2:14pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/14 "2020-02-17T14:14:04Z")

</div>

Hi

You want to try a bigger buffer than the one specified in the script. That 1M is microseconds (= it’s set to 1 second), so if the sound is choppy, increasing the buffer size to, say, 5M (5 seconds) may help

Can you give it a try and let us know?

regards

federico

---

<div class="post-metadata">

**Author:** ![ffissore](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/ffissore/32/2842_2.png) [@ffissore](https://forums.balena.io/u/ffissore)\
**Post date:** [February 17, 2020, 2:18pm UTC](https://forums.balena.io/t/bluetooth-pairing-problem/62044/16 "2020-02-17T14:18:02Z")

</div>

Also, it would be nice to know which updates you’ve made to balenasound: anything that can help people have a better experience with it, is more than welcome
