java - BlueCove with Bluez chucks "Can not open SDP session. [2] No such file or directory" -
i trying write simple bluetooth server accepts connection heartrate-device (bluetooth le) raises exception
javax.bluetooth.serviceregistrationexception: can not open sdp session. [2] no such file or directory @ com.intel.bluetooth.bluetoothstackbluez.opensdpsessionimpl(native method) ~[bluecove-gpl-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.bluetoothstackbluez.getsdpsession(bluetoothstackbluez.java:518) ~[bluecove-gpl-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.bluetoothstackbluez.registersdprecord(bluetoothstackbluez.java:543) ~[bluecove-gpl-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.bluetoothstackbluez.rfserveropen(bluetoothstackbluez.java:607) ~[bluecove-gpl-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.bluetoothrfcommconnectionnotifier.<init>(bluetoothrfcommconnectionnotifier.java:42) ~[bluecove-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.microeditionconnector.openimpl(microeditionconnector.java:389) ~[bluecove-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.intel.bluetooth.microeditionconnector.open(microeditionconnector.java:156) ~[bluecove-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ javax.microedition.io.connector.open(connector.java:83) ~[bluecove-2.1.1-snapshot-63.jar:2.1.1-snapshot] @ com.mmazurcz.bluetoothserver.waitthread.waitforconnection(waitthread.java:39) [classes/:na] @ com.mmazurcz.bluetoothserver.waitthread.run(waitthread.java:60) [classes/:na] @ java.lang.thread.run(thread.java:745) [na:1.8.0_45]
i running code on arch linux machine kernel "4.0.5-1-arch #1 smp preempt". java openjdk @ version 1.8.0_45 , bluecove @ version 2.1.1-snapshot-63. i've got following bluez artifacts installed:
- bluez 5.30-1
- bluez-firmware 1.2-8
- bluez-libs 5.30-1
- bluez-utils 5.30-1
the bluetooth dongle using , running , can scan heart-rate device using "hcitool -i hci0 lescan". running code root-user.
so, here piece of code brings me in trouble:
streamconnectionnotifier notifier; streamconnection connection = null; // setup server listen connection try { local = localdevice.getlocaldevice(); log.info("set local device bt address: " + local.getbluetoothaddress()); local.setdiscoverable(discoveryagent.giac); log.info("set local device giac discovery mode"); uuid uuid = new uuid("1101", true); string url = "btspp://localhost:" + uuid.tostring() + ";name=remotebluetooth"; notifier = (streamconnectionnotifier) connector.open(url); } catch (exception e) { log.error("exception in waitthread.waitforconnection", e); return; }
any ideas?
first: know rather old post, got here quite through google , got working on machine.
to got working need start bluetooth daemon '-c' (or '--compat') option. done making following change:
open terminal , enter
sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service
change line
execstart=/usr/lib/bluetooth/bluetoothd
to
execstart=/usr/lib/bluetooth/bluetoothd -c
(simply adding -c option)
now need restart system daemons: sudo systemctl daemon-reload
and restart bluetooth service: sudo systemctl restart bluetooth
i found solution here: raspberrypi forum: bluetooth rfcomm - jessie
hope still someone!
Comments
Post a Comment