hi, i have a 2ch relay based on esp-01
https://web.archive.org/web/20180602202511/http://www.chinalctech.com/index.php?_m=mod_product&_a=view&p_id=1261
i programmed the ESP-01 with tasmota and configure the module, insert the rules and set the rules on.
but when i try to toggle the relay....none is working :(
i see the wiki:
https://github.com/arendst/Sonoff-Tasmota/wiki/LC-Technology-WiFi-Relay
and also follow this:
https://www.esp8266.com/viewtopic.php?f=160&t=13164&start=68#p74262
but my chip is not STC15F104W but Nuvoton N76: n76e003at20
so how i can program it and make it working with tasmota?
thanks
Please, could you be so kind on completing the troubleshooting template in order to have more information so as to properly help you?
Remember to read the Contributing Guideline and Policy. Thanks.
See Wiki for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct
Baudrate set?
Please, could you be so kind on completing the troubleshooting template in order to have more information so as to properly help you?
Remember to read the Contributing Guideline and Policy. Thanks.
Support Information (Guide)
See Wiki for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct
on relay lc technology 2ch with on board ESP01 and chip model Nuvoton N76: n76e003at20 (not STC15F104W as decrived in wiki, ref: https://github.com/arendst/Sonoff-Tasmota/wiki/LC-Technology-WiFi-Relay)
is not possible to use tasmota working
how to make it compatible
FAILURE TO COMPLETE THE REQUESTED INFORMATION WILL RESULT IN YOUR ISSUE BEING CLOSED
status 0 :i have some updates coming from trings many time
i have a partial solution:-)
i discover that if follow the guide that i linked on tasmota wiki but i do not flash my chip Nuvoton and i do not remove the resistor, but simply hold and press the S1 button on boot, the firmware become working as descrived in the wiki.
note, if you boot/power up normally, you will see a led blue lighting -> in this case the FW will NOT work
if you hold and press S1 button and then power up the board you should see: red led light on, in a while green led blinking, blue led switch off -> in this case the FW will work and the relay will toggle.
now the problem is enabling "wall switches" for relay1 and relay2
if i go to configuration-> configuration module and i set:
TX = button1
RX = button2
with this config of buttons the relays will not toggle :-(
if i set:
TX = NONE
Rx = button2
in this case both relay are toggling correctly and if use wall switch connected at RX the relay2 will toggle. but, to do that i need to have jumper1 connectin RX1-TX1 (defaulf position) but i have to remove jumper2
now, how i can use/enable button1 for toggle relay1?
if i enable button1 on TX i will lose the toggle of both relay that became not working
thanks
You cant use RX / TX for buttons since this GPIOs are used for communication to the UART!!
@megamarco833
Hi,
Any news on this?
@megamarco833
Hi,
Any news on this?
as i wrote, what i discover is that:
1)i follow the guide that i linked on tasmota wiki but i do not flash my chip Nuvoton and i do not remove the resistor, but simply hold and press the S1 button on boot, the firmware become working as descrived in the wiki.
note, if you boot/power up normally, you will see a led blue lighting -> in this case the FW will NOT work
if you hold and press S1 button and then power up the board you should see: red led light on, in a while green led blinking, blue led switch off -> in this case the FW will work and the relay will toggle.
i do not know if it could be a solution, but for me is working :-)
....what now i would like to use is the possibility to use this board with 2relays with two external push button as switch.
is it possible???
I would like to use this board for blind control + exterla wall switch, is it possible?
thanks
You have to mod the device to add two momentary switches for your wanted use case.
The used Esp module has two free GPIOs. GPIO 0 and GPIO 2 Both GPIOS needs to be pulled up to high for normal function of the device. With a momentary switch you can pull to GND.
You have to mod the device to add two momentary switches for your wanted use case.
The used Esp module has two free GPIOs. GPIO 0 and GPIO 2 Both GPIOS needs to be pulled up to high for normal function of the device. With a momentary switch you can pull to GND.
that's correct, but on the board there are two pins:TX and RX that should not be correspond to GPIO0 and GPIO2. GPIO0 and 2 are the relays
so i can use the other two avaliable? (i guess GPIO1 and 3 that are rx and tx)
if i set inside the configuration modul "generic" button1 and button2
i lost the function of toggle relay (web interface show the toggle, but phisically the relay don't toggle)
if i set:
TX = NONE
Rx = button2
in this case both relay are toggling correctly and if use wall switch connected at RX the relay2 will toggle. but, to do that i need to have jumper1 connectin RX1-TX1 (defaulf position) but i have to remove jumper2
now, how i can use/enable button1 for toggle relay1?
if i enable button1 on TX i will lose the toggle of both relay that became not working
thanks
on the board there are two pins:TX and RX that should not be correspond to GPIO0 and GPIO2. GPIO0 and 2 are the relays
WRONG TX and RX is connected to GPIO 1 and 3 from ESP.
The relais arent connected to the ESP. The are connected to the MCU (Nuvoton N76) and are controlled from.
on the board there are two pins:TX and RX that should not be correspond to GPIO0 and GPIO2. GPIO0 and 2 are the relays
WRONG TX and RX is connected to GPIO 1 and 3 from ESP.
The relais arent connected to the ESP. The are connected to the MCU (Nuvoton N76) and are controlled from.
thanks Jason!
ok...so why if i go inside configuration-> configuration module and i set:
TX = button1
RX = button2
with this config the relays will not phisically toggle anymore :-(
thanks
Because you bring device in boot mode with your wrong configuration and the devices reacts somehow...
The ESP-01 has only 4 usable GPIOS (0,1,2,3)
RX/TX (GPIO 1 and 3) are used to control MCU to switch the relais via serial command codes:
Open the first relay: A0 01 01 A2
Close the first Relay: A0 01 00 A1
Open the second relay: A0 02 01 A3
Close the second Relay:A0 02 00 A2
So you have only GPIO 0 and 2 left to use for momentary switches
See wiki https://github.com/arendst/Sonoff-Tasmota/wiki/LC-Technology-WiFi-Relay too
GPIO 0 and 2 are set as VIRTUAL relays to get relais defined in Tasmota. This relais has nothing to do with the real ones! You could use non existent GPIOs for this needed setting too
Because you bring device in boot mode with your wrong configuration and the devices reacts somehow...
ehmm...i use the device in boot mode because if i boot it normally the relay will not phisically toggle.
if i boot holding S1 (boot mode) the relays will phisically toggle!
i do not have STC15F104W chip, but Nuvoton chip...so what is written in the wiki to flash it is not working....
do you have other solutions?
The ESP-01 has only 4 usable GPIOS (0,1,2,3)
So you have only GPIO 0 and 2 left to use for momentary switches
See wiki https://github.com/arendst/Sonoff-Tasmota/wiki/LC-Technology-WiFi-Relay too
GPIO 0 and 2 are set as VIRTUAL relays to get relais defined in Tasmota. This relais has nothing to do with the real ones! You could use non existent GPIOs for this needed setting too
so, if i understand well, i can set virtual relay in tasmota:
GPIO1 and GPIO3 as Relay1 and Relay 2 (not like in the wiki)
and use GPIO0 and GPIO2 for momentary switch like button1 and button2
or, because RX/TX (GPIO 1 and 3) are used to control MCU, i can't use 1 and 3 for relay and i must set only 0 and 2 for relays ?
thanks so much for your help
Set GPIO 4 as virtual relais1 and GPIO 5 as virtual relais2. Rules like in wiki
So you have GPIO 0 and 2 free for connecting momentary switches
@megamarco833
Hi,
Any news on this?
Closing issue as there is no feedback. Please, when you have time, tell us if the proposed solution works for you. Thanks
Closing issue as there is no feedback. Please, when you have time, tell us if the proposed solution works for you. Thanks
Hi, I recently got the same model as you from Aliexpress. mine is working perfectly fine.I want to give you and other a detailed guide for LC Tech 2 Channel relay.
The 2 channel relay board is programmed to work with 2 modes.
Mode 1: (BLUE LED D5 is ON)
The factory firmware supposed to command ESP8266 Chip to connect to your Wifi network.
after 20 sec green led will start to blink (0.5 Sec).at this time you can connect to your ESP8266 chip which is flushed already by Tasmota.But board will not accept serial commands sent by ESP8266, Hence you will not be able to control relay.
Mode 2: (RED LED D7 is On)
in this mode the board is supposed to send command to ESP8266 to create a mobile hotspot. Also if no ESP8266 is present then this mode will allow you to control the board using Serial ports directly.That is the reason why Tasmota works in this mode only.
note:
if you are stuck in "mode 1 ", then hold the S1 button while powering on the board. Red LED will glow for 1 or 2 sec, during that time remove the finger from S1 button. (or else it will go back to mode 1).
GREEN LED has 3 meanings.
OFF - board is configuring with ESP8266
BLINK (0.5 sec) - Connecting to wifi for rest configuration
BLINK (2 sec) - Configured and stable
The key(S1 and S2) are available only when the LED(D6) slow blink every 2S or on all the time.
GPIO1 & GPIO3 used for serial communication with board so create 2 virtual relay with GPIO0 & GPIO2.(Tasmota>configuration>configure template>generic(18),GPIO0 as relay1,GPIO2 as relay2)
once done, create a rule to send serial commands to board to use the relays.
Open the first relay: A0 01 01 A2
Close the first Relay: A0 01 00 A1
Open the second relay: A0 02 01 A3
Close the second Relay:A0 02 00 A2
So the rule is as follows:
on System#Boot do Backlog Baudrate 115200; SerialSend5 0 endon
on Power1#State=1 do SerialSend5 A00101A2 endon
on Power1#State=0 do SerialSend5 A00100A1 endon
on Power2#State=1 do SerialSend5 A00201A3 endon
on Power2#State=0 do SerialSend5 A00200A2 endon
after a restart the device will work .
The relay present in board are cut-off (2 way ) relay so I use cut-off (2 way) wall switches. In a similar way as the conventional "stair case dual switch " scenario.
after a restart the device will work .
The relay present in board are cut-off (2 way ) relay so I use cut-off (2 way) wall switches. In a similar way as the conventional "stair case dual switch " scenario.
hi, thanks for supporting, i have again some trouble with module lc technology with two channels, i need to know:
1) inside configuration what GPIO you address to relay1 and relay2?
2)what jumper configuration do you have on module? jumper of TX1-RX1 is connected? jumper of TX-RX is also connected?
I see that inside your rule1 you use Backlog Baudrate 115200, inside wiki is written 9600, there is any reason why you changed?
3) are you able to use momentary switches? if yes, do you connect to pin RX and TX?
what you set inside module configuration as gpio for button1 and button2?
thanks so much
Marco
after a restart the device will work .
The relay present in board are cut-off (2 way ) relay so I use cut-off (2 way) wall switches. In a similar way as the conventional "stair case dual switch " scenario.
hi, thanks for supporting, i have again some trouble with module lc technology with two channels, i need to know:
- inside configuration what GPIO you address to relay1 and relay2?
2)what jumper configuration do you have on module? jumper of TX1-RX1 is connected? jumper of TX-RX is also connected?
I see that inside your rule1 you use Backlog Baudrate 115200, inside wiki is written 9600, there is any reason why you changed?- are you able to use momentary switches? if yes, do you connect to pin RX and TX?
what you set inside module configuration as gpio for button1 and button2?
thanks so much
Marco
As you have mentioned before , you can use the RX pin for button as your ESP8266 not receiving any data from board. But you never can use TX pin. TX pin transmits data to the board. So switching it will cause you loosing control to the board.
If you really need buttons then just use two way button. These relay are cut off relays.
4.one more thing i want to mention that, as we send serial commands to board while turning on & off by virtual relay.if the board gets power failure,on restart it will not remember the states of 2 relays.they will stay off.
So I compiled a binary by removing extra sensors and adding one "if else" function.
Tasmota IF ELSE Support page
also created a second rule which will save relay's states in mem1 & mem2 .And in every boot it will send serial command to board as per the last state saved.
Rule2
on Power1#State=0 do mem1 0 endon
on Power2#State=0 do mem2 0 endon
on Power1#State=1 do mem1 1 endon
on Power2#State=1 do mem2 1 endon
on system#boot do if (mem1==1) SerialSend5 A00101A2 endif endon
on system#boot do if (mem2==1) SerialSend5 A00201A3 endif endon
Which command?
Please, address this to the Tasmota Support Chat. The chat is a better and more dynamic channel for helping you. Github issues are meant for Tasmota Software Bug Reporting.
Please check the Contributing Guideline and Policy and the Support Guide.
Thanks.
See Wiki for more information.
See FAQ for common questions/answers and links if none of your question is in the list
See Chat for more user experience.
See Community for forum.
See Code of Conduct
Configurazione EXTRA:
{"NAME":"LC-ESP01-2R-5V","GPIO":[21,148,22,149,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
LED D7= Rosso
LED D6= Verde lampeggio (0,5 sec)
Nota:
se sei bloccato in "modalità 1", tieni premuto il tasto S1 mentre accendi la scheda. Il LED rosso si illuminerà per 1 o 2 secondi, durante quel tempo rimuovere il dito dal pulsante S1. (altrimenti tornerà alla modalità 1).
Il LED VERDE ha 3 significati.
OFF - la scheda si sta configurando con ESP8266
BLINK (0,5 sec) - Connessione al wifi per la configurazione di riposo
BLINK (2 sec) - Configurato e stabile
I tasti (S1 e S2) sono disponibili solo quando il LED (D6) lampeggia lentamente ogni 2 secondi o sempre acceso.
Hi, I know this is an old thread but I felt the need to share my individual findings here.
I also have the same LC-tech Relay2 module with the NUVOTON ic on it. Exact product here.
After a couple of trial and errors, my observations are consistent with @soumaxetuirk . I managed to find a workaround on how to make the NUVOTON ic recognize the serial messages after it enters Mode 1. So this solution I'm gonna tell you should work even though the device is not in Mode 2, hence saving you of having to press S1 button while booting.
So here's what you're gonna do.
Use the device template here. I will paste the code here so you don't have to go to the link:
{"NAME":"LC-ESP01-2R-5V","GPIO":[0,148,0,149,0,0,0,0,21,22,0,0,0],"FLAG":0,"BASE":18}
One way to configure your board with this configuration is to go to Configuration - Configure Other in the Tasmota web portal. Paste the configuration above to the Template field then click Save. This will reset the device. What this does is it configures the pins of the device for use in the target hardware (the LC-Tech Relay 2).
After the reset, you will get this screen on your web portal:

We will add the following rules on our Tasmota:
on System#Boot do Backlog Baudrate 115200
on SerialReceived#Data=41542B5253540D0A do SerialSend5 5749464920434f4e4e45435445440a5749464920474f542049500a41542b4349504d55583d310a41542b4349505345525645523d312c383038300a41542b43495053544f3d333630 endon
on Power1#State=1 do SerialSend5 A00101A2 endon
on Power1#State=0 do SerialSend5 A00100A1 endon
on Power2#State=1 do SerialSend5 A00201A3 endon
on Power2#State=0 do SerialSend5 A00200A2 endon
Here's what the above code does line per line:
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. in ASCII:WIFI CONNECTEDWIFI GOT IPAT+CIPMUX=1AT+CIPSERVER=1,8080AT+CIPSTO=360Do not forget to enable the rule.
AT+CIPMUX=1AT+CIPSERVER=1,8080AT+CIPSTO=360That's it. I have tested this on four LCTech boards and they work flawlessly. So I think they should work on other Nuvoton boards too. Let me know if this worked out for you guys. I am willing to help.
@nacansino thanks for sharing this!
before your post i never succeed on having this device working
now i tested with your solution and now it works!!!
fantastic, thanks so much
ps. is it possible to use push button1 and button2 to control relay1 and relay2?
thanks again
@megamarco833 That's fantastic news! With that, I think this solution is
applicable to any LCTech Nuvoton devices from the same manufacturer.
Regarding the buttons 1 and 2, I will verify if those buttons are
physically connected to GPIOs of the ESP (I think they aren't).
If it is not, then we have to verify if pressing those buttons will trigger
Nuvoton to send serial messages to ESP, and using those signals we can
create a separate rule that triggers the relays. This, or we have to
manually rewire the board to connect the buttons to the GPIO of the ESP and
make a rule for the relay.
On Sun, Apr 19, 2020, 01:39 megamarco833, notifications@github.com wrote:
@nacansino https://github.com/nacansino thanks for sharing this!
before your post i never succeed on having this device working
now i tested with your solution and now it works!!!
fantastic, thanks so muchps. is it possible to use push button1 and button2 to control relay1 and
relay2?
thanks again—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Tasmota/issues/5526#issuecomment-615900604,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKLOU3MDCQTPLVAV73DQECTRNHJS3ANCNFSM4HBGM4FA
.
@nacansino
Could you add this information to the Tasmota docs? All users are able to contribute. This would be a great addition to the device's article.
@meingraham
That's a good idea. Where exactly do you think I can add this?
I just started using Tasmota yesterday so I haven't threaded yet on the whole docs.
@meingraham Submitted a Pull request! Thanks!
thanks again for support!!!
@nacansino and @meingraham
there is also:
https://templates.blakadder.com/LC-Relay-ESP01-2R-5V.html
that is dedicated to this models with 2ch relay.
what's the better place to add ?
thanks
@megamarco833 That's fantastic news! With that, I think this solution is applicable to any LCTech >Nuvoton devices from the same manufacturer.
Regarding the buttons 1 and 2, I will verify if those buttons are physically connected to GPIOs of the ESP (I think they aren't). If it is not, then we have to verify if pressing those buttons will trigger Nuvoton to send serial messages to ESP, and using those signals we can create a separate rule that triggers the relays. This, or we have to manually rewire the board to connect the buttons to the GPIO of the ESP and make a rule for the relay.
hi @nacansino
did you find a way to use two switches to control relay1 and relay2?
thanks again for support on this!
@megamarco833
Unfortunately, no. I tried to press those switches and they seem to move the IC to a different state. :/ What are you trying to accomplish anyway?
I personally would pivot to using another board as a smart switch. I find this board inefficient as it requires a separate DC supply on top of the AC line it's connected to.
@nacansino i thought that can be used tx and rx pin exposed to control relays :-)
i would like to use this board to control roller shutter because it quite small and it's perfect having two relays: 1=up 2=down
what is missing are the wall switches to control both relays :)
thanks
@nacansino i thought that can be used tx and rx pin exposed to control relays :-)
i would like to use this board to control roller shutter because it quite small and it's perfect having two relays: 1=up 2=down
what is missing are the wall switches to control both relays :)
thanks
As I mentioned before also, you can use a staircase (2 way) light switch with the relay.
Most helpful comment
Hi, I recently got the same model as you from Aliexpress. mine is working perfectly fine.I want to give you and other a detailed guide for LC Tech 2 Channel relay.
The 2 channel relay board is programmed to work with 2 modes.
Mode 1: (BLUE LED D5 is ON)
The factory firmware supposed to command ESP8266 Chip to connect to your Wifi network.
after 20 sec green led will start to blink (0.5 Sec).at this time you can connect to your ESP8266 chip which is flushed already by Tasmota.But board will not accept serial commands sent by ESP8266, Hence you will not be able to control relay.
Mode 2: (RED LED D7 is On)
in this mode the board is supposed to send command to ESP8266 to create a mobile hotspot. Also if no ESP8266 is present then this mode will allow you to control the board using Serial ports directly.That is the reason why Tasmota works in this mode only.
note:
if you are stuck in "mode 1 ", then hold the S1 button while powering on the board. Red LED will glow for 1 or 2 sec, during that time remove the finger from S1 button. (or else it will go back to mode 1).
GREEN LED has 3 meanings.
OFF - board is configuring with ESP8266
BLINK (0.5 sec) - Connecting to wifi for rest configuration
BLINK (2 sec) - Configured and stable
The key(S1 and S2) are available only when the LED(D6) slow blink every 2S or on all the time.
GPIO1 & GPIO3 used for serial communication with board so create 2 virtual relay with GPIO0 & GPIO2.(Tasmota>configuration>configure template>generic(18),GPIO0 as relay1,GPIO2 as relay2)
once done, create a rule to send serial commands to board to use the relays.
Open the first relay: A0 01 01 A2
Close the first Relay: A0 01 00 A1
Open the second relay: A0 02 01 A3
Close the second Relay:A0 02 00 A2
So the rule is as follows:
after a restart the device will work .
The relay present in board are cut-off (2 way ) relay so I use cut-off (2 way) wall switches. In a similar way as the conventional "stair case dual switch " scenario.