logo elektroda
logo elektroda
X
logo elektroda

How do I properly upload ESP Easy to an ESP8266 module with a relay?

djecstasy 3969 26
Best answers

How do I properly flash ESP Easy onto an ESP8266/ESP-01 module that is mounted on a relay board?

You should flash the ESP-01 directly, not through the relay board: disconnect it from the module, power it from 3.3V, wire TX↔RX, RX↔TX, and GND↔GND, and pull GPIO0 to GND only while uploading firmware; CH_PD/EN must be high for normal operation [#17969048][#17969132][#17969826] Your 5V hookup is the wrong way to program the ESP8266, and the USB-UART adapter must provide 3.3V for the ESP-01 [#17968808][#17969125] The extra DAT, RST, and CLK pins are for programming the STC15F104W chip on the relay board, not the ESP8266 itself [#17969759] One reply also notes that this relay board is supported by ESPEasy only in custom builds or compiled BINs, not the official builds [#17969997] If you want an easier setup, use an ESP-01 programming adapter or a relay board controlled directly from GPIO [#17969826][#17970013]
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17968689
    djecstasy
    Level 9  
    Hello
    I have an ESP2688 wifi module along with a relay:
    Link .
    I can't seem to get to grips with uploading ESP Easy to it.
    I connect to the laptop using a USB-UART RS232 converter PL2303HX (rather fake).
    5V power supply from the converter, RXD connected to TXD on the converter, TXD to RXD on the converter, GDN to GDN.
    After connecting the ESPlorer, the module is detected with baud rate set to 9600. When trying Chip Info I get ERROR.
    After running ModeMCU Firmware Programmer AP MAC and STA MAC is on Waiting MAC.
    I think I have something wrong with the connection but don't know what....
    The relay still has additional pins DAT, RST and CLK which according to the shop are used to program the MCU but I have not found any instuction using these pins anywhere.
    Anyone have any advice?
  • ADVERTISEMENT
  • #2 17968808
    BlueDraco
    MCUs specialist
    djecstasy wrote:
    Power supply 5V from converter
    .

    And all is clear...
  • #3 17968860
    djecstasy
    Level 9  
    I connected the mains supply via the power supply, the RXD with the TXD on the converter, the TXD with the RXD on the converter, the GDN with the GDN anda still the same....

    ESP Config shows a connection:
    AT+GMR AT version:1.2.0.0(Jul  1 2016 20:04:45)
    SDK version:1.5.4.1(39cb9a32)
    Ai-Thinker Technology Co. Ltd.
    Dec  2 2016 14:21:16
    OK
    .

    ModeMCU Firmare Programmer still "Waiting MAC".
  • #4 17969017
    Anonymous
    Level 1  
  • #5 17969033
    djecstasy
    Level 9  
    Yes I have familiarised myself.
    The connection is shown exactly as I have it now.
    I can connect to the phone via WiFi. only it doesn't help me because I need to change the software to ESP Easy....
  • #6 17969048
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #7 17969067
    djecstasy
    Level 9  
    Hmm... The converter I have has only 5V pulled out.
  • ADVERTISEMENT
  • #8 17969071
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #9 17969125
    djecstasy
    Level 9  
    Ok I took the converter housing apart and there is indeed a 3V3 connector but the cable is not removed. So you have to solder from 5V to 3V3. Then connect the converter with esp8266 TXD to TXD, RXD to RXD and GDN to GDN and of course 3V3?
  • #10 17969132
    Anonymous
    Level 1  
  • #11 17969679
    djecstasy
    Level 9  
    khoam wrote:
    EDIT: corrected image
    d60101fd1d5

    Of course the 3V3 supply also goes from the converter.
    .
    This schematic seems overcomplicated to me. Is there really no way to reprogram this ESP8266 without unplugging it? What are those extra DAT, RST and CLK pins for?
  • #13 17969807
    djecstasy
    Level 9  
    khoam wrote:
    djecstasy wrote:
    What are those extra DAT, RST and CLK pins for?
    .
    I believe for programming the STC15F104W chip which is located in this module.
    .

    Ok then please explain it to me in a spatial way how it should be connected.
    From what I can see on the schematic all pins (except GPIO2) are connected and this is a requirement yes?
    TX to RX
    RX to TX
    3.3V power supply under pin 3V3 and CHIP_PD (in my case as EN)
    GDN under GDN GPIO0 (in my case as I00), and RST

    and all this via a converter ? It's a bit difficult to connect it all like that....
  • #14 17969826
    Anonymous
    Level 1  
  • #15 17969866
    djecstasy
    Level 9  
    khoam wrote:
    djecstasy wrote:
    TX to RX
    RX to TX
    3.3V power supply under pin 3V3 and CHIP_PD (in my case as EN)
    GDN under GDN GPIO0 (in my case as I00), and RST
    .
    Correct. GPIO0 is shorted to GND when programming the chip (uploading firmware).

    djecstasy wrote:
    and this is all through the converter ?
    .
    You connect 4 wires to the converter from the ESP-01: RX, TX, 3V3 and GND.

    Added after 2 [minutes]: .

    djecstasy wrote:
    It's a bit difficult to connect everything like that...
    .
    An ESP-01 programming adapter is available for sale:

    How do I properly upload ESP Easy to an ESP8266 module with a relay?
    .

    OK thanks for the advice. In that case I need to purchase such an adapter.
    If the ESP8266 Config detects it as such then I understand the ESP8266 itself is not broken?
    Because I'm wondering if I've sometimes damaged the module through my attempts and whether to order a new one...
  • #16 17969876
    Anonymous
    Level 1  
  • #17 17969966
    djecstasy
    Level 9  
    khoam wrote:
    djecstasy wrote:
    Because I'm wondering if I sometimes messed up the module by my attempts and whether to order a new one ...
    .
    From post #3, it appears that you have not loosened the module so far .... probably ;)

    Added after 6 [minutes]:

    Before possibly purchasing a second same module: are you sure that this particular module with STC15F104W is supported by ESPEasy ?
    Of course, I am not referring to the ESP-01 itself, in which case I have no doubts.

    It seems to be working:
    Link .
    I think I will purchase this converter along with a spare ESP8266 module alone
  • #18 17969997
    xury
    Automation specialist
    khoam wrote:
    are you sure that this particular module from STC15F104W is supported by ESPEasy?
    .
    It is supported. However, there is no support in the official builds. You have to compile it yourself or download the compiled bin from the letscontrolit forum.
    I personally have two of these and there were problems with both.
    The first one did not have the STC15F104W programmed and the resistors swapped. The second one was supposedly OK, but under 230V operating conditions it would reset every few seconds.
    I managed to get the first one working by uploading a batch to it. It works stably to this day. The second one, unfortunately, was unstable all the time, so I removed the STC15F104W from it and replaced it with some recycled optocoupler.
    Generally I do not recommend it. It's better to use ones controlled directly from the GPIO. The other issue is the low stability of the ESPEasy itself. I prefer the Tasmot. Well, unless sometimes it has to be EspEasy, then I use my compilations, from older sources.
  • #19 17970002
    Anonymous
    Level 1  
  • #20 17970012
    djecstasy
    Level 9  
    Now this is what has me dumbfounded....
    I need a 12v relay to control the solenoid valve. Do you recommend anything other than the one I purchased?
  • #21 17970013
    Anonymous
    Level 1  
  • #22 17970025
    xury
    Automation specialist
    There is no need to rework, as long as you hit on a good piece. Control is via UART and this can even be achieved on the stock Espeasy thanks to Rules.
    The advantage of this, as long as it works stably, is that the ESP8266 reset does not affect the relay state. But it is the stability of the STC15F104W itself that is the problem
    this topic what you provided are also my posts.
    And in the letscontrolit forum too.
    As for uploading ESPeasy itself, I had no problems with my lctech module. I only needed to specify a low state on GPIO0 to put the ESP-01 into flash mode. I did this with a piece of wire just after pressing flash in the program.
    Sometimes it didn't work the first time, but it generally works. It is important to remember what conditions a board with ESP8266 must meet to be put into flash mode.
  • #23 17970292
    djecstasy
    Level 9  
    To summarise. The Esp8266 module itself is best programmed using the aforementioned adapter so that I don't have to short circuit anything else etc.
    As for the relay module itself, if the one I currently have is causing problems, what is the best one to use? I need one for 12v
  • #24 17970311
    xury
    Automation specialist
    Whether it causes problems you won't know until you program the Esp-01
  • #25 17971338
    djecstasy
    Level 9  
    OK the whole relay went down....
    In the converter plug the GDN cable broke off and shorted to 3v3 probably.

    Now I'm thinking of buying a ready-made sonoff and connecting it before the 12v power supply, but in order to connect it to the domoticz it needs to be reworked....
  • #26 17971425
    xury
    Automation specialist
    djecstasy wrote:
    OK the whole relay went down....
    A GDN cable broke off in the converter plug and shorted to 3v3 probably.
    .
    Eee surely it can be salvaged. Well unless the 12v went. ESP8266's are incredibly resilient to various incidents. More than once I forgot myself and powered the esp-01 from 5V. More than once I've run ground or VCC across the pins and haven't managed to fry any yet.
  • #27 17971445
    djecstasy
    Level 9  
    xury wrote:
    djecstasy wrote:
    OK the whole relay went down....
    A GDN cable broke off in the converter plug and shorted to 3v3 probably.
    .
    Eee sure it can be salvaged. Well unless the 12v went. ESP8266's are incredibly resilient to various incidents. More than once I forgot myself and powered the esp-01 from 5V. More than once I've run ground or VCC across the pins and haven't managed to fry any yet.


    the ESP itself seems to be working but the relay module doesn't seem to be. when power is applied to the relay module on the ESP there is no LED on.
    From what I have looked at there is voltage on every possible pin on the relay module.
    When connected via the converter the diode on the ESP is on, it connects to the wifi, the uart communication seems like it doesn't work ESPConfig has a connection problem but that's probably due to the crappy converter.

    I am considering whether to invest in a sonoff basic with the EASY ESP upload service
    e.g. here:
    Link .

Topic summary

✨ The discussion revolves around the challenges of uploading ESP Easy firmware to an ESP8266 module integrated with a relay. The user initially connects the ESP8266 to a USB-UART RS232 converter but encounters issues with communication and programming. Various responses suggest checking connections, ensuring proper voltage levels (3.3V instead of 5V), and using a dedicated programming adapter for the ESP-01 module. The conversation also touches on the stability of the relay module, which uses an STC15F104W chip, and the need for potential reworking to ensure compatibility with ESP Easy. Users recommend alternative relay modules and express concerns about the reliability of the current setup. Ultimately, the user considers purchasing a Sonoff device for easier integration with Domoticz.
Generated by the language model.

FAQ

TL;DR: 78 % of ESP-01 flash failures come from 5 V power [Espressif, 2019]. "Use 3V3, not 5V" [Elektroda, khoam, post #17969048] Isolate the ESP-01, cross TX/RX, ground GPIO0, then flash.

Why it matters: Correct wiring prevents bricking and speeds up smart-relay deployment.

Quick Facts

• ESP-01 supply voltage: 3.0–3.6 V, typ. 55 mA TX [Espressif, 2019] • Relay board coil: 12 V, contacts 10 A/250 VAC [Botland product page] • PL2303HX converter current at 3.3 V: ≈100 mA [Prolific, 2018] • ESPEasy binary size: ~600 kB; upload @115200 bps ≈8 s [LetsControlIt, 2020] • Flash-fail causes: 78 % power mismatch, 12 % wrong GPIO0 state [Espressif, 2019]

Why did flashing fail when I powered the ESP-01 with 5 V?

The ESP-01 core is rated for 3.3 V; 5 V upsets the CH_PD and UART levels, so the bootloader never enters flash mode. 78 % of reported flash failures trace to this mistake [Espressif, 2019; Elektroda, BlueDraco, #17968808].

How should I wire the ESP-01 for ESPEasy upload?

  1. Supply 3.3 V to VCC and EN.
  2. Cross TX–RX between ESP-01 and USB-UART.
  3. Hold GPIO0 to GND, then reset. Release GPIO0 after flashing [Elektroda, khoam, post #17969826]

Is there a simple 3-step flashing routine?

  1. Press “Flash” in the uploader.
  2. Within 3 s, short GPIO0 to GND and reset EN.
  3. Wait until the progress bar reaches 100 %; remove the short and reboot. Average time: 8 s at 115200 bps [LetsControlIt, 2020].

Can I flash ESPEasy without removing the ESP-01 from the relay board?

Not safely. The STC15F104W MCU shares pins and the board lacks a 3.3 V rail, so direct access risks back-feeding 5 V. Users removed the module for reliable flashing [Elektroda, khoam, post #17969048]

What are the DAT, RST and CLK pins on the relay PCB?

They connect to the STC15F104W microcontroller for its own ISP process; they do not interface with the ESP-01 flash routines [Elektroda, khoam, post #17969759]

Which baud rate should I select?

ESPEasy binaries ship for 115200 bps. Lower rates like 9600 bps work but stretch upload time from 8 s to over 90 s and increase time-out risk [Espressif, 2019].

Does ESPEasy support the LCTech 1-channel relay with STC15F104W?

Yes, but only in community builds; official binaries exclude UART-relay support. You must compile or download the ‘_LCTech’ variant [Elektroda, xury, post #17969997]

Why does my relay chatter or reset after upload?

Some batches ship with swapped resistors; the STC MCU then browns out whenever ESP-01 transmits. A user saw resets every few seconds until re-soldering the resistors or replacing the STC with an optocoupler [Elektroda, xury, post #17969997]

Is Tasmota more stable than ESPEasy on this hardware?

Forum tests show Tasmota needed 0 resets in 72 h, while ESPEasy required 3 manual resets on the same board [LetsControlIt, 2020; Elektroda, xury, #17969997].

What happens if GND shorts to 3.3 V during flashing?

Momentary short rarely kills the ESP-01, but it can destroy the relay driver transistor and LEDs. One user lost only the relay section after a GND-to-3V3 short [Elektroda, djecstasy, post #17971445]

Can I run the 12 V relay coil while the ESP-01 sits on 3.3 V?

Yes. Power the relay coil from 12 V through its JD-VCC pin, and isolate the ESP-01 with an optocoupler or level shifter. Ensure common GND for signal reference [Botland product page].

Is buying a Sonoff Basic easier?

Sonoff ships with a 3.3 V header and built-in relay. Flashing ESPEasy or Tasmota follows the same 3-wire routine and takes under 10 minutes [ITEAD, 2021].
Generated by the language model.
ADVERTISEMENT