You are not logged in.

#1 2015-10-20 08:22:59

Grovertje
Member
Registered: 2015-10-20
Posts: 1

Bluetooth (bluez5 + blueman) working for unified remote server

I would like to use bluetooth in combination with unified remote server.
I tried the setup as documented  on the arch wiki bluetooth page but I run into this SDP error.
I' m stuck with the message (from unified remote server) "Bluetooth: Could not connect to SDP".
This is where i got lost.
Is there any (good) documentation about how setting up bluez5 correctly?
Thnx in advance.

But maybe step 1 is:
Get blueman to work with bluez5...
That doesn' t work either (paring/connecting).
What' s the use of a GUI when you have to connect through the command line?
It can work, that i know.
A default install of linux mint and ubuntu (using bluez5 and blueman) for example...
In those distro's the setup is ok (but kinda hocus pocus to me how they did that...) and you can use blueman as you would expect.

Output from : sudo systemctl status -l bluetooth

bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
   Active: active (running) since di 2015-10-20 15:32:48 CEST; 6min ago
     Docs: man:bluetoothd(8)
Main PID: 431 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─431 /usr/lib/bluetooth/bluetoothd

okt 20 15:34:06 woefie bluetoothd[431]: Not enough free handles to register service
okt 20 15:34:06 woefie bluetoothd[431]: Current Time Service could not be registered
okt 20 15:34:06 woefie bluetoothd[431]: gatt-time-server: Input/output error (5)
okt 20 15:34:06 woefie bluetoothd[431]: Not enough free handles to register service
okt 20 15:34:06 woefie bluetoothd[431]: Not enough free handles to register service
okt 20 15:34:06 woefie bluetoothd[431]: Sap driver initialization failed.
okt 20 15:34:06 woefie bluetoothd[431]: sap-server: Operation not permitted (1)
okt 20 15:34:06 woefie bluetoothd[431]: Endpoint registered: sender=:1.11 path=/MediaEndpoint/A2DPSource
okt 20 15:34:06 woefie bluetoothd[431]: Endpoint registered: sender=:1.11 path=/MediaEndpoint/A2DPSink
okt 20 15:34:30 woefie bluetoothd[431]: connect error: Host is down (112)


Action taken (by reading and instinct)....

1.
systemctl enable bluetooth.service

2.
#nano /etc/systemd/system/dbus-org.bluez.service

ExecStart=/usr/lib/bluetooth/bluetoothd --compat

3.
# systemctl daemon-reload
# systemctl restart bluetooth

4.
chmod 777 /var/run/sdp

With these mutations the error message from unified remote server disapeared.
Now we have: "Bluetooth: Interface is listening"
Looks good
However, still no connection can be made with the client app....

systemctl status dbus-org.bluez.service
● bluetooth.service - Bluetooth service
   Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: disabled)
   Active: active (running) since di 2015-10-20 17:20:44 CEST; 6min ago
     Docs: man:bluetoothd(8)
Main PID: 2942 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─2942 /usr/lib/bluetooth/bluetoothd --compat

okt 20 17:20:44 woefie bluetoothd[2942]: Not enough free handles to register service
okt 20 17:20:44 woefie bluetoothd[2942]: Current Time Service could not be registered
okt 20 17:20:44 woefie bluetoothd[2942]: gatt-time-server: Input/output error (5)
okt 20 17:20:44 woefie bluetoothd[2942]: Not enough free handles to register service
okt 20 17:20:44 woefie bluetoothd[2942]: Not enough free handles to register service
okt 20 17:20:44 woefie bluetoothd[2942]: Sap driver initialization failed.
okt 20 17:20:44 woefie bluetoothd[2942]: sap-server: Operation not permitted (1)
okt 20 17:20:44 woefie bluetoothd[2942]: Endpoint registered: sender=:1.11 path=/MediaEndpoint/A2DPSource
okt 20 17:20:44 woefie bluetoothd[2942]: Endpoint registered: sender=:1.11 path=/MediaEndpoint/A2DPSink
okt 20 17:20:44 woefie systemd[1]: Started Bluetooth service.

