chrvadala / node-ble

Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
https://www.npmjs.com/package/node-ble
MIT License
315 stars 46 forks source link

Unhandled getRSSI #6

Closed buildog closed 4 years ago

buildog commented 4 years ago
(node:1883) UnhandledPromiseRejectionWarning: DBusError: No such property 'rssi'
    at _methodReturnHandlers.(anonymous function) (/root/bergepi/node_modules/dbus-next/lib/bus.js:339:27)
    at handleMessage (/root/bergepi/node_modules/dbus-next/lib/bus.js:98:11)
    at EventEmitter.MessageBus.conn.on (/root/bergepi/node_modules/dbus-next/lib/bus.js:147:9)
    at EventEmitter.emit (events.js:198:13)
    at EventEmitter.emit (domain.js:448:20)
    at /root/bergepi/node_modules/dbus-next/lib/connection.js:112:14
    at Socket.<anonymous> (/root/bergepi/node_modules/dbus-next/lib/message.js:63:9)
    at Socket.emit (events.js:198:13)
    at Socket.EventEmitter.emit (domain.js:448:20)
    at emitReadable_ (_stream_readable.js:555:12)
(node:1883) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
chrvadala commented 4 years ago

Looks like that RSSI property is optional and sometimes it is not available. In order to understand conditions where rssi is not provided, I have to investigate more.

Looks like getTXPower has same behaviour

I attach here a stack trace for further analyses

 DBusError: No such property 'RSSI'

      at _methodReturnHandlers.<computed> (node_modules/dbus-next/lib/bus.js:339:27)
      at handleMessage (node_modules/dbus-next/lib/bus.js:98:11)
      at EventEmitter.<anonymous> (node_modules/dbus-next/lib/bus.js:147:9)
      at node_modules/dbus-next/lib/connection.js:112:14
      at Socket.<anonymous> (node_modules/dbus-next/lib/message.js:63:9)
buildog commented 4 years ago

RSSI/TXPower is available until connection