# Send and receive binary data via TCP

**URL:** <https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019>\
**Category:** General\
**Created:** [4 March 2021 13:46 UTC](https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019 "2021-03-04T13:46:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![varicon](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@varicon](https://discourse.nodered.org/u/varicon)\
**Post date:** [4 March 2021 13:46 UTC](https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019/1 "2021-03-04T13:46:46Z")

</div>

Hi all,

I am currenty trying to send a command to a sensor and receive its answer.  
This works great with a terminal tool (e.g. IO Ninja)

Send & Receive

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/6192935fd4a007491e21a99847c413447e680c54.png)

Same I'd like to achieve with node red:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/f/7f74304f06ccef7b12569b72759a6bd1277bdd2b.png)

but it does not give any answers on TCP Output node.

Do you have any suggestions?

Thanks  
Gerald

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 March 2021 13:50 UTC](https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019/2 "2021-03-04T13:50:17Z")

</div>

Try the TCP request node instead of in and out nodes.

Also, if you are not fully up to speed on nodejs buffers, you might get some use from buffer-parser node (it includes a buffer maker node)

---

<div class="post-metadata">

**Author:** ![varicon](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@varicon](https://discourse.nodered.org/u/varicon)\
**Post date:** [4 March 2021 14:21 UTC](https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019/3 "2021-03-04T14:21:47Z")

</div>

Dear Steve,

you are right, that solves the issue 😃

I wonder whats he difference between these TCP nodes 🤔

THX  
BR  
Gerald

---

<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:** [18 March 2021 14:21 UTC](https://discourse.nodered.org/t/send-and-receive-binary-data-via-tcp/42019/4 "2021-03-18T14:21:56Z")

</div>

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