Raspberry Pi 3 Model B+ & running Bluetooth daemon in compatibility mode (with `var/run/sdp` socket)

bluetooth
raspberrypi3

#1

Hey!

I’m trying to get Hype SDK ( https://hypelabs.io/iot/ ) to work on a Ubuntu 18.04-based container, but I’m running into issues.

Problem: /var/run/sdp socket is not created in the container by bluetoothd. This socket is needed by the Hype framework.

I tried to fix it by configuring /etc/systemd/system/dbus-org.bluez.service in the container to start the daemon in --compat mode, but it had no effect. (Based on these instructions: https://bbs.archlinux.org/viewtopic.php?id=201672 )

I suspect that this is due to the fact that the Bluetooth daemon is magically running on the host OS? Threads like RPi3 running bluetoothd with --experimental flag suggest it. Unfortunately, this is a little bit over my head now (tried SSHing into the supervisor and could not locate the Bluetooth service), so I would appreciate someone’s help on the topic…

Best wishes,
Konrad

PS: One more question, if it is true that the Bluetooth daemon is running on host OS, is there any point in installing BlueZ on the container OS?

PPS: Here is my Hype SDK topic, for reference: https://hypelabs.io/community/topic/161/


#4

Oh, interesting! It turns out that resin_supervisor accessible via sudo resin local ssh and “Host OS” accessible via the Dashboard are two different things!

When I actually log in to the Host OS via the dashboard I see promising results:

root@d379470:/# ps | grep bluetooth
 1084 root      5440 S    /usr/libexec/bluetooth/bluetoothd --experimental
30244 root      5628 S    /usr/lib/bluetooth/bluetoothd --compat
30533 root      2864 S    grep bluetooth

However, /var/run/sdp is still missing:

root@d379470:/var/run# ls -al
total 37
drwxr-xr-x 19 root  root    640 Sep 13 16:34 .
drwxr-xr-x 23 root  root   1024 Sep 13 16:35 ..
drwxr-xr-x  3 root  root     80 Sep 13 16:34 NetworkManager
-rw-------  1 root  root      0 Sep 13 16:34 agetty.reload
drwxr-xr-x  2 avahi avahi    80 Sep 13 16:34 avahi-daemon
drwx------  6 root  root    140 Sep 13 16:34 balena
drwx------  3 root  root     80 Sep 13 16:34 balena-host
-rw-r--r--  1 root  root      3 Sep 13 16:34 balena-host.pid
srw-rw----  1 root  balena    0 Sep 13 16:34 balena-host.sock
-rw-r--r--  1 root  root      3 Sep 13 16:34 balena.pid
srw-rw----  1 root  balena    0 Sep 13 16:34 balena.sock
drwxr-x---  2 root  root     60 Sep 13 16:34 chrony
-rw-r--r--  1 root  root      4 Sep 13 16:34 chronyd.pid
drwxr-xr-x  2 root  root     60 Sep 13 16:34 dbus
-rw-r--r--  1 root  root      4 Sep 13 16:34 dnsmasq.pid
-rw-r--r--  1 root  root      1 Sep 13 16:34 dnsmasq.servers
drw-------  3 root  root     60 Sep 13 16:34 docker
-rw-r--r--  1 root  root      4 Sep 13 16:34 klogd.pid
drwxr-xr-x  3 root  root     60 Jul 20 09:17 lock
drwxr-xr-x  3 root  root     60 Jul 20 09:17 log
drwxr-xr-x  2 root  root     60 Jul 20 09:17 mount
-rw-r--r--  1 root  root     42 Jul 20 09:17 nologin
drwxr-xr-x  3 root  root     80 Oct  8 19:19 openvpn
drwxr-xr-x  2 root  root     60 Sep 13 16:34 plymouth
drwxr-xr-x  3 root  root     80 Sep 13 16:34 resolvconf
-rw-r--r--  1 root  root      4 Sep 13 16:34 syslogd.pid
drwxr-xr-x 17 root  root    400 Sep 13 16:34 systemd
drwxr-xr-x  2 root  root     60 Jul 20 09:17 tmpfiles.d
drwxr-xr-x  7 root  root    160 Oct  9 21:17 udev
drwxr-xr-x  2 root  root     40 Jul 20 09:17 user
-rw-rw-r--  1 root  utmp   1920 Oct  9 21:18 utmp
-rw-------  1 root  root      0 Sep 13 16:34 xtables.lock

As another test of the socket’s presence I tried to run the sdptool in browse local mode, which failed:

root@d379470:/# sdptool browse local
Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory

But according to information online ( https://www.spinics.net/lists/linux-bluetooth/msg36894.html ) running bluetoothd in --compat mode should have done the trick.

This is as far as I managed to get myself and would appreciate any help! :slight_smile: Thanks!