CANDY-LINE / node-red-contrib-generic-ble

A Node-RED node set for providing access to generic BLE peripheral GATT characteristics.
Apache License 2.0
24 stars 22 forks source link

characteristics are undefined when using Notify #25

Closed aeremin closed 4 years ago

aeremin commented 4 years ago

I am using Generic BLE In node. I was able to succesfully set it up and connect to my BLE device. When I am sending message

{
  "payload": {},
  "topic": "000015241212efde1523785feabcd123"
}

as an input, I successfully get something like

{ 
  payload: { 
    uuid: 'f078e37bd4fd',
    characteristics: { '000015241212efde1523785feabcd123': <Buffer 00> }
  },
  _msgid: 'bba3cde1.150fa' 
}

as an output.

Buth when input is

{
  "payload": {
    "notify": true,
    "period": 0
  },
  "topic": "000015241212efde1523785feabcd123"
}

I get output events every time relevant characteristic changes, but they look like this:

{
  payload: {
    uuid: 'f078e37bd4fd',
    characteristics: undefined
  },
  _msgid: '48901e10.8f95' 
}

I am running on Raspberry Pi 3 with recent Raspbian Buster: 5 Oct 13:07:38 - [info] Node-RED version: v1.0.1 5 Oct 13:07:38 - [info] Node.js version: v10.16.3 5 Oct 13:07:38 - [info] Linux 4.19.57-v7+ arm LE 5 Oct 13:07:39 - [info] Loading palette nodes 5 Oct 13:07:39 - [debug] Module: node-red-contrib-generic-ble 3.1.0

dbaba commented 4 years ago

Weird. characteristics shouldn't be undefined when an event message arrives at Raspberry pi from a BLE peripheral. At least, it should contain a property entry notification: true (see this code). So the message (_msgid: '48901e10.8f95') you showed seems not to related to the event message.

Do you have more precise info, for example, a flow data you use?

dbaba commented 4 years ago

Re-open this when you have update.