arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.94k stars 4.76k forks source link

Trying to flash tasmota on TYWE3S #5377

Closed jim20j closed 5 years ago

jim20j commented 5 years ago

I have a 3 gang touch switch with a TYWE3S. I am unable to flash tasmota on it. I'm pretty sure it's in boot mode when I ground GPIO0 and all 3 lights are red when I power it up. I have flashed 6 sonoffs using the same process. I tried reversing the Tx and Rx as well. I get an error "espcomm sync failed, espcomm open failed, espcomm upload mem failed"

BreBar07 commented 5 years ago

I have set all GPIOs to relay's and toggling them in the Tasmota UI does nothing :(

I will try reflash another spare device tomorrow and see if I get the same result. Hopefully the MCU doesnt control the relay / led / button.

meingraham commented 5 years ago

@BreBar07 What is the manufacturer and model number of your device?

It may be using the Tuya protocols to control the functions via the MCU. Ping @shantur. I think it's time to take this discussion over to the Tasmota Support Discord Chat.

BreBar07 commented 5 years ago

On the case sticker model = MG-MD04W, that's for single gang my double gangs are all installed.

It seems to be the same family at the power socket (https://blakadder.github.io/templates/makegood_MG-AUWF01.html)

Thanks alot @meingraham I'll jump into the tasmota support channel.

authguardian commented 4 years ago

@meingraham Well I was excited so I got onto this faster than expected. Removing the 8266 I believe is almost impossible without destroying the board's so i decided to do some playing with grounding pins on the other MCU chip and success (I will add a more detailed description later, once next problem is solved).

Now I have Tasmota installed and I assumed that the configuration "Sonoff T1 1CH Module" and '2CH' would work but it seems not. Does anyone have any advise how to configure or is it just a trial and error exercise?

Basic Reflash gpio0 -> gnd tx -> rx rx -> tx vcc -> 3.3v gnd -> gnd rst -> gnd

mcu pin? -> gnd (upload picture later)

After a few seconds release rst from ground and device will flash!

@BreBar07 Any chance of you sharing the MCU grounding pics? I have Moes Dimmer and I am unable to get TYWE3S into boot mode. Thanks in advance

BreBar07 commented 4 years ago

@anantbhula you need to ground as pic below. Sorry I'm at work right now and don't have my notes on exact pin but grounding and trying will work as long as your board is similar / same. 6E6248EB-0C18-4DED-A4D2-E646B348346F

BreBar07 commented 4 years ago

I just manually held a ground pin to the MCU it was actually wedged in between 2 pins but flashing was no problem.

authguardian commented 4 years ago

@BreBar07 Thank you for your reply. Will give it a try and update here

authguardian commented 4 years ago

@BreBar07 Appreciate you for all your help. Since I have different board [MOES DS01C] that didnot work for me however I ended up desoldering TYWE3S for flashing and re-solder now off to the functionality of the dimmer.

shantur commented 4 years ago

@anantbhula : Some pages that might help you

https://github.com/arendst/Sonoff-Tasmota/wiki/MCU-Based-Tuya-Dimmers-and-Switches

https://github.com/arendst/Sonoff-Tasmota/wiki/TuyaMCU

authguardian commented 4 years ago

@shantur Thank you for the links. I think I was not smart enough to figure out MCU chip so figure it will be easier for me to desolder and solder back once done flashing, which I was able to flash. Now getting trying to get the dimmer functionality with Tasmota.

twonky26 commented 4 years ago

The method that worked for me was cutting RX and TX pins on BF7612AM28T chip which is located on the the other side of the board (of Moes DS01C dimmer ). So I guess it will work for any device with TYWE3S which has trouble flashing.

First, trace RX and TX pins from TYWE3S to BF7612AM28T (or similar) chip. Second, carefully cut them with sharp blade. Third, bend them up a little bit, so there is no contact. After that it should flash just fine. But don't forget to bend them down and resolder after flashing.

1 11 2 22 3 33

arvidj01 commented 4 years ago

Reading this ... MCU Based Tuya Dimmers and Switches - Flashing - Preparation suggests that holding the reset NRST/RST pin to gnd might allow flashing without having to do any surgery on the MCU pins. However I've not been able to find a BF7612AM28T datasheet to determine which pin is the NRST/RST pin.

If anyone has access to that information would you please share it. I would like to give it a try.

phrfpeixoto commented 4 years ago

I bought a IR gateway in Brazil, and it seems to contain the same TYWE3S. I wonder if we would be able to flash Tasmota on it and keep using it as an IR gateway? https://www.amazon.com.br/Geonav-Infravermelho-Aplicativo-equipamentos-HIRCIR/dp/B0828KL4TR

huyphamnhu commented 4 years ago

@phrfpeixoto As long as there isn't any other weird MCU on board (fortunately most IR gateway don't have), you can flash Tasmota to the TYWE3S just fine :)

