[solved] Cant connect via Bluetooth

Cannot connect. App does not detect anything.
Updated all the packages (apt), used all the options (no sap, etc)

Using a Samsung 10.

Thanks for your help.

Hey, what is the output of this command:

sudo systemctl status pisound-ctl

Did you turn on discoverable mode on the Raspberry Pi? This can be easily done by holding the Pisound’s button down for 3-4 seconds (count the blinks). Then it will remain discoverable for 180 seconds, and keeps the MIDI LEDs will blink for that duration.

First, thanks for your reply!

Yes, I’ve turned discovery on. I’ve turned on vía software ($patchbox->bluetooth) and hardware (pressing buttons). Both in desktop and console mode.

The device is not shown, neither in the app or the phone bluetooth screen.

Thanks again for your help

Can you please post the output of the command here? What is the Raspberry Pi version you’re using?

Raspberry Pi 3B

output of the command

patch@patchbox:~ $ sudo systemctl status pisound-ctl
\u25cf pisound-ctl.service - Bluetooth service for Pisound companion app.
Loaded: loaded (/lib/systemd/system/pisound-ctl.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-03-20 23:10:37 GMT; 1 day 17h ago
Main PID: 419 (pisound-ctl)
Tasks: 14 (limit: 2199)
Memory: 7.5M
CGroup: /system.slice/pisound-ctl.service
\u251c\u2500419 /usr/bin/pisound-ctl
\u251c\u2500913 /bin/sh /usr/bin/mec /etc/mec-blokas.json
\u251c\u2500917 osc2midi pisound-ctl 127.0.0.1 38735
\u2514\u2500919 mec-app /etc/mec-blokas.json

Mar 20 23:11:09 patchbox pisound-ctl[419]: mec api initialise
Mar 20 23:11:09 patchbox pisound-ctl[419]: mecapi_proc start
Mar 20 23:11:09 patchbox pisound-ctl[419]: mec_app running
Mar 20 23:11:09 patchbox pisound-ctl[419]: MecApi::MecApi
Mar 20 23:11:09 patchbox pisound-ctl[419]: MecApi_Impl::init
Mar 20 23:11:09 patchbox pisound-ctl[419]: KontrolDevice initialise
Mar 20 23:11:09 patchbox pisound-ctl[419]: KontrolDevice::init
Mar 20 23:11:09 patchbox pisound-ctl[419]: kontrol device : listening on 6050
Mar 20 23:11:09 patchbox pisound-ctl[419]: KontrolDevice::init - complete
Mar 20 23:11:12 patchbox pisound-ctl[419]: KontrolDevice::new client 127.0.0.1 : 40051 KA = 5

additional info

sudo systemctl status bluetooth
\u25cf bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2021-03-20 23:10:43 GMT; 1 day 17h ago
Docs: man:bluetoothd(8)
Main PID: 555 (bluetoothd)
Status: “Running”
Tasks: 1 (limit: 2199)
Memory: 1.9M
CGroup: /system.slice/bluetooth.service
\u2514\u2500555 /usr/lib/bluetooth/bluetoothd --compat --noplugin=sap

Mar 20 23:10:42 patchbox systemd[1]: Starting Bluetooth service…
Mar 20 23:10:43 patchbox bluetoothd[555]: Bluetooth daemon 5.50
Mar 20 23:10:43 patchbox systemd[1]: Started Bluetooth service.
Mar 20 23:10:43 patchbox bluetoothd[555]: Starting SDP server
Mar 20 23:10:43 patchbox bluetoothd[555]: Excluding (cli) sap
Mar 20 23:10:43 patchbox bluetoothd[555]: Bluetooth management interface 1.14 initialized
Mar 20 23:10:43 patchbox bluetoothd[555]: Failed to set privacy: Rejected (0x0b)
Mar 20 23:10:43 patchbox bluetoothd[555]: Endpoint registered: sender=:1.7 path=/org/bluez/hci0/A2DP/SBC/Source/1
Mar 20 23:10:43 patchbox bluetoothd[555]: Endpoint registered: sender=:1.7 path=/org/bluez/hci0/A2DP/SBC/Source/2

I’ve just checked on Raspberry Pi 3B, it worked just fine. The bluthoothd command line was not modified from original, this is the output I got:

patch@patchbox:~ $ sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-03-23 08:37:11 GMT; 15min ago
     Docs: man:bluetoothd(8)
 Main PID: 528 (bluetoothd)
   Status: "Running"
    Tasks: 1 (limit: 2062)
   CGroup: /system.slice/bluetooth.service
           └─528 /usr/lib/bluetooth/bluetoothd

Mar 23 08:37:11 patchbox systemd[1]: Starting Bluetooth service...
Mar 23 08:37:11 patchbox bluetoothd[528]: Bluetooth daemon 5.50
Mar 23 08:37:11 patchbox systemd[1]: Started Bluetooth service.
Mar 23 08:37:11 patchbox bluetoothd[528]: Starting SDP server
Mar 23 08:37:11 patchbox bluetoothd[528]: Bluetooth management interface 1.18 initialized
Mar 23 08:37:11 patchbox bluetoothd[528]: Sap driver initialization failed.
Mar 23 08:37:11 patchbox bluetoothd[528]: sap-server: Operation not permitted (1)
Mar 23 08:37:11 patchbox bluetoothd[528]: Endpoint registered: sender=:1.8 path=/org/bluez/hci0/A2DP/SBC/Source/1
Mar 23 08:37:11 patchbox bluetoothd[528]: Endpoint registered: sender=:1.8 path=/org/bluez/hci0/A2DP/SBC/Source/2
Mar 23 08:37:11 patchbox bluetoothd[528]: Failed to set privacy: Rejected (0x0b)
patch@patchbox:~ $ uname -a
Linux patchbox 5.10.11-v7+ #1399 SMP Thu Jan 28 12:06:05 GMT 2021 armv7l GNU/Linux

By the way, the App must ask for location permission - did you grant that permission? If not, Bluetooth on Android won’t work. See here for why it’s required: https://blokas.io/pisound/docs/pisound-app/#why-is-the-location-permission-required

Yes, location permissions are granted.
Just reinstalled the app. No change.

But I have just made an interesting finding…
Patchbox is not visible from my phone…but I can see it in my PC bluetooth, so definitely and luckily is not a bluetooth problem, but an app/samsung issue

Uninstall - reboot phone - install - reboot phone - worked!!

1 Like

I’m having the same issue with the latest Patchbox OS (bullseye), apparently fails after installing the MODEP module, any help appreciated! Thank you :slight_smile:

Some output:

patch@patchbox:~ $ sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-05-23 20:12:08 BST; 3min 21s ago
       Docs: man:bluetoothd(8)
   Main PID: 727 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 4915)
        CPU: 87ms
     CGroup: /system.slice/bluetooth.service
             └─727 /usr/libexec/bluetooth/bluetoothd

