# TCP Relay acknowledge

**URL:** https://discourse.nodered.org/t/tcp-relay-acknowledge/55714
**Category:** Hardware
**Created:** [26 December 2021 09:59 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714 "2021-12-26T09:59:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Nettuno](https://avatars.discourse-cdn.com/v4/letter/n/49beb7/32.png) [@Nettuno](https://discourse.nodered.org/u/Nettuno)
#### Post date: [26 December 2021 09:59 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/1 "2021-12-26T09:59:29Z")

</div>

Hi, I'm controlling a ESP8266 4 channel relay remotely via MQTT like this: [DC 12V ESP8266 WIFI 4-Channel Relay Module Remote Control Switch Wireless Transmitter For Smart Home](http://www.icstation.com/esp8266-wifi-channel-relay-module-remote-control-switch-wireless-transmitter-smart-home-p-13421.html)

All fine when sending ON and OFF commands to the relay.

I'd like to publish to an MQTT topic when having the acknowledge of each relay but I'm not finding it.

I've tried to listen to the TCP port of the relay but nothing appears... I've tried also to use a tcp request node but no answer when switching on and off the relay...

Any idea how to send ack messages to an mqtt topic or how get the current status of the relay?

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [26 December 2021 11:27 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/2 "2021-12-26T11:27:49Z")

</div>

Did you program the ESP8266? Arduino/Tasmota/Micro Python?

It looks like a working off the shelf product, but there is no mention of MQTT on that page.  
What MQTT broker are you using?  
What topic and payload do you send to control it?

---

<div class="post-metadata">

### Author: ![Nettuno](https://avatars.discourse-cdn.com/v4/letter/n/49beb7/32.png) [@Nettuno](https://discourse.nodered.org/u/Nettuno)
#### Post date: [27 December 2021 07:11 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/3 "2021-12-27T07:11:27Z")

</div>

I setup the WIFI SSID and password via an smartphone app called EspTouch\_Demo... Then, I have a flow that send buffer data to the board IP via TCP to switch on/off each relay. This is working fine but I do not have any acknowledge to verify the relay status...

It would be great to have a acknowledge data coming from the relay board so then I can continue the nodered flow to publish the result to a MQTT broker I have available on internet...

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [27 December 2021 09:22 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/4 "2021-12-27T09:22:25Z")

</div>

I think you are probably stuck with consulting whatever documentation the device comes with, unless you are prepared to reflash the ESP firmware with something you control.

In the feedback section of the web page is an example of arduino code that does provide status over http. You could experiment with that code and a substitute ESP.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [27 December 2021 09:35 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/5 "2021-12-27T09:35:07Z")

</div>

To get accurate feedback about each relay you would need to sense the signal that is driving the relay otherwise you don't really know whether the relay has energised or not. I think some people use two pins - one to send a signal to operate the relay and one to sense the state of the pin. I don't think you can change the mode of a pin from output to input on the fly with the ESP01S (which appears to be the chip used). Also this chip only has four I/O pins (one for each relay I suspect). Some of the pins do other things at boot-up which you need to be aware of. Sorry if this sounds negative. I could be proved wrong.

---

<div class="post-metadata">

### Author: ![Nettuno](https://avatars.discourse-cdn.com/v4/letter/n/49beb7/32.png) [@Nettuno](https://discourse.nodered.org/u/Nettuno)
#### Post date: [27 December 2021 10:47 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/6 "2021-12-27T10:47:43Z")

</div>

thanks jbudd. I'll investigate it

---

<div class="post-metadata">

### Author: ![Nettuno](https://avatars.discourse-cdn.com/v4/letter/n/49beb7/32.png) [@Nettuno](https://discourse.nodered.org/u/Nettuno)
#### Post date: [27 December 2021 10:48 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/7 "2021-12-27T10:48:53Z")

</div>

thanks for the info dynamicdave

---

<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: [25 February 2022 10:49 UTC](https://discourse.nodered.org/t/tcp-relay-acknowledge/55714/8 "2022-02-25T10:49:11Z")

</div>

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