6.
rm -rf ~/.config/pulse.

7.
sudo hciconfig -a hci0 reset

8. New pairing and connecting with bluetoothctl....
And we had contact with the unified remote server using your touchscreen as a mouse for a few seconds....
Got some TCP error and the connection died.

Back to where we were.....
Any ideas?

Regards,
Allard

P.S.
Why should we, as end-users, debug developer code.....
Bluez5 and the team behind it, shame on you......

I wanna thank all the end-users in the whole wide world who are struggling with this shit and left such marvelous input on the www.
Especially the input from arch linux users is really, really good.

Last edited by Grovertje (2015-10-20 16:30:40)

Offline

#2 2016-02-02 22:43:37

hak2
Member
Registered: 2016-02-01
Posts: 1

Re: Bluetooth (bluez5 + blueman) working for unified remote server

same problem , any progress ?

Offline

#3 2016-05-05 10:34:40

darrklogik
Member
Registered: 2016-05-05
Posts: 1

Re: Bluetooth (bluez5 + blueman) working for unified remote server

Guys, you are so close. I followed the stuff on here and got closer, but still no connection. The last thing I had to do to get it to work, was ensure the bluetoothd service run with the correct permissions for the Unified Remote Server to access.

Heres the full process that i got working on my smartphone and Ubuntu 15.10 box:

--> Whoami?
# whoami
media

--> Make a new group called media, with gid of 1000, and add the user media to it:
# groupadd -g 1000 media
# sudo adduser media media

--> So what groups is media a member of now?
# groups media
media : media adm cdrom sudo dip plugdev lpadmin sambashare

--> First of all, I plugged in a cheap, USB Bluetooth dongle into the back of my linux box, and rebooted the box. I then checked to ensure it registered ok:
# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 04d9:1400 Holtek Semiconductor, Inc. PS/2 keyboard + mouse controller
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 1131:1001 Integrated System Solution Corp. KY-BT100 Bluetooth Adapter
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

--> It looks ok. I can see the ubuntu bluetooth icon in the taskbar now. Hey, I can even connect to my phone. Yay! But, the Unified remote control app or server DO not work with bluetooth yet... so, I check status of bluetooth modules:

# sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-05-06 19:44:58 AEST; 19min ago
     Docs: man:bluetoothd(8)
Main PID: 7335 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─7335 /usr/lib/bluetooth/bluetoothd --compat

May 06 19:44:58 mediaserver systemd[1]: Started Bluetooth service.

# sudo systemctl status dbus-org.bluez.service
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-05-06 19:44:58 AEST; 20min ago
     Docs: man:bluetoothd(8)
Main PID: 7335 (bluetoothd)
   Status: "Running"
   CGroup: /system.slice/bluetooth.service
           └─7335 /usr/lib/bluetooth/bluetoothd --compat

May 06 19:44:58 mediaserver systemd[1]: Started Bluetooth service.

--> now, stop bluetooth and restart it in Compatibility mode (using older method of /var/run/sdp  sockets..):
# sudo /etc/init.d/bluetooth stop
[ ok ] Stopping bluetooth (via systemctl): bluetooth.service.

--> Edit the service config file to make it load in compat mode:
# sudo vi /etc/systemd/system/dbus-org.bluez.service
Change line:
ExecStart=/usr/lib/bluetooth/bluetoothd
to:
ExecStart=/usr/lib/bluetooth/bluetoothd --compat

--> also, under the [Services] serction, enable service to run under a group or user permissions, so add line (where group=media in this instance.. your group may be different. If not sure, just set your username instead. see files: /etc/passwd or /etc/group):
Group=media
or
User=username

--> Now, reload your system services file, and restart the bluetooth service:
# sudo systemctl daemon-reload
# sudo /etc/init.d/bluetooth start
[ ok ] Starting bluetooth (via systemctl): bluetooth.service.

NOTE: To manually start the bluetoothd daemon in compat. mode, the following command will work (but don't do this here):
# sudo /usr/bin/bluetoothd -C &

--> Check to ensure bluetooth daemon is running using -C switch (*compatibility mode):
# ps -ef | grep -i bluetooth
root      7335     1  0 19:44 ?        00:00:00 /usr/lib/bluetooth/bluetoothd --compat

--> Can we now connect without sudo?
# sudo sdptool browse local
Browsing FF:FF:FF:00:00:00 ...
Service RecHandle: 0x10000
Service Class ID List:
  "PnP Information" (0x1200)
Profile Descriptor List:
  "PnP Information" (0x1200)
    Version: 0x0103

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: Invalid argument
Service Name: Generic Access Profile
Service Provider: BlueZ
Service RecHandle: 0x10001
Service Class ID List:
  "Generic Access" (0x1800)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 31
  "ATT" (0x0007)
    uint16: 0x0001
    uint16: 0x0005

Service Name: Generic Attribute Profile
Service Provider: BlueZ
Service RecHandle: 0x10002
Service Class ID List:
  "Generic Attribute" (0x1801)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 31
  "ATT" (0x0007)
    uint16: 0x0006
    uint16: 0x0009

Service Name: AVRCP CT
Service RecHandle: 0x10003
Service Class ID List:
  "AV Remote" (0x110e)
  "AV Remote Controller" (0x110f)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 23
  "AVCTP" (0x0017)
    uint16: 0x0103
Profile Descriptor List:
  "AV Remote" (0x110e)
    Version: 0x0106

Service Name: AVRCP TG
Service RecHandle: 0x10004
Service Class ID List:
  "AV Remote Target" (0x110c)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 23
  "AVCTP" (0x0017)
    uint16: 0x0103
Profile Descriptor List:
  "AV Remote" (0x110e)
    Version: 0x0105

Service Name: Message Notification
Service RecHandle: 0x10005
Service Class ID List:
  "Message Access - MNS" (0x1133)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 17
  "OBEX" (0x0008)
Profile Descriptor List:
  "Message Access" (0x1134)
    Version: 0x0102

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: Invalid argument
Service Name: Message Access
Service RecHandle: 0x10006
Service Class ID List:
  "Message Access - MAS" (0x1132)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 16
  "OBEX" (0x0008)
Profile Descriptor List:
  "Message Access" (0x1134)
    Version: 0x0100

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: Invalid argument
Service Name: Phone Book Access
Service RecHandle: 0x10007
Service Class ID List:
  "Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 15
  "OBEX" (0x0008)
Profile Descriptor List:
  "Phonebook Access" (0x1130)
    Version: 0x0101

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: Invalid argument
Service Name: Synchronization
Service RecHandle: 0x10008
Service Class ID List:
  "IrMC Sync" (0x1104)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 14
  "OBEX" (0x0008)
Profile Descriptor List:
  "IrMC Sync" (0x1104)
    Version: 0x0100

Service Name: File Transfer
Service RecHandle: 0x10009
Service Class ID List:
  "OBEX File Transfer" (0x1106)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 10
  "OBEX" (0x0008)
Profile Descriptor List:
  "OBEX File Transfer" (0x1106)
    Version: 0x0102

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: Invalid argument
Service Name: Object Push
Service RecHandle: 0x1000a
Service Class ID List:
  "OBEX Object Push" (0x1105)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 9
  "OBEX" (0x0008)
Profile Descriptor List:
  "OBEX Object Push" (0x1105)
    Version: 0x0102

Browsing FF:FF:FF:00:00:00 ...
Service Search failed: No data available
Service Name: Nokia OBEX PC Suite Services
Service RecHandle: 0x1000b
Service Class ID List:
  UUID 128: 00005005-0000-1000-8000-0002ee000001
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 24
  "OBEX" (0x0008)
Profile Descriptor List:
  "" (0x00005005-0000-1000-8000-0002ee000001)
    Version: 0x0100

Service Name: urserver
Service Description: Unified Remote Server
Service Provider: Unified Intents AB
Service RecHandle: 0x1000c
Service Class ID List:
  UUID 128: b4406055-bac6-4426-bb64-9d390b668328
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 11

--> Great! If you see the output above. However, if you dont, and you see the output below, then something is wrong with SDP connection. e.g.:
Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory

--> Also, you need to reset the bluetooth device:
# sudo hciconfig -a hci0 reset

--> get status:
# sudo hciconfig -a

hci0:    Type: BR/EDR  Bus: USB
    BD Address: 00:11:67:75:48:6F  ACL MTU: 1021:8  SCO MTU: 48:10
    UP RUNNING PSCAN ISCAN
    RX bytes:24772 acl:304 sco:0 events:910 errors:0
    TX bytes:384004 acl:641 sco:0 commands:150 errors:0
    Features: 0xff 0xfe 0x8d 0x3e 0x88 0x19 0x00 0x00
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF
    Link mode: SLAVE ACCEPT
    Name: 'mediaserver'
    Class: 0x100104
    Service Classes: Object Transfer
    Device Class: Computer, Desktop workstation
    HCI Version: 2.0 (0x3)  Revision: 0x2c6
    LMP Version: 2.0 (0x3)  Subversion: 0x2c6
    Manufacturer: Integrated System Solution Corp. (57)

--> Now all this is working, you need to pair your bluetooth device (like your smartphone) with your computer, using the gnome-bluetooth tool. This should popup in the task bar, near the network connections icon, time, and gear icon. Click it, and pair with your phone. You need to set a PIN code and enter it on your phone. Once your phone is paired to the bluetooth adapter (obiviously it is plugged into your ubuntu box). Try sending a file from your computer using the tool, to your phone. An accept/decline requester should popup on your phone.

--> Now, open your web browser, using the Unified Remote link on your desktop. If you dont have this shortcut, make sure you re-install the program using a fresh download from the website and open the *.deb file using Ubuntu Software Center. After opeing the link for the Unified Remote Webconsole (http://localhost:9510/web/#/status), you should now see:

Dashboard Tab-> Bluetooth: Interface is listening
Connections Tab -> Connections: Android-d1a384858966 etc.. authenticated 0d 00:04:44 0d 00:00:03

However, if you see:
Dashboard Tab -> Bluetooth: Cannot connect to SDP.
Connections Tab-> No Connections

Then you have a serious problem. Double check all the steps above. Ensure your phone can pair with your bluetooth adapter on ubuntu, and you can send files between your computer and phone. You may need to:
# chgrp media /usr/bin/sdptool
# chgrp media /usr/lib/bluetooth/bluetoothd
# chmod 777 /run/sdp
# sudo hciconfig -a hci0 reset
# sudo hciconfig -a hci0 UP

--> Now, open the App on your smart phone. If you dont have it, download the app from the google play store. It will have the same green wavy icon. Its called "Unified Remote Full". Goto the STATUS section, and note the "status" field. it will say:
1. Connected
2. Disconnected
3. Connecting

--> Press the "Force Connect" link, and then watch the "status" field. It should connect. If it doesnt, click the "Last Error" link, and a list of errors will pop up. If you cant connect, double check to ensure your bluetooth is on, and pair with your adapter.

Good luck.

I got it working on a Galaxy Note 5 running Android 5.1.1 connected to a Ubuntu 15.10 Wily Werewolf Desktop Edition running linux kernel 4.2.0.35-generic installed with "Unified Remote Server v3.3.5.738(41) via bluetooth USB dongle. The missing key was giving the bluetoothd service the ability to launch with the group permission of "media" group via the service configure file /etc/systemd/system/dbus-org.bluez.service.

note: you could also try editing your /etc/init.d/bluetooth file, and manually adding the -C or --compat switch. Im not sure if this will work though.

links:
https://bbs.archlinux.org/viewtopic.php?id=204079
http://unix.stackexchange.com/questions … -bluetooth

Last edited by darrklogik (2016-05-07 04:42:12)

Offline

Board footer

Powered by FluxBB