phrfpeixoto commented 4 years ago

I see. I guess the matter now would be how get IR devices working after flashing.

huyphamnhu commented 4 years ago

Lol, read the docs, config correct GPIO pins for IR transmiter and receiver (visually you can obtain this by looking at traces on pcb). Grab an ir remote, press some buttons, see magic happens in tasmota's web/serial log. IRsend those magic spells.

jwaes commented 3 years ago

YES! the solution worked. The dimmer is now tasmotized by doing the followings:

  1. wire a shortcut wire between the left side pin hole (close to J3 marking on my last picture) to the ground - and that wire must stays there for the whole flashing process.
  2. just 3 to 5 seconds shortcut between GPIO0 and GRND on the TYWE3S spider' pins flash it!! Mine is FREE!!!! Thanks meingraham for keeping me engaged into it :) Keep this wire there (blue one in the picture) for the whole regular soldering flashing method process. shortcut

I am trying to tasmotize the same device as @kozumin but it doesnt seem to be working.

https://photos.google.com/share/AF1QipPhWKl6sQMOvb2ZTMeXAUxwJpoRRqS879rPlJQz71gshu2Yc_nw4UWjgD6n99gKlw/photo/AF1QipPzxI_cscZhVztkj-czlPGM0WzL0N_v0YPKBQwm?key=dzRQWUxUN0dObDV1am1QMHdMdnF3TXpqcFd3QTd3

I did the shortcut wire in 1) -- the yellow loop wire. For 2, i do short the GPIO0 for a few seconds when i power up the device. (the green led on the device lights up dimmed). But when trying to tasmotize i dont get any connection to the ESP ... it stays at 0%

Anyone an idea ?

Montreal666 commented 3 years ago

YES! the solution worked. The dimmer is now tasmotized by doing the followings:

  1. wire a shortcut wire between the left side pin hole (close to J3 marking on my last picture) to the ground - and that wire must stays there for the whole flashing process.
  2. just 3 to 5 seconds shortcut between GPIO0 and GRND on the TYWE3S spider' pins flash it!! Mine is FREE!!!! Thanks meingraham for keeping me engaged into it :) Keep this wire there (blue one in the picture) for the whole regular soldering flashing method process. shortcut

I am trying to tasmotize the same device as @kozumin but it doesnt seem to be working.

https://photos.google.com/share/AF1QipPhWKl6sQMOvb2ZTMeXAUxwJpoRRqS879rPlJQz71gshu2Yc_nw4UWjgD6n99gKlw/photo/AF1QipPzxI_cscZhVztkj-czlPGM0WzL0N_v0YPKBQwm?key=dzRQWUxUN0dObDV1am1QMHdMdnF3TXpqcFd3QTd3

I did the shortcut wire in 1) -- the yellow loop wire. For 2, i do short the GPIO0 for a few seconds when i power up the device. (the green led on the device lights up dimmed). But when trying to tasmotize i dont get any connection to the ESP ... it stays at 0%

Anyone an idea ?

Intending to flash the same device ( https://templates.blakadder.com/rjwf-02a.html ) did you get it working? if so could you summarize process as there seem to be multiple versions above. Thanks!

TimDowker commented 3 years ago

BF7612AM28T datasheet

I was able to find the data sheet for the BF7612AM28T (I believe) but I can't figure out which is the RST/NRST pin.

Any help?

https://datasheet.lcsc.com/szlcsc/1912121705_BYD-GDMC181S20A_C467773.pdf

Thank you

arvidj01 commented 3 years ago

I was also able to find that .pdf.

As luck would have it pre-covid at work I sat next to an fellow with a strong China background and was able to read most of it. Neither of us was able to find the elusive RST/NRST pin.

TimDowker commented 3 years ago

It has been suggested that connecting "XTAL_IN" to ground may keep the MCU from interfering with the flash - haven't tested yet though.

arvidj01 commented 3 years ago

Please let me know as I have two new devices I want to flash and the "unsolder\resolder" incantation is pretty scary. Thanks.

Tediore commented 3 years ago

@arvidj01 @TimDowker I tried grounding that pin and was not successful. I ended up removing the TYWE3S to flash it. However, using a CP2102 USB-TTL adapter with an external power supply works to flash Tasmota on devices with a TuyaMCU without the need to do anything to the MCU. Not sure if it will work with this particular MCU, but it's worth a shot. Learned that tip from some people on @digiblur Discord server.

eduardorcosta commented 3 years ago

Hello, I thing I found what is going on here, I tried to flash this ESP until 3 AM and no luck, but today, I read the paper in Chinese that @TimDowker has found. After read (don't speak or read Chinese kk) I found a part in the paper that show the flash procedure in time.

basically:

OSC:       ________|-|___|-|___|-|___|-|___|-|____
PROG_ENB:  ________|-------------------------|_____
RESET:     ____________________________________|--------------

The reset pin has to be grounded on boot and after the 20ms than it can be open.

I tried this way, both with I00 grounded and RESET too, after a few seconds open the shortcut, than run Tasmotizer I can see now the com port, and than if I click the Tasmotizer I can get the Mac address in the form.

Hope it helps anyone.

szwenni commented 3 years ago

For the RJWF-02A (https://templates.blakadder.com/rjwf-02a.html) it worked out for me with:

Disconnect anything form the PCB.

MCU pin (Pin next to J3) -> GND GND (pin next to J3) -> GND 3,3 V (squared pin next to R3) -> 3,3V RX -> TX (or vice versa, at leas one works) TX -> RX (or vice versa, at leas one works) GPIO0 -> GND RST -> GND

After all connected plug the FTDI into USB port and start the esptool ( already had the command prepared so I just need to hit enter). You need to release the RST -> GND directly after hitting enter and the flash will start. (The esptool will try to connect multiple times).

The last comment gave me the hint that before connecting the FTDI via USB you need to connect RST to GND otherwise it will fail.

Montreal666 commented 3 years ago

Thanks for sharing @szwenni, will try this tomorrow. Cheers,

maateekaa commented 3 years ago

IMG_20210207_222517 Hello guys! I tried first OTA update, but it failed (checked the MCU version, OK, but it wont update), ok, lets try the other way... Today i tried the serial update via tasmotizer, failed.. the led is just blinking but after 15 seconds timeout. Please help.. thanks

Montreal666 commented 3 years ago

For the RJWF-02A (https://templates.blakadder.com/rjwf-02a.html) it worked out for me with:

Disconnect anything form the PCB.

MCU pin (Pin next to J3) -> GND GND (pin next to J3) -> GND 3,3 V (squared pin next to R3) -> 3,3V RX -> TX (or vice versa, at leas one works) TX -> RX (or vice versa, at leas one works) GPIO0 -> GND RST -> GND

After all connected plug the FTDI into USB port and start the esptool ( already had the command prepared so I just need to hit enter). You need to release the RST -> GND directly after hitting enter and the flash will start. (The esptool will try to connect multiple times).

The last comment gave me the hint that before connecting the FTDI via USB you need to connect RST to GND otherwise it will fail.

Thanks again; works perfectly. Same procedure confirmed in these posts:

https://tasmota.github.io/docs/TuyaMCU-Devices/ https://github.com/xoseperez/espurna/issues/1729

maateekaa commented 3 years ago

Is it important to remove the TYWE3S, or just desolder TX and RX pins?

Montreal666 commented 3 years ago

Since I had to consolidate multiple sources to get this working, here's my summary for the DM_WF_MDV4 ( AKA : RJWF-02A ) hopefully this will help others and save you some time: Please note that in my case I only had to use serial flashing for versions dated 2020 ; previous (2019) versions were flashed TUYA-OTA.

image Header J3 (STM8 debug interface)

VCC >> FTDI VCC SWIM (Pin 18) >> nothing Ground >> FTDI ground NRST (Pin 4) >> FTDI ground

image TYWE3S

IO0 >> FTDI ground before FTDI connection then released a few seconds after boot TX >> FTDI RX RX >> FTDI TX

Note that the push button is wired to the MCU (PA3 Pin 10) so it cannot be used by Tasmota. Similarlly the devices has a bi-color LED where one color (green) is wired to the TYWE3S (GPIO14) and the other one (red) to the MCU (PC5 Pin15).

Cheers,

szwenni commented 3 years ago

Is it important to remove the TYWE3S, or just desolder TX and RX pins?

Usually you can keep it soldered. But there is a little other MCU on the board. At least RJWF-02A has it. It seems like this needs to be in reset state which means pulling the reset pin to GND. On the RJWF-02A it is this Pin4 (see comment above).

some findings connections

In this picture you can see to which pin it is connected on the MCU. I would say it is pin 4 as 2 and 3 are Rx/Tx on the MCU.

Keep in mind with MCU I am referring to the second MCU on the board (picture above) not the TYWE3S.

rufik commented 3 years ago

I ended up desoldering TYWE3S for flashing and re-solder now off to the functionality of the dimmer.

@anantbhula How did you do that? How to desoldier without damaging module? I have Moes BHT-002 thermostat which cannot be flashed by tyua-convert nor simple serial connection. It looks like MCU prevents flashing although I can enter flash mode...it looks like desoldering is my last chance...

authguardian commented 3 years ago

@rufik As far as I remember, i used smd heat gun and pry as i was heating. once of just solder some jumpers on the pin needed to flash and used breadboard as well.

rufik commented 3 years ago

OK, so soldering iron is useless here I guess?

jaymemaurice commented 3 years ago

@rufik you can use chip quick - it’s like a solder that melts at a really low temperature... so you mix it in with the other solder and you can just pop off any SMD or IC. Save it and use it again and again. Make sure you clean it off and use flux.

Master-Rudi commented 3 years ago

Want to flah a TYWE3S and don´t want to solder directly on the chip? Or don´t have a soldering ion? Try that: https://www.ebay.de/itm/133680447971

salgari commented 2 years ago

Hi there. Do you know what are the gnd and nrst mcu pins of the WF-CS01 Curtain switch? Or I can't get the darasheet. Thanks IMG_20211019_193752

maateekaa commented 2 years ago

Hi there. Do you know what are the gnd and nrst mcu pins of the WF-CS01 Curtain switch? Or I can't get the darasheet. Thanks IMG_20211019_193752

Hi. This is just a touch controller. You can see the TYWE3S pinout on te other side of the PCB.

salgari commented 2 years ago

So the WF-CS01 Curtain switch has no mcu controller and you have to tasmote cut track rxd? or is there another way?

MaliMrav commented 2 years ago

Tonight I confirmed the chip does go into programming mode but fails everytime. After numerous attempts I say it get as far as displaying 15% complete before failing. Anyone got ideas? I have seen one video CH_PD be connected to ground, but I don't think that's required.

Yes, The reason it fails is that the MCU sends hearbeat code to it every so often. You need to disconnect the RX from the MCU and it'll flash.

Background: The issue with Tuya units that cooperate with an MCU is that the MCU and the ESP module are in constant communication. The theory was that the MCU will not respond until it's requested to, however the MCU constantly (every second or so) sends the status to the ESP module. So if you try and update the firmware via serial, it'll go ok untill the MCU sends code and disrupts the firmware. That is why it'll fail at different percentages.

The solution: Rather than un-soldering wires, you can bring the RST pin on the MCU low, while you program the ESP chip. Bringing the RST on the MCU low, stops the MCU chatting (freezing it, while you program the ESP

Hope that helps?

MaliMrav commented 2 years ago

So the WF-CS01 Curtain switch has no mcu controller and you have to tasmote cut track rxd? or is there another way?

Same thing applies to all Tuya (cooperative MCUs). any MCU or RS232 type interfaces will communicate to the ESP, stopping the uploading of the firmware. You need to hold the RST of the MCU low, while programming

Erolf345 commented 2 years ago

Hi there. Do you know what are the gnd and nrst mcu pins of the WF-CS01 Curtain switch? Or I can't get the darasheet. Thanks IMG_20211019_193752

Did you figure out the RST pins? I also can't seem to find the datasheet for this controller.

alexsandroz commented 2 years ago

I'm trying to flash tasmota on TYWE3S from a three-button wall switch, but it looks like this version is different from the previous ones. I already removed the chip from the device to avoid conflict with the MCU, but it still didn't work. On the chip it says TYWE3S P/N W603, but it's green and not blue like the others. Has anyone had any experience with this device?

https://pt.aliexpress.com/item/32996385241.html?spm=a2g0o.order_list.0.0.21efcaa4FFMCzP&gatewayAdapt=glo2bra

MVIMG_20220813_182739 MVIMG_20220815_012308

sfromis commented 2 years ago

After the unsoldering, what was your exact wiring for flashing? You need extra connections when removing the module from the main PCB, as strapping pins must be in the right state. Basically gpio 15 low and en/ch_id high, in addition to the usual grounding of gpio 0.

alexsandroz commented 2 years ago

Thanks for the feedback. I connected the standard pins. VCC -> VCC RX -> TX TX -> RX GND -> GND IO0 -> GND

This other blue chip works without additional connections. image

IO15 -> GND ok, but en/ch_id would be which pins?

sfromis commented 2 years ago

EN is clearly labeled on the board you put the TYWE3S into, and is likely already connected on such a device. Since you unsoldered the TYWE3S module, you could also just look at the labels on the back side to find EN. Or the pinout in the linked page.

alexsandroz commented 2 years ago

Thank you for the informations. I managed to install Tasmota on the device.

This TYWE3S board is in a different pattern than the ESP12F. Below a diagram who has the same device. image

Tasmota Template {"NAME":"Wall Switch W603","GPIO":[1,544,1,34,32,33,1,1,225,226,224,1,1,1],"FLAG":0,"BASE":18}

bsalvador commented 12 months ago

Tasmota Template {"NAME":"Wall Switch W603","GPIO":[1,544,1,34,32,33,1,1,225,226,224,1,1,1],"FLAG":0,"BASE":18}

did you replace the module for esp12 or kept the TYWE3S?

I have same switch here, and tried to flash the TWYE3S with the module desoldered but with no luck. Also replaced the module for a ESP12, no luck as well.

sfromis commented 12 months ago

Standard ESP12 and TYWE3S is just the same, the latter being a branded clone. You just need the right wiring. There also exists the variant ESP12S, a little bit easier to flash unsoldered, needs a couple fewer strapping pins connected.

alexsandroz commented 12 months ago

I kept the original TYWE3S. For flashing you should wire the correct pins conform the picture above using de column TYWE3S P/N W603. Standart ESP12 will not working. The layout of board W603 not enable a ESP12. Maybe work if you soldering gpio 15 low and en/ch_id high.