# I want to use Node-Red to emulate the Modbus slave

**URL:** https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217
**Category:** General
**Created:** [2 August 2021 15:02 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217 "2021-08-02T15:02:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Cybertron](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cybertron/32/14683_2.png) [@Cybertron](https://discourse.nodered.org/u/Cybertron)
#### Post date: [2 August 2021 15:02 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/1 "2021-08-02T15:02:09Z")

</div>

I want to use node-red to simulate the modbus slave.  
Let me first explain why I have such a strange need.  
I'm using an Internet of things cloud platform, which uses the standard modbus protocol. I have a lot of devices in node-red, and I need to upload values and control devices to this cloud platform, so this demand arises.  
My node-red currently communicates with the cloud platform by:  
Cloud platform → hardware for Ethernet to 485 communication provided by cloud platform →485 to usb →A node-red running in a docker container on an armbian system.  
I can currently test the normal communication between node-red and the cloud platform to send and receive data, but there are no nodes in the node market about modbus slaves. Is there any other way to achieve this problem? I don't want to build wheels.  
Thank you in advance for your help.

---

<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: [2 August 2021 15:06 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/2 "2021-08-02T15:06:26Z")

</div>

> [@Cybertron](#):
>
> there are no nodes in the node market about modbus slaves. Is there any other way to achieve

Yes there is.

slave == server

> **[node-red-contrib-modbus](https://flows.nodered.org/node/node-red-contrib-modbus)**
>
> The all in one Modbus TCP and Serial contribution package for Node-RED.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28cb685e6b6f9095ae735942ce071f7e7dca9dd1.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: [2 August 2021 15:08 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/3 "2021-08-02T15:08:11Z")

</div>

> [@Cybertron](#):
>
> I'm using an Internet of things cloud platform, which uses the standard modbus protocol. I have a lot of devices in node-red, and I need to upload values and control devices to this cloud platform, so this demand arises.

Doesn't this `"Internet of things cloud platform"` support MQTT? Seems like it not a great platform if not.

MQTT is far simpler and far more extensible than ModBus.

---

<div class="post-metadata">

### Author: ![Cybertron](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cybertron/32/14683_2.png) [@Cybertron](https://discourse.nodered.org/u/Cybertron)
#### Post date: [2 August 2021 15:09 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/4 "2021-08-02T15:09:16Z")

</div>

Unfortunately, he does not support MQTT

---

<div class="post-metadata">

### Author: ![Cybertron](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cybertron/32/14683_2.png) [@Cybertron](https://discourse.nodered.org/u/Cybertron)
#### Post date: [2 August 2021 15:16 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/5 "2021-08-02T15:16:13Z")

</div>

I tried the node you mentioned, and I found that it might be running as a mainframe rather than a slave  
Maybe I did it the wrong way.

---

<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: [2 August 2021 15:44 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/6 "2021-08-02T15:44:31Z")

</div>

There are both client and server capabilities in that node.

The read / write nodes are master/client nodes.

The server nodes are slave/server nodes.

Do you know what you want/need?

---

<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: [16 August 2021 15:44 UTC](https://discourse.nodered.org/t/i-want-to-use-node-red-to-emulate-the-modbus-slave/49217/7 "2021-08-16T15:44:42Z")

</div>

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