4 channel Relay ESP8266 Wifi board WORKING with esphome

Yes, I started out with the shorter ones. The problem is to get the connection happening. From Tasmotas API-pages, LC Technology WiFi Relay - Tasmota
This sends a certain stream of serial messages (in hex) below after receiving AT+RST (41542B5253540D0A in hex) from the NUVOTON devices. This message seems to make the NUVOTON enter listening mode.
The long stream of hex messages for sending is equivalent to the ff. key in ASCII:

WIFI CONNECTED WIFI GOT IP AT+CIPMUX=1 AT+CIPSERVER=1,8080 AT+CIPSTO=360

I experimented with code from: UART Switch — ESPHome, but there they use another GPIO-pin, so I don’t think thats the correct path to go.

If it’s strictly for initialization, and not for firing the relays from time to time, then it could be placed in a separate YAML block as an initialization routine, using the on_boot: functionality.

Yes, that might be a path to go forward. Thank you again. I will look into that. If I solve this I will post how :grinning:.

1 Like

Last question, and I only just considered it. Have you tried both 9600 baud and 115200 baud? Again, however the small microprocessor is coded makes all the difference. And of course, we have no easy way to determine how it is coded. :frowning:

I did not try 9600, but I have succeded with everything functioning with Tasmota (and then 115200). 115200 (this seems to be the default for the Nuvoton LCTech Relay), according to Tasmota API.

I am very much relying on what other kind people already have found out :yum:. I read and I copy how they did it. Like you and others on this community, and all the people behind Tasmota and Blakadder.

(So, knowing stuff about microprocessors are way above my league :grinning: .) Thank you again for helping and caring.

I wish you success. It’s unfortunately quite “hit or miss” with some of these boards. :frowning:
Is it possible, your board may be in the wrong “mode” as defined by LC Technology? I do not recall the exact LED colors or indicators, but I do know, the relays will work properly in one mode and definitely not in the other. My board recently suffered many power interrupts due to weather conditions. When it finally came back online, the board was in the wrong mode. It would talk to ESPHome and Home Assistant, and switches in HA would appear to work. But the board would never fire the relays. I had to remove power, hold the correct pushbutton(s), and then apply power to set the correct mode.

Yes, mode can be an issue (have been there before), but here the led is red - it doesn’t show on the photo I see. Again from Tasmota pages:

After these messages are sent back by Nuvoton to the ESP, the green LED beside the red LED will start blinking once a second. From here you can verify that the relay indeed starts to receive commands from the ESP.

And the above is what does not happen for me with esphome :slightly_frowning_face:. But I think you were on the right track with the on_boot. I will continue my search tomorrow… :hugs:

My version of 4ch relay is a little bit more complex.

On starting up, the microcontroller on relay board send AT command to ESP-01 to reset and wait for response signal. It wait for
“ready\r\n”
“WIFI CONNECTED\r\n”
“WIFI GOT IP\r\n”
before begin to work (green LED lid).

So I add some part up as follow (ignore the reset command sent from microcontroller and just wait for 20s to begin send the ready signal).

esphome:
name: “frontgate-relay-esp01-001”
friendly_name: Frontgate relay
#send WIFI ready signal to relay board UART
on_boot:
priority: 600
then:
- delay: 20s
- uart.write: “ready\r\nWIFI CONNECTED\r\nWIFI GOT IP\r\n”

1 Like

I created an enclosure for this at Printables.

Please load your makes!

Hey hope so all are doing great. When I connected successfully with my wifi and power off the device and again power on the device it is not connected automatically. I need to reconnect it manually by ESPTouch app. It shoud reconnect automatically. I am using this product https://robu.in/product/esp8266-esp-01-5v-4-channels-wifi-relay-module-for-home-remote-control-switch

Hi there,
i know im am a bit late, but GPIO2 is also not used.
I am working on a system with flow sensor @ GPIO2 and a button for start / stop @GPIO0.