Last update for a little while.
I have spent the last few hours working with node-red-contrib-noble-bluetooth
and the scan, connect, and read part was easy and worked properly. I have not been able to get a "write" to work. I can inject a buffer object with a hex value of 0x01 which is what I was using to turn on the LED when I was using node-red-contrib-generic-ble
but it is not working.
I get no errors, but the message is not being sent to the Arduino. I have the serial monitor open for the Arduino which gives me feedback about when devices connect, disconnect, or a message is received. I get a "connected device" message, but nothing when I send the write. The device remains connected.
Here is my Node-RED flow if someone would like to help me figure out what is going wrong. I would also appreciate anyone chiming in who has used this package to successfully read and write to a peripheral device.
[{"id":"204c2dc0.c9dcb2","type":"inject","z":"f04655a6.2e0548","name":"Start scan","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start","payload":"{}","payloadType":"json","x":120,"y":360,"wires":[["35c7b3f4.1bddfc"]]},{"id":"35c7b3f4.1bddfc","type":"BLE scanner","z":"f04655a6.2e0548","name":"","services":"19b10000e8f2537e4f6cd104768a1214","servicesType":"str","continuous":false,"x":290,"y":380,"wires":[["bd89d1.4ab0063"]]},{"id":"bd89d1.4ab0063","type":"BLE device","z":"f04655a6.2e0548","name":"","x":470,"y":380,"wires":[[]]},{"id":"067b3cad9215e4d9","type":"debug","z":"f04655a6.2e0548","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":460,"wires":[]},{"id":"faebedd8db71416e","type":"inject","z":"f04655a6.2e0548","name":"Stop scan","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"stop","payload":"{}","payloadType":"json","x":120,"y":400,"wires":[["35c7b3f4.1bddfc"]]},{"id":"bc867c0d3e1bede0","type":"BLE in","z":"f04655a6.2e0548","topic":"read","characteristic":"19b10001e8f2537e4f6cd104768a1214","name":"Read manufacturer","x":290,"y":460,"wires":[["067b3cad9215e4d9"]]},{"id":"2e68bb70a9aefd0b","type":"inject","z":"f04655a6.2e0548","name":"","props":[{"p":"peripheral","v":"84cca8777466","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":460,"wires":[["bc867c0d3e1bede0"]]},{"id":"2e8f6f036825a497","type":"inject","z":"f04655a6.2e0548","name":"","props":[{"p":"peripheral","v":"84cca8777466","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":520,"wires":[["b3b3b4f995bdb926"]]},{"id":"13cf4b0257c0ae34","type":"BLE out","z":"f04655a6.2e0548","characteristic":"19b10001e8f2537e4f6cd104768a1214","name":"","x":480,"y":520,"wires":[]},{"id":"b3b3b4f995bdb926","type":"function","z":"f04655a6.2e0548","name":"function 1","func":"msg.payload = Buffer.from(\"01\", \"hex\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":520,"wires":[["13cf4b0257c0ae34"]]}]