How to send a 0x00 byte in generic ble

Node-RED version: v2.1.4
Node.js version: v14.18.1
Linux 5.10.52+ arm LE

Running on a RPi Zero W
Library: node-red-contrib-generic-ble

I'm trying to integrate BLE into a flow. I can connect to my BLE device (right now a Nordic nRF52840 DK) and write to and read from from the device. However, one of the characteristics is a simple switch to toggle the on board LED: send 0x01 to turn on, send 0x00 to turn off. The write function isn't allowing me to send a zero byte. I keep getting:

2/9/2022, 5:36:26 PMnode: Nordicmsg : error
"Error: Nothing to write"

2/9/2022, 5:36:26 PMnode: f3edd7764ee08629[object Object] : msg.topic : Object
{ 000015251212efde1523785feabcd123: "00" }

I've tried a number of variations for the value, the "00" string above, just an int of 0, and a 1 byte array with 0. Everything returns "Nothing to write".

I can send a "01" no problem.

Is it possible to transmit 0x00 from the generic ble out node? Can someone tell me how?


I found the problem ... due to inexperience with the BLE library. I was trying to feed inputs to the characteristic using same generic ble out node. What I found worked was to define another node, one to send the "01" and another to send the "00".

This works now with the Nordic nRF52840 DK running the ble_app_blinky.

Here's picture of the flow:

I hope this might help someone else making the same mistake!


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.