# TCP/IP 3 way handshake

**URL:** https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059
**Category:** General
**Created:** [9 June 2020 13:25 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059 "2020-06-09T13:25:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![winnemd](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/winnemd/32/23636_2.png) [@winnemd](https://discourse.nodered.org/u/winnemd)
#### Post date: [9 June 2020 13:25 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/1 "2020-06-09T13:25:19Z")

</div>

Hi everybody!

I like to use Node-RED to power on my home cinema projector over TCP/IP.  
A so-called 3-way handshake is used to establish a connection and then a hex command must be sent.  
When I open the connection with a "tcp in" node I get the first answer for the connection (PJ\_OK, as a string) ... now I need to send PJREQ as a string and wait for PJACK as a reply to finally send the real comand (HEX: 21 89 01 50 57 30 0A)

Any ideas to get this solved in Node-RED? It looks so simple, but I just can't get it to work!

BR

---

<div class="post-metadata">

### Author: ![ristomatti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ristomatti/32/5857_2.png) [@ristomatti](https://discourse.nodered.org/u/ristomatti)
#### Post date: [9 June 2020 13:37 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/2 "2020-06-09T13:37:18Z")

</div>

Could this be of help: [https://github.com/dermotduffy/jvc\_proxy](https://github.com/dermotduffy/jvc_proxy)? I don't have such a projector but I did a quick search with your description of the protocol and found this.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 June 2020 13:54 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/3 "2020-06-09T13:54:30Z")

</div>

failing that... for this sort of handshaking I would use the tcp-request node rather than the in and out nodes.

---

<div class="post-metadata">

### Author: ![winnemd](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/winnemd/32/23636_2.png) [@winnemd](https://discourse.nodered.org/u/winnemd)
#### Post date: [9 June 2020 14:30 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/4 "2020-06-09T14:30:54Z")

</div>

Thanks for your reply! Can I use a single tcp-request node to send each command after the other? This is somehow not working ... or do I have to use multiple tcp-request nodes for my task?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 June 2020 14:39 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/5 "2020-06-09T14:39:24Z")

</div>

you should be able to use just the one. You would need to marshal the correct messages into it in the correct sequence of course. You may need to send blank or null character to start to make it connect in the first place.

---

<div class="post-metadata">

### Author: ![winnemd](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/winnemd/32/23636_2.png) [@winnemd](https://discourse.nodered.org/u/winnemd)
#### Post date: [9 June 2020 15:03 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/6 "2020-06-09T15:03:19Z")

</div>

Do you know if the connection remains open after a return from the projector? To me it looks like this isn't because the next command brings the first answer (PJ\_OK) again ...

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [9 June 2020 16:08 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/7 "2020-06-09T16:08:39Z")

</div>

Depends if you set it to remain open

---

<div class="post-metadata">

### Author: ![winnemd](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/winnemd/32/23636_2.png) [@winnemd](https://discourse.nodered.org/u/winnemd)
#### Post date: [10 June 2020 05:09 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/8 "2020-06-10T05:09:31Z")

</div>

GOT IT!!! THX for your help! 🙂

---

<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 June 2020 05:09 UTC](https://discourse.nodered.org/t/tcp-ip-3-way-handshake/28059/9 "2020-06-24T05:09:34Z")

</div>

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