May 23 20:12:08 patchbox systemd[1]: Starting Bluetooth service...
May 23 20:12:08 patchbox bluetoothd[727]: Bluetooth daemon 5.55
May 23 20:12:08 patchbox systemd[1]: Started Bluetooth service.
May 23 20:12:08 patchbox bluetoothd[727]: Starting SDP server
May 23 20:12:08 patchbox bluetoothd[727]: Bluetooth management interface 1.21 initialized
May 23 20:12:08 patchbox bluetoothd[727]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
May 23 20:12:08 patchbox bluetoothd[727]: sap-server: Operation not permitted (1)
May 23 20:12:08 patchbox bluetoothd[727]: Failed to set privacy: Rejected (0x0b)
May 23 20:12:17 patchbox bluetoothd[727]: Endpoint registered: sender=:1.35 path=/MediaEndpoint/A2DPSink/sbc
May 23 20:12:17 patchbox bluetoothd[727]: Endpoint registered: sender=:1.35 path=/MediaEndpoint/A2DPSource/sbc

and from pisound-ctl

patch@patchbox:~ $  sudo systemctl status pisound-ctl
● pisound-ctl.service - Bluetooth service for Pisound companion app.
     Loaded: loaded (/usr/lib/systemd/system/pisound-ctl.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2022-05-23 20:15:22 BST; 2s ago
    Process: 1367 ExecStart=/usr/bin/pisound-ctl (code=exited, status=203/EXEC)
   Main PID: 1367 (code=exited, status=203/EXEC)
        CPU: 4ms
  • I saw that the bluetooth connection works perfectly after runing the setup wizard with a clean image. After installing Modep, the bluetooth connectivity gets lost.

I was able to get rid of the sap error by passing the --noplugin=sap to the ExecStart configuration.
Currently:

patch@patchbox:~ $ systemctl status bluetooth.service
● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-05-23 20:33:10 BST; 3s ago
       Docs: man:bluetoothd(8)
   Main PID: 1016 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 4915)
        CPU: 78ms
     CGroup: /system.slice/bluetooth.service
             └─1016 /usr/libexec/bluetooth/bluetoothd --noplugin=sap

