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
310 stars 45 forks source link

Receiving empty Buffer in characteristic.on() #19

Closed TIB28 closed 3 years ago

TIB28 commented 3 years ago

When subscribing a characteristic it give an empty buffer.

Here is my code running on rpi4 with Debian Buster:

await characteristic.startNotifications()
characteristic.on('valuechanged', buffer => {
  console.log(buffer) // Show empty Buffer: <Buffer >
})

await characteristic.readValue() // Trigger the callback
TIB28 commented 3 years ago

Found out that my BLE sensor was faulty.