hkayann / node-red-contrib-ble-sense

Node-RED module for Bluetooth Low Energy (BLE) devices.
MIT License
6 stars 4 forks source link

Cannot connect to peripheral - how to set the json input for connect-node right? #6

Closed habakuk39 closed 1 year ago

habakuk39 commented 1 year ago

Hello!

my output of the scanner node is:

msg : Object object payload: object id: "f688728a99a1" address: "f6:88:72:8a:99:a1" addressType: "random" connectable: true advertisement: object localName: "GoPro 0476" manufacturerData: buffer[14] [0 … 9] [10 … 13] serviceData: array[1] 0: object uuid: "fea6" data: buffer[6] 0: 0x9e 1: 0xec 2: 0x4d 3: 0xcd 4: 0x4 5: 0x76 serviceUuids: array[1] 0: "fea6" solicitationServiceUuids: array[0] serviceSolicitationUuids: array[0] rssi: -61 mtu: null state: "disconnected" _msgid: "5055364a6bdac4c2"


can you please help to set up the inject node right?

the json you gave in the example was:

{ "services": [ "181a" ], "characteristics": [ "2a6e", "2a6f", "2a6d" ] }

how should we set that up to connect to my peripheral?

pleae help.

hkayann commented 1 year ago

@habakuk39 when you drag the node, leave it like that. It will try to subscribe all characteristics and services.

But please keep in mind that, I have specifically developed this for edge development boards (Arduinos etc.)

habakuk39 commented 1 year ago

Hello!

I got it connected with send the mac -adress as msg.topic of an inject node with the following syntax:

msg.topic = {"ma:c-:ad:re:ss:00"}

how to disconnect it?

hkayann commented 1 year ago

Hi @habakuk39, inject disconnect as topic.

You can see it on the Read.ME.

habakuk39 commented 1 year ago

ok, but as string or as json?

however, it would be great if you could provide an example flow, which one can import into node-red.

thank

hkayann commented 1 year ago

@habakuk39 It is a string. There is one in examples folder.

habakuk39 commented 1 year ago

thanks

hkayann commented 1 year ago

I am closing this issue as the user is happy.