BT pairing = Frozen RPi-ZeroW UI - S_i_O - 02-20-2024
Hi.
I'm running moOde 8.3.8 on RPi Zero W with HifiBerry DAC Zero.
My goal is to connect my phone (Samsung) to the this moOde player via Bluetooth wihout using the Pairing Agent.
Note 1: When pairing agent is ENABLED, I can connect fine, but my neighbors can now connect and I have no control.
So with Pairing Agent DISABLED, I do the following:
- open the Blutooth Control pannel.
- start a Standard Scan
- i see my phone as a trusted device now.
- I then press PAIR
That when the WEB UI freezes dans the spinning circle (to the left of the "m") will spin indefinetly.
Only way to fix is to reboot via SSH ou manually.
I managed to get this log from /var/log/syslog when I hit the PAIR a freeze occurs:
Code: Feb 20 15:30:19 moOde-Klipsh systemd[1204]: Reached target Bluetooth.
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: [2024/02/20 15:30:19.978117, 0] ../../source3/rpc_server/rpc_ncacn_np.c:454(rpcint_dispatch)
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: rpcint_dispatch: DCE/RPC fault in call lsarpc:32 - DCERPC_NCA_S_OP_RNG_ERROR
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: [2024/02/20 15:30:19.990394, 0] ../../source3/rpc_server/rpc_ncacn_np.c:454(rpcint_dispatch)
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: rpcint_dispatch: DCE/RPC fault in call lsarpc:32 - DCERPC_NCA_S_OP_RNG_ERROR
Feb 20 15:31:15 moOde-Klipsh bluealsa[268]: bluealsa: [268] D: bluez.c:1304: Signal: org.freedesktop.DBus.ObjectManager.InterfacesRemoved()
Could there be a workaroud using SSH (avoid the UI, or manually edit a file to allow bluetooh mac only as trusted?)
Any help would be awsome.
Thx!
RE: BT pairing = Frozen RPi-ZeroW UI - TheOldPresbyope - 02-21-2024
@S_i_O
That should be possible using the Linux bluetoothctl command but at the moment I'm away from a player I can experiment on to try to repro your problem and to test a solution.
The syslog output you posted doesn't tell me much (the lines reporting errors related to winbindd are unrelated and harmless). It certainly doesn't give any insight into why your webUI becomes unresponsive when you click PAIR.
I'm curious what your use case is here.
Regards,
Kent
RE: BT pairing = Frozen RPi-ZeroW UI - S_i_O - 02-21-2024
(02-21-2024, 04:09 AM)TheOldPresbyope Wrote: @S_i_O
That should be possible using the Linux bluetoothctl command but at the moment I'm away from a player I can experiment on to try to repro your problem and to test a solution.
The syslog output you posted doesn't tell me much (the lines reporting errors related to winbindd are unrelated and harmless). It certainly doesn't give any insight into why your webUI becomes unresponsive when you click PAIR.
I'm curious what your use case is here.
Regards,
Kent
I can do further testing tonight if you need better logs or any other info.
Just let me know.
Thx
RE: BT pairing = Frozen RPi-ZeroW UI - Tim Curtis - 02-21-2024
(02-20-2024, 08:48 PM)S_i_O Wrote: Hi.
I'm running moOde 8.3.8 on RPi Zero W with HifiBerry DAC Zero.
My goal is to connect my phone (Samsung) to the this moOde player via Bluetooth wihout using the Pairing Agent.
Note 1: When pairing agent is ENABLED, I can connect fine, but my neighbors can now connect and I have no control.
So with Pairing Agent DISABLED, I do the following:
- open the Blutooth Control pannel.
- start a Standard Scan
- i see my phone as a trusted device now.
- I then press PAIR
That when the WEB UI freezes dans the spinning circle (to the left of the "m") will spin indefinetly.
Only way to fix is to reboot via SSH ou manually.
I managed to get this log from /var/log/syslog when I hit the PAIR a freeze occurs:
Code: Feb 20 15:30:19 moOde-Klipsh systemd[1204]: Reached target Bluetooth.
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: [2024/02/20 15:30:19.978117, 0] ../../source3/rpc_server/rpc_ncacn_np.c:454(rpcint_dispatch)
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: rpcint_dispatch: DCE/RPC fault in call lsarpc:32 - DCERPC_NCA_S_OP_RNG_ERROR
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: [2024/02/20 15:30:19.990394, 0] ../../source3/rpc_server/rpc_ncacn_np.c:454(rpcint_dispatch)
Feb 20 15:30:19 moOde-Klipsh winbindd[391]: rpcint_dispatch: DCE/RPC fault in call lsarpc:32 - DCERPC_NCA_S_OP_RNG_ERROR
Feb 20 15:31:15 moOde-Klipsh bluealsa[268]: bluealsa: [268] D: bluez.c:1304: Signal: org.freedesktop.DBus.ObjectManager.InterfacesRemoved()
Could there be a workaroud using SSH (avoid the UI, or manually edit a file to allow bluetooh mac only as trusted?)
Any help would be awsome.
Thx!
It won't work with the Pairing Agent off but realistically since Bluetooth range under ideal conditions is only around 30 ft having the agent on should not be an issue.
Whats your usage scenario?
RE: BT pairing = Frozen RPi-ZeroW UI - the_bertrum - 02-21-2024
I can see a case in crowded Europe where Bluetooth can be connected to by the chap in the next apartment if the pairing agent is on.
I have just tried to pair on my Pi Zero W with the agent turned off, and I see the same thing. I get an "accept and pair" message on the connecting device when I press pair in moOde, but it vanishes before I can accept, then the moOde interface becomes unresponsive and I have to reboot.
To repro:
- REMOVE all devices command in Bluetooth control
- Set Pairing agent to OFF in Renderers.
- SCAN (Standard) in Bluetooth control
- PAIR in Bluetooth control
- Instant death.
RE: BT pairing = Frozen RPi-ZeroW UI - S_i_O - 02-21-2024
(02-21-2024, 05:19 PM)the_bertrum Wrote: I can see a case in crowded Europe where Bluetooth can be connected to by the chap in the next apartment if the pairing agent is on.
I have just tried to pair on my Pi Zero W with the agent turned off, and I see the same thing. I get an "accept and pair" message on the connecting device when I press pair in moOde, but it vanishes before I can accept, then the moOde interface becomes unresponsive and I have to reboot.
To repro:
- REMOVE all devices command in Bluetooth control
- Set Pairing agent to OFF in Renderers.
- SCAN (Standard) in Bluetooth control
- PAIR in Bluetooth control
- Instant death.
That pretty much sums it up.
My townhouse wall does let bluetooth bleed into my neighbors house...
Would a manually added "Bluetooth MAC" Whitelist be a feasible workaround?
RE: BT pairing = Frozen RPi-ZeroW UI - TheOldPresbyope - 02-21-2024
(02-21-2024, 07:03 PM)S_i_O Wrote: (02-21-2024, 05:19 PM)the_bertrum Wrote: I can see a case in crowded Europe where Bluetooth can be connected to by the chap in the next apartment if the pairing agent is on.
I have just tried to pair on my Pi Zero W with the agent turned off, and I see the same thing. I get an "accept and pair" message on the connecting device when I press pair in moOde, but it vanishes before I can accept, then the moOde interface becomes unresponsive and I have to reboot.
To repro:
- REMOVE all devices command in Bluetooth control
- Set Pairing agent to OFF in Renderers.
- SCAN (Standard) in Bluetooth control
- PAIR in Bluetooth control
- Instant death.
That pretty much sums it up.
My townhouse wall does let bluetooth bleed into my neighbors house...
Would a manually added "Bluetooth MAC" Whitelist be a feasible workaround?
Bear with me. I'm about finished composing a "how to" do just that.
Regards,
Kent
RE: BT pairing = Frozen RPi-ZeroW UI - S_i_O - 02-21-2024
(02-21-2024, 07:39 PM)TheOldPresbyope Wrote: (02-21-2024, 07:03 PM)S_i_O Wrote: (02-21-2024, 05:19 PM)the_bertrum Wrote: I can see a case in crowded Europe where Bluetooth can be connected to by the chap in the next apartment if the pairing agent is on.
I have just tried to pair on my Pi Zero W with the agent turned off, and I see the same thing. I get an "accept and pair" message on the connecting device when I press pair in moOde, but it vanishes before I can accept, then the moOde interface becomes unresponsive and I have to reboot.
To repro:
- REMOVE all devices command in Bluetooth control
- Set Pairing agent to OFF in Renderers.
- SCAN (Standard) in Bluetooth control
- PAIR in Bluetooth control
- Instant death.
That pretty much sums it up.
My townhouse wall does let bluetooth bleed into my neighbors house...
Would a manually added "Bluetooth MAC" Whitelist be a feasible workaround?
Bear with me. I'm about finished composing a "how to" do just that.
Regards,
Kent
Great!
If you need a "beta tester" feel free to PM me!
RE: BT pairing = Frozen RPi-ZeroW UI - TheOldPresbyope - 02-21-2024
Thanks, @the_bertrum
I'll look at the webUI fail later if Tim doesn't beat me to it.
Meanwhile, here's what works for me to pair and connect with a remote device from the RaspbiOS command line so I can feed audio via Bluetooth from the device to my moOde player.
Test rig: 32-bit moOde 8.3.8 on RPi Zero W connecting to Apple iPad, iPhone SE, and Google Pixel 3a devices; audio sources on these devices were Amazon Music and random podcasts.
1. on the Pi
- in the moOde Renderer view, enable the Bluetooth controller.
- open a terminal session (I use SSH from my laptop but moOde's Web SSH terminal will do) and invoke bluetoothctl (it starts up in interactive mode)
2. on the remote device
- open the system's Bluetooth device pairing/connecting service. After a short while it should discover your moOde player. Try to pair with it (details of this step depend somewhat on the remote device's OS).
3. on the Pi
- bluetoothctl should show the remote device and ask to confirm a passkey (a random number). Enter "yes"
4. on the remote device
- the same passkey should be displayed in a popup asking if you wish to pair. Accept the offer (again, the exact dialogue depends on the device's OS).
5. on the Pi
- bluetoothctl will ask to authorize service <UUID>.. Enter "yes". (There will be a vomiting forth of nerdiness which can be ignored if you're not working on your nerd first-class badge). You may need to enter "yes" more than once depending on the remote device.
- tell bluetoothctl to trust the MAC address of the connected remote device (trust XX:XX:XX:XX:XX:XX)
- exit bluetoothctl and the terminal session
6. on the remote device
- exit from the Connected devices panel
You can now connect and disconnect as you wish from the remote device; moOde and its webUI will reflect the current state (when you refresh the display, that is). Similarly, you can connect and disconnect as you wish from moOde's Bluetooth Control view. The knowledge of trusted devices will persist over reboots
You can repeat as you wish to add other trusted Bluetooth devices to moOde/RaspiOS.
Here's an annotated bluetoothctl dialogue when connecting my Pixel 6a (edited to obscure my MACs)
Code: pi@ZeroTest:~ $ bluetoothctl
Agent registered
[CHG] Controller B8:27:EB:XX:XX:XX Pairable: yes
[NEW] Device 0C:C4:13:XX:XX:XX Pixel 6a <--- when I chose "Pair new device" from the Pixel 6a
Request confirmation
[agent] Confirm passkey 478140 (yes/no): yes <--- responded "yes"
<at this point also clicked "Pair" in the Pixel's popup which shows the same passkey/pairing code>
[CHG] Device 0C:C4:13:XX:XX:XX Modalias: bluetooth:v00E0p1200d1436
[CHG] Device 0C:C4:13:XX:XX:XX UUIDs: 00001105-0000-1000-8000-00805f9b34fb
...16 similar lines...
[CHG] Device 0C:C4:13:XX:XX:XX Paired: yes
Authorize service
[agent] Authorize service 0000110d-0000-1000-8000-00805f9b34fb (yes/no): yes <--- responded "yes"
[CHG] Device 0C:C4:13:XX:XX:XX UUIDs: 00001105-0000-1000-8000-00805f9b34fb
...16 more similar lines...
[Pixel 6a]# trust 0C:C4:13:XX:XX:XX <--- tells RaspiOS to remember the Pixel 6a
[CHG] Device 0C:C4:13:XX:XX:XX Trusted: yes
Changing 0C:C4:13:XX:XX:XX trust succeeded
[Pixel 6a]# exit <--- note that the bluetoothctl prompt has changed to show it's connected to the Pixel
I think I managed to catch all the details needed. Let me know if this doesn't work for you.
Notes:
I randomly ran into situations where it seemed like I had to close the existing web browser tab and open moOde's webUI in a new tab. Dunno yet what that was about. May be related to the original problem.
Similarly it seemed like depending on the sequence in which I was doing things where the remote device began playing to its own speaker instead of the the moOde player. Going back to the device's system setttings and clicking on moOde's Bluetooth entry fixed the problem. Again, dunno yet what that was about.
Regards,
Kent
PS - ISTR that by trusting the device first it's possible to avoid the whole passkey thing, but I chose to do this the old-fashioned way. Will check later.
RE: BT pairing = Frozen RPi-ZeroW UI - Tim Curtis - 02-22-2024
Clients that are paired are already listed as trusted in Bluetooth Control but for some reason when the pairing agent is off things don't work.
I don't fully understand the pairing agent but I think its where some kind of solution for example optional PIN code verification could be implemented.
|