# Receive mod-bus command -- TCP nodes

**URL:** <https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256>\
**Category:** General\
**Created:** [6 May 2021 08:46 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256 "2021-05-06T08:46:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [6 May 2021 08:46 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/1 "2021-05-06T08:46:56Z")

</div>

Hi team,

i try to use a **TCP** nodes to send and receive data in the local network.

for this, i try a simple application to see the result.

i want to send a mod-bus command for an mod-bus flex getter using a function **"the attached image"** , but i couldn't receive the same message sent.

any idea !?

Thanks !

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/9/69bbfd291cf4b727e8d99ea7859231844739002a.png)  
 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ffdb7b7dc461b1fedf89934472d048ac6d1d7694.png)

---

<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:** [6 May 2021 09:00 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/2 "2021-05-06T09:00:14Z")

</div>

Not entirely certain what you are doing here but you have misspelled **address**. Maybe that is the problem?

---

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [6 May 2021 09:43 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/3 "2021-05-06T09:43:52Z")

</div>

thanks for your reply !

I fixed "address" it wasn’t the problem.

To summarize, by sending a string with " **TCP out**"(example "hello") I receive "hello" in **TCP in**.

I want to send the mod-bus command using function and **TCP out**..... ` **msg.payload = { 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 1 }** `, but I receive numbers in TCP in (buffer) or a [object Object] if i use template after the **TCP in**.

I think there’s a conversion to be made?

exept string, how I can receive any kind of messages in " **TCP in**"

---

<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:** [6 May 2021 09:54 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/4 "2021-05-06T09:54:37Z")

</div>

set the TCP in node to string?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/ef3a09c0794db5ccf58e9a1cf8c3176a3494acc9.png)

then feed that into a JSON node (assuming the text you receive is valid JSON) to get a proper JS object where you can access the values.

---

<div class="post-metadata">

**Author:** ![lyred](https://avatars.discourse-cdn.com/v4/letter/l/ccd318/32.png) [@lyred](https://discourse.nodered.org/u/lyred)\
**Post date:** [6 May 2021 10:20 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/5 "2021-05-06T10:20:10Z")

</div>

wow ! thanks that's work 😃

---

<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:** [20 May 2021 10:20 UTC](https://discourse.nodered.org/t/receive-mod-bus-command-tcp-nodes/45256/6 "2021-05-20T10:20:16Z")

</div>

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