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.
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.
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 . 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 .) Thank you again for helping and caring.
I wish you success. It’s unfortunately quite “hit or miss” with some of these boards.
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 . But I think you were on the right track with the on_boot. I will continue my search tomorrow…
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).