# TCP IP Send receive data

**URL:** <https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315>\
**Category:** General\
**Created:** [9 September 2019 11:56 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315 "2019-09-09T11:56:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [9 September 2019 11:56 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/1 "2019-09-09T11:56:10Z")

</div>

HI,

I'm new to Node Red  
I have RFID reader which works on TCPIP and i need to connect reader using TCPIP and its port i.e. 2189

I'm unable to connect Reader and get data from reader using Node red. I need to connect reader and get RFID tag data as and when it reads it should through data and i should store in MSSQL database.

Request you to please share sample code.

Your earliest reply is highly appreciated.

Thanks & Regards,

Haresh Maheshwari

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [9 September 2019 12:04 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/2 "2019-09-09T12:04:53Z")

</div>

First step is what have YOU tried?

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [9 September 2019 12:06 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/3 "2019-09-09T12:06:47Z")

</div>

Okay, starting from the start. Node-RED has a TCP node available that you can use. It's builtin so you won't have to install anything for it. Next thing you need is knowing at what IP address the reader is available, and the correct port.

Thirdly, look at the Flows library for MSSQL nodes/setup. [https://flows.nodered.org/?term=mssql&num\_pages=1](https://flows.nodered.org/?term=mssql&num_pages=1)

But like @ukmoose wrote before I could hit reply, what have you tried yourself? These three steps you could have found yourself by reading the documentation on the site, and clicking on the big word "flows" in the header, as well as "documentation" in the same bar. And the TCP node is builtin so it's easy to see when you start Node-RED for the first time as well 🙂

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [9 September 2019 12:27 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/4 "2019-09-09T12:27:54Z")

</div>

Thanks and appreciate your prompt reply.

please find attached code tried by myself.

[{"id":"299e1981.268db6","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"6173d535.077d9c","type":"inject","z":"299e1981.268db6","name":"","topic":"","payload":"read","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":120,"wires":[["990451fe.b3224"]]},{"id":"990451fe.b3224","type":"tcp request","z":"299e1981.268db6","server":"192.168.0.199","port":"2189","out":"sit","splitc":" ","name":"","x":520,"y":80,"wires":[["6dacc9e8.853a38"]]},{"id":"6dacc9e8.853a38","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":160,"wires":},{"id":"55059129.65c03","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":240,"wires":[]},{"id":"37f495b3.3a633a","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":920,"y":360,"wires":},{"id":"6bb40740.261c28","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":300,"wires":[]},{"id":"bac625a2.145788","type":"udp in","z":"299e1981.268db6","name":"","iface":"","port":"93","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":280,"y":540,"wires":[["915f1047.05736"]]},{"id":"915f1047.05736","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":540,"wires":}]

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [9 September 2019 12:28 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/5 "2019-09-09T12:28:36Z")

</div>

Unfortunately your flow isn't currently importable.Please read the following post [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) and then edit the above message.

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [9 September 2019 12:33 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/6 "2019-09-09T12:33:18Z")

</div>

[{"id":"299e1981.268db6","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"6173d535.077d9c","type":"inject","z":"299e1981.268db6","name":"","topic":"","payload":"read","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":120,"wires":[["990451fe.b3224"]]},{"id":"990451fe.b3224","type":"tcp request","z":"299e1981.268db6","server":"192.168.0.199","port":"2189","out":"sit","splitc":" ","name":"","x":520,"y":80,"wires":[["6dacc9e8.853a38"]]},{"id":"6dacc9e8.853a38","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":160,"wires":},{"id":"55059129.65c03","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":240,"wires":[]},{"id":"37f495b3.3a633a","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":920,"y":360,"wires":},{"id":"6bb40740.261c28","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":300,"wires":[]},{"id":"bac625a2.145788","type":"udp in","z":"299e1981.268db6","name":"","iface":"","port":"93","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":280,"y":540,"wires":[["915f1047.05736"]]},{"id":"915f1047.05736","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":540,"wires":}]`Preformatted text`

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [9 September 2019 12:34 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/7 "2019-09-09T12:34:47Z")

</div>

Still not... do it again but replace the "Preformatted text" that shows when you click on `</>` by your flow.

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [9 September 2019 12:36 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/8 "2019-09-09T12:36:31Z")

</div>

I will share you code shortly

Thanks for immediate response.

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [9 September 2019 12:37 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/9 "2019-09-09T12:37:09Z")

</div>

Can you share a sample link showing TCPIP receiving data!

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [9 September 2019 12:47 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/10 "2019-09-09T12:47:36Z")

</div>

> [@H2172412](#):
>
> {"id":"6bb40740.261c28","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":300,"wires":},

So you appear to be trying to connect to port 90 on the same machine that Node-RED is running (localhost) ? Are you sure that's the correct details for your RFID reader?  
To connect via TCP to your RFID reader you would need to enter your RFID readers IP address and the correct port number. But please post your flow in the correct format

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 06:57 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/11 "2019-09-10T06:57:56Z")

</div>

[{"id":"299e1981.268db6","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"6173d535.077d9c","type":"inject","z":"299e1981.268db6","name":"","topic":"","payload":"read","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":120,"wires":[["990451fe.b3224"]]},{"id":"990451fe.b3224","type":"tcp request","z":"299e1981.268db6","server":"192.168.0.199","port":"2189","out":"sit","splitc":" ","name":"","x":520,"y":80,"wires":[["6dacc9e8.853a38"]]},{"id":"6dacc9e8.853a38","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":160,"wires":},{"id":"55059129.65c03","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":240,"wires":[]},{"id":"37f495b3.3a633a","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":920,"y":360,"wires":},{"id":"6bb40740.261c28","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":300,"wires":[]},{"id":"bac625a2.145788","type":"udp in","z":"299e1981.268db6","name":"","iface":"","port":"93","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":280,"y":540,"wires":[["915f1047.05736"]]},{"id":"915f1047.05736","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":540,"wires":}]

```auto

```

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 06:58 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/12 "2019-09-10T06:58:27Z")

</div>

Above code for your perusal

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [10 September 2019 07:39 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/13 "2019-09-10T07:39:30Z")

</div>

Export your flow again and follow this topic

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 07:52 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/14 "2019-09-10T07:52:35Z")

</div>

```auto
[{"id":"299e1981.268db6","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"6173d535.077d9c","type":"inject","z":"299e1981.268db6","name":"","topic":"","payload":"read","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":120,"wires":[["990451fe.b3224"]]},{"id":"990451fe.b3224","type":"tcp request","z":"299e1981.268db6","server":"192.168.0.199","port":"2189","out":"sit","splitc":" ","name":"","x":430,"y":40,"wires":[["6dacc9e8.853a38"]]},{"id":"6dacc9e8.853a38","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":590,"y":160,"wires":[]},{"id":"55059129.65c03","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":240,"wires":[[]]},{"id":"37f495b3.3a633a","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":920,"y":360,"wires":[]},{"id":"6bb40740.261c28","type":"tcp request","z":"299e1981.268db6","server":"localhost","port":"90","out":"time","splitc":"0","name":"","x":930,"y":300,"wires":[[]]},{"id":"bac625a2.145788","type":"udp in","z":"299e1981.268db6","name":"","iface":"","port":"93","ipv":"udp4","multicast":"false","group":"","datatype":"utf8","x":280,"y":540,"wires":[["915f1047.05736"]]},{"id":"915f1047.05736","type":"debug","z":"299e1981.268db6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":490,"y":540,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 07:53 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/15 "2019-09-10T07:53:06Z")

</div>

Please check and advice

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [10 September 2019 08:09 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/16 "2019-09-10T08:09:14Z")

</div>

What are you expecting someone to check?

Only you know which RFID reader you are running and therefore how you need to connect it.  
I would start off by adding a debug node to the TCP node you are using if you are sure that is configured correctly and see if you get any data.  
If not, you need to understand how to get a reading from the RFID readers manual.

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 08:18 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/17 "2019-09-10T08:18:36Z")

</div>

Hi,

When i connect reader to Putty and use reader ip address and port it gets connected  
When i send command it replies with tag data if available same i want to do it using Node-red

My request is that if you can share me FLOW using which i can create connection and get data

I'm hear to learn and explore if you can help and guide is appreciated

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 10:37 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/18 "2019-09-10T10:37:35Z")

</div>

Please reply or share link from i can learn Node red in detailed.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [10 September 2019 10:40 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/19 "2019-09-10T10:40:00Z")

</div>

Sure

[https://nodered.org/docs/user-guide/](https://nodered.org/docs/user-guide/)  
[https://cookbook.nodered.org](https://cookbook.nodered.org)

---

<div class="post-metadata">

**Author:** ![H2172412](https://avatars.discourse-cdn.com/v4/letter/h/f1d935/32.png) [@H2172412](https://discourse.nodered.org/u/H2172412)\
**Post date:** [10 September 2019 12:08 UTC](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315/20 "2019-09-10T12:08:45Z")

</div>

Thanks for your reply But it does not have details on getting TCP IP data can you share link having details of TCP IP receiving data and Sending data

[Next page](https://discourse.nodered.org/t/tcp-ip-send-receive-data/15315.md?page=2)