May 23 20:33:10 patchbox systemd[1]: Starting Bluetooth service...
May 23 20:33:10 patchbox bluetoothd[1016]: Bluetooth daemon 5.55
May 23 20:33:10 patchbox systemd[1]: Started Bluetooth service.
May 23 20:33:10 patchbox bluetoothd[1016]: Starting SDP server
May 23 20:33:10 patchbox bluetoothd[1016]: Excluding (cli) sap
May 23 20:33:10 patchbox bluetoothd[1016]: Bluetooth management interface 1.21 initialized
May 23 20:33:10 patchbox bluetoothd[1016]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSink/sbc
May 23 20:33:10 patchbox bluetoothd[1016]: Endpoint registered: sender=:1.32 path=/MediaEndpoint/A2DPSource/sbc
May 23 20:33:10 patchbox bluetoothd[1016]: Failed to set privacy: Rejected (0x0b)

Exact same error here as well.
I tried a fresh install - worked perfectly. The moment I installed the Modep module the Bluetooth fails.

Tried adding the extra flags (–experimental (from a previous thread) as well as the others mentioned on this thread) and the same privacy error occurs.

I’ve also tried making bluetoothctl trust my phone. No dice.

Exact same issue for me. Any fix yet?

I figured it out yesterday and went to sleep right after finishing what I was working on lol. Here’s how I did it:

Steps / tldr:

  1. Start from fresh install
  2. Setup as normal but DO NOT install MODEP
  3. Make a copy of /usr/bin/pisound-ctl and put it somewhere safe (ie. home directory)
  4. Install MODEP
  5. Replace the current /usr/bin/pisound-ctl with the copy you made in step 3
  6. The pisound-ctl service will auto-restart. Put your Pisound in pairing mode and connect with the app!

Explanation:

So after starting from a fresh install, I realized that the exact same Bluetooth errors mentioned earlier in this thread were still there, yet the Pisound app worked just fine:

● bluetooth.service - Bluetooth service
     Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-05-17 14:32:39 BST; 1 months 6 days ago
       Docs: man:bluetoothd(8)
   Main PID: 808 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 4915)
        CPU: 76ms
     CGroup: /system.slice/bluetooth.service
             └─808 /usr/libexec/bluetooth/bluetoothd

May 17 14:32:38 patchbox bluetoothd[808]: Bluetooth daemon 5.55
May 17 14:32:39 patchbox bluetoothd[808]: Starting SDP server
May 17 14:32:39 patchbox systemd[1]: Started Bluetooth service.
Jun 23 23:54:59 patchbox bluetoothd[808]: Bluetooth management interface 1.21 initialized
Jun 23 23:55:00 patchbox bluetoothd[808]: profiles/sap/server.c:sap_server_register() Sap driver initialization failed.
Jun 23 23:55:00 patchbox bluetoothd[808]: sap-server: Operation not permitted (1)
Jun 23 23:55:00 patchbox bluetoothd[808]: Failed to set privacy: Rejected (0x0b)
Jun 23 23:56:01 patchbox bluetoothd[808]: Endpoint registered: sender=:1.48 path=/MediaEndpoint/A2DPSink/sbc
Jun 23 23:56:01 patchbox bluetoothd[808]: Endpoint registered: sender=:1.48 path=/MediaEndpoint/A2DPSource/sbc
Jun 23 23:56:01 patchbox bluetoothd[808]: src/profile.c:ext_start_servers() RFCOMM server failed for Headset unit: rfcomm_bind: Address already in use (98)

And I remembered pisound-ctl being in an auto-restart loop, and when I tried to execute it myself earlier with MODEP installed, it gave an exec format error, implying the binary was never going to run, no matter what settings were tweaked in the system.

So given that the executable was not giving this error before MODEP was installed, I concluded that the MODEP installation was improperly modifying /usr/bin/pisound-ctl, causing the error. I’m not sure if this is intentional, but when I replaced the post-MODEP version with a backup of the pre-MODEP version, everything worked flawlessly. I was expecting the Pisound app to not be able to see my MODEP pedalboards or something, but nope. Everything works exactly as expected!

It’s also worth noting that the Bluetooth errors are still present after this fix - but they don’t seem to cause any issues. I have my Pisound set up to transfer mp3s over Bluetooth, and it hasn’t failed to connect/transfer once.

Hope this helps!

(Also dev team, this should be easy to replicate on a RPi 4B 8GB, but if you need any more information lmk :+1:)

2 Likes

Hey, that works! Shout out to @cjbell for doing the heavy lifting! I’ve been dealing with this issue since I got the device a few weeks back.

I should note that I’m experiencing frequent bluetooth dropouts/disconnections with the device, now that I’ve gotten past this bug. I think the dev team should probably work on smoothing this experience out a bit.

I personally probably will limit the amount that I twiddle with settings via the phone–mostly will use the app to do the MIDI learn and switch patches.

Interesting, MODEP install should have nothing to do with /usr/bin/pisound-ctl, we’ll see if we can reproduce the problem.

Fixed in pisound-ctl package, since version 1.03-8. There was some packaging problem with previous version.

Now no workaround will be necessary, if you have a problem, it’s enough to update your apt packages.

Coming back after a couple months away from the Pisound.

Updated as stated above.

What I observe:
-connection works sporadically without much of a pattern
-I cannot enter bluetooth pairing mode on pisound unless I’m running with a monitor attached logged into either desktop or console. I use “autologin”
-I usually cannot reconnect to the pisound with the phone unless I enter pairing mode on the pisound (reconnection without pairing mode enabled is not working reliably)
-having the monitor attached seems enough to solve the issue??? Why should it care if the Hmdi cable is attached when booting?

Does this make any sense at all?

Can patchbox run headless?

What output does this command give you:

apt show pisound-ctl

I’ve just tried on a fresh Patchbox OS image, with all updates from apt installed, to start some Pure Data patches, and hadn’t encountered any issues, regardless of the HDMI state or ‘boot’ options.

One thing I had to do is to remove the old pairing in Bluetooth settings on my Android phone, so a new one could be made. After that, everything seems smooth, no disconnects.

I just did a fresh install of Patchbox, following all instructions precisely.

I’m finding I can sometimes connect but not reliably. 95% of the the time I get a connection error. Of the remaining 5% of the time it connects, 95% of the time it fails within a few minutes.

Here’s what I see when I run the suggested command:

patch@patchbox:~ $ apt show pisound-ctl
Package: pisound-ctl
Version: 1.03-9
Priority: optional
Section: sound
Maintainer: Blokas Labs <hello@blokas.io>
Installed-Size: unknown
Depends: libc6 (>= 2.19), libstdc++6 (>= 4.9.2), libgcc1 (>= 1:4.9.2-10), libdbus-1-3 (>= 1.8.2), git (>= 1:2.1.4), osc2midi (>= 1.0-1), pd-blokas (>= 0.1.1-3), pisound-ctl-scripts-common (>= 1.03-6), mec-blokas (>= 0.1.1-2)
Recommends: pisound-ctl-scripts-system (>= 1.03-6)
Suggests: blokas-puredata-patches (>= 1.0), pisound-ctl-scripts-puredata (>= 1.03-6)
Download-Size: 257 kB
APT-Sources: http://apt.blokas.io rpi/main armhf Packages
Description: Bluetooth service for Pisound companion mobile app.
 See https://blokas.io/pisound for more information.

Any help appreciated.