Can't discover service, and then 'org.bluez.Error.Failed' after a minute
See original GitHub issueI’m using RPi 4 (with node 14.9.0, BlueZ 5.50). I can discover the device, but not the service.
require('dotenv').config()
const { createBluetooth } = require('.')
const { TEST_DEVICE, TEST_SERVICE, TEST_CHARACTERISTIC, TEST_NOTIFY_SERVICE, TEST_NOTIFY_CHARACTERISTIC } = process.env
async function main () {
const { bluetooth, destroy } = createBluetooth()
// get bluetooth adapter
const adapter = await bluetooth.defaultAdapter()
await adapter.startDiscovery()
console.log('discovering')
// get device and connect
const device = await adapter.waitDevice('D4:CA:6E:F1:84:BE')
console.log('got device', await device.getAddress(), await device.getName())
await device.connect()
console.log('connected')
const gattServer = await device.gatt()
// read write characteristic
const service1 = await gattServer.getPrimaryService('15172000-4947-11e9-8646-d663bd873d93')
console.log('got primary service.')
const characteristic1 = await service1.getCharacteristic('15172001-4947-11e9-8646-d663bd873d93')
console.log('got control characteristic.')
//await characteristic1.writeValue(Buffer.from('Hello world'))
const buffer = await characteristic1.readValue()
console.log('read', buffer, buffer.toString())
}
main()
.then(console.log)
.catch(console.error)
Console output
discovering
got device D4:CA:6E:F1:84:BE Xsens DOT
DBusError: Software caused connection abort
at _methodReturnHandlers.<computed> (/home/pi/node-ble-master/node_modules/dbus-next/lib/bus.js:339:27)
at handleMessage (/home/pi/node-ble-master/node_modules/dbus-next/lib/bus.js:98:11)
at EventEmitter.<anonymous> (/home/pi/node-ble-master/node_modules/dbus-next/lib/bus.js:147:9)
at EventEmitter.emit (events.js:314:20)
at /home/pi/node-ble-master/node_modules/dbus-next/lib/connection.js:112:14
at Socket.<anonymous> (/home/pi/node-ble-master/node_modules/dbus-next/lib/message.js:63:9)
at Socket.emit (events.js:314:20)
at emitReadable_ (_stream_readable.js:563:12)
at processTicksAndRejections (internal/process/task_queues.js:79:21) {
type: 'org.bluez.Error.Failed',
text: 'Software caused connection abort',
reply: Message {
type: 3,
_sent: false,
_serial: 1494,
path: undefined,
interface: undefined,
member: undefined,
errorName: 'org.bluez.Error.Failed',
replySerial: 13,
destination: ':1.68',
sender: ':1.22',
signature: 's',
body: [ 'Software caused connection abort' ],
flags: 1
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Error when trying to connect to bluetooth speaker: `org.bluez ...
This may be due to the pulseaudio-module-bluetooth package not being installed. Install it if it missing, then restart pulseaudio.
Read more >org.bluez.Error.Failed br-connection-unknown - Ask Ubuntu
Today after booting up the computer I was able to pair the speaker, I have no idea why. However I am now getting...
Read more >Failed to connect: org.bluez.Error.Failed - Raspberry Pi Forums
I have a vanilla Raspberry OS installation. My HDMI monitor has no audio. I tried to connect JBL Flip 4 - error (please...
Read more >[SOLVED] Bluetooth connect failed: br-connection-profile ...
Failed to connect: org.bluez.Error.Failed br-connection-profile- ... after doing a full reboot and then in bluetoothctl a trust <dev>; ...
Read more >Bluetooth refuses to work properly - Bug reports - EndeavourOS
When trying to connect the buds+ it is even worse, since the whole bluetooth service hangs up and I need to reboot the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was using Raspberry Pi 3 and 4. Upgrading to the latest version of Raspbian (Raspberry Pi OS) solved the problem for me.
I get the same problem. I’m running in a Docker Image on a RPi4.
I can ssh into the docker image and when I try https://github.com/chrvadala/node-ble/issues/13#issuecomment-761858089 I get the following :
In my code, I can get the device, and getAddress and getName work as expected, but when I attempt to connect, I get :
*** BLE devices: [ ‘7B:41:00:00:04:98’, ‘DC:0D:30:01:14:C3’ ] got device 7B:41:00:00:04:98 ThermoBeacon false (node:32) UnhandledPromiseRejectionWarning: DBusError: Software caused connection abort at methodReturnHandlers.(anonymous function) (/srv/node_modules/dbus-next/lib/bus.js:343:27) at handleMessage (/srv/node_modules/dbus-next/lib/bus.js:101:11) at EventEmitter.MessageBus.conn.on (/srv/node_modules/dbus-next/lib/bus.js:151:9) at EventEmitter.emit (events.js:198:13) at /srv/node_modules/dbus-next/lib/connection.js:116:14 at Socket.<anonymous> (/srv/node_modules/dbus-next/lib/message.js:63:9) at Socket.emit (events.js:198:13) [Logs] [4/10/2021, 1:23:47 PM] [smart-hub] at emitReadable (_stream_readable.js:555:12) [Logs] [4/10/2021, 1:23:47 PM] [smart-hub] at process._tickCallback (internal/process/next_tick.js:63:19)