# How to send a 0x00 byte in generic ble

**URL:** <https://discourse.nodered.org/t/how-to-send-a-0x00-byte-in-generic-ble/58058>\
**Category:** General\
**Created:** [9 February 2022 23:14 UTC](https://discourse.nodered.org/t/how-to-send-a-0x00-byte-in-generic-ble/58058 "2022-02-09T23:14:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max44](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@Max44](https://discourse.nodered.org/u/Max44)\
**Post date:** [9 February 2022 23:14 UTC](https://discourse.nodered.org/t/how-to-send-a-0x00-byte-in-generic-ble/58058/1 "2022-02-09T23:14:21Z")

</div>

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  
4.0.3

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 PM[node: Nordic](http://10.0.0.215:1880/#)msg : error  
"Error: Nothing to write"

2/9/2022, 5:36:26 PM[node: f3edd7764ee08629](http://10.0.0.215:1880/#)[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?

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![Max44](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@Max44](https://discourse.nodered.org/u/Max44)\
**Post date:** [10 February 2022 21:42 UTC](https://discourse.nodered.org/t/how-to-send-a-0x00-byte-in-generic-ble/58058/2 "2022-02-10T21:42:54Z")

</div>

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:

 ![BLE_Out+Nodes](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/673c32a4e97d56646820c63a7906e386d4ee719e.jpeg)

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

Cheers!  
Max

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 February 2022 21:43 UTC](https://discourse.nodered.org/t/how-to-send-a-0x00-byte-in-generic-ble/58058/3 "2022-02-24T21:43:26Z")

</div>

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