So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Momon
#72470 I am facing the same problem. I tried to send AT command using serial but nothing happen and the esp did not respond and send any message. So what I do to make it work is.

1)Flash the esp01
2)Solder a jumper
3)Some configuration on esp


1.Flashing the esp

I am not writing any code. I use firmware from espeasy. The version is R120 which is stable version. Direct flash using espeasy flashing software.
Connection for Uuart to USB (Im using CH340G)
ESP>CH340G
RX>TX
TX>RX
GND>GND

ESP>External Supply
GPIO 0 > 3.3V
GPIO 2 > 3.3V
CH_PD > 3.3V
RST > no connection
VCC > 3.3V

every pin that goes to 3.3v, u can put pull up 10k resistor ( up to u want to put or not.. in my case it works without pull up resistor)

2. Solder a jumper.

This part I choose to use GPIO 2 as switch. In this part we must aware that GPIO 0 and GPIO 2 must be high during boot to run the program from flash. So what I do is I solder a jumper from GPIO 2 to a switch and I solder another pin of the switch to the gate of the transistor.

3. Some configuration on espeasy

I enable Rules.
How to enable Rules. Go to Tools section > Advance > Tick Rules box > Submit

On Rules section. Please paste this rule.

On System#Boot do //When the ESP boots, do
gpio,2,0 //Set GPIO 2 to low
endon


Then Submit.


So now how its work??? I put the esp back to the relay module. The new switch state is "Off". I turned on the module by giving 5V input at IN+ and ground at IN- . After the boot is success I turn the switch to "On" state. Next I can control the esp using HTTP command.

http://YOURESPIPADDRESS/control?cmd=GPIO,2,1 for On
http://YOURESPIPADDRESS/control?cmd=GPIO,2,0 for Off

I fixed my esp ip address by setting in my router so that I can make a button on my phone with the command. You can do the same :) . If you re not doing so then the ip might change every time it reboot.

Please take note that on ESP configuration I skip the wifi setting part and so on. The esp and the device we use to send the command must be in same wireless network. Have fun~
User avatar
By hkusp
#72567 I've been lurking on this subject for a while and I can't stand it any more, I have to comment.

First, forget this relay and get a relay board that the ESP-01 activates. The LC Tech board activates the relay through a microcontroller that reacting to serial commands. This board has no means of reporting the relay state back to you and cannot be directly controlled by mqtt.

My recommendation is to get a Sonoff basic, load your own software and be up and running in 10 minutes.

If you must have a relay board get one of these:
https://www.aliexpress.com/item/ESP8266 ... 97306.html

This relay board must be modified to work. GPIO0 must be connected to a 10K pullup resistor. Once the pullup is installed, the same software for the Sonoff can be loaded. (See below)

But, if you bought a bunch of the LC Tech relay modules and would like to get them working, as opposed to trashing them, you can do the following:

1. If you LC Tech board version doesn't pull the RST and CH_PD up to VCC, you'll have to solder jumpers to pull them up to VCC.

2. Find the 8 pin STC15F104S0P8 microcontroller. Note where pin 1 is next to the little dot. Pin 8 will be across from pin 1. Pin 7 will be the pin below pin 8. Note the location of pin 7. Next remove the microcontroller with the help of a soldering iron. This is the major item standing between you and direct control of the relay using the ESP-01.

3. Find R4, the 4.7K resistor, and rip it out with a few touches of a soldering iron. This resistor was across the base and emitter of the Q1 transistor. It really wasn't doing anything for us, except taking base current away from the transistor.

4. Add a 10K pull resistor from VCC to GPIO0.

5. Now run the finest wire you can find from GPIO0 to pin 7 of the microcontroller. If you messed the pad up when you desoldered the microcontroller, you can attach to the pad of R3 the furthest away from the edge.


Once the hardware mods are made load the software provided by KmanOz.
https://github.com/KmanOz/KmanSonoff/tr ... ff_v1.00sc

NOTE: The serial Tx/Rx connectors will work and can provide debug messages from the ESP-01.

There is no indicator LED, external button or temperature/humidity probe, but it works fine to control the relay. In addition, the relay is controlled via MQTT, the relay state is retrievable, the module can be remotely reset and software can be reloaded using OTA. Lastly, the relay state can be remembered and retained on startup or reset. This is handy to assure the relay will be in the same state after a power failure or reset.

I've been able to modify this software to work on Sonoff devices, most generic ESP-01 relay modules and generic DHT11/22 modules. It may seem to be overkill for some applications, but having a single software base for a majority remote and home automation applications has great value to me.
User avatar
By wronsko
#72589
jbrowne wrote:I finally said forget using it as-is with trying serial interface to relay.
I modified the board slightly, by cutting a single trace to one of the relay legs, and I'm using the ESP to activate the relay via GPIO. I'll take pictures, and give sample code when I'm in the office again (maybe tomorrow)


Could you show some pictures?