Way to save an ESP based device?

Hi

So here is what I by mistake did and sort of locked me out of that device ! It’s a multisocket strip with USB ports controled by ESP and tuya software ! I used tuya-convert to change firmware OTA in it and use ESPHome. Unhappy being stupid, I loaded in it an ESP-01 based firmware which means only 512K of flash and so no OTA :frowning: I discovered that when I tried to upload the final firmware I had prepared for it and OTA was always refused ! I tried to upload a basic firmware with nothing in it out of Wifi config but still it doesn’t fit so no way to recover it by OTA.
I opened the device but the ESP module is on a little board soldered to main board without any indication of pinouts of module ! Did someone has already seen such module and would know pinout of it so I can flash it with USB adapter and recover it ?
I include few photos of device in case :wink:

Thanks for any suggestions or ideas :smiley:

Vincèn

External view of device


Inside with main board

Main board side components

Details of the board hosting the ESP

Other side of the ESP board

Soldering side of ESP board

Hi, I’m in the same boat, but with another device. I found the pinout by googling the silkscreen label, in my case it’s TYWE2S, then I noticed the pins are printed also on the module. Looking at your photos though, it seems there’s nothing written on it. Try googling the model of your device and try to find out alternative namings (these devices are sold under many brandings), maybe you can trace it from there. BTW I don’t seem to be able to flash it in place, it seems that the button and led are interfering with the esptool connection

1 Like

thinking out side the Square here

what about uploading the sonoff-minimal bin file than when It ask you for the other file
upload the ESPhome bin file

1 Like

Already tried that and also contacted Tuya that is the manufacturer of the ESP module used in that device but as all references on module have been removed they are unable to identify the module :frowning:

Impossible as having flashed a firmware for small memory it refuses any OTA :frowning:

1 Like

https://www.aliexpress.com/item/32869538851.html here is the thingy
Let me know if you need more help

Also remember you are working with dangerous voltage in there

I have same device, and I made it by sonoff and I changed tasmota to esphome but I also lost my OTA.

and I have another issue, this product has triangle screwdriver so I can’t open my power strip. I wish I can make it by OTA.

I hope that secondary Tuya-converter

Sorry to tell you you are now as me with a dead product you can do nothing with it !! Tuya-converter won’t work now that you have no more the original firmware ! Even if you open it I didn’t succeed to find the wiring of the ESP board soldered on main board ! I guess it can perhaps be found back by analysing the board and testing contacts but too long so I gave up but interested to know if you find a solution ! as product is not bad by itself !
I thought also an other solution that would be to completely unsolder the ESP board from main board, plug it on power (being very careful and using insulation gloves) and then check where are the 5 or 3.3V and find back contact pushing buttons and the rest should be the output to switch the sockets !

how come you did not fix this yet?
In the link I provided there is the pin specification of the ESP board.
Comparing the pin specification with the board you can easily solder in place some small wires and using a FTDI to usb flash ESPHome again via USB.
Again let me know if you need info exactly where to solder the wires.


Looking at this pic, it is clear the left most pin here is ground, as it is connected to the electrolytic cap ground lead. Solder a black wire here for ground


now that you know where ground is, and comparing with this schamatic, just to the right of GND is UTXD, solder a wire from this blob to FTDI RX wire
on the opposite side of the board there is 3V3, and URXD which needs to be connected to the TX of the FTDI.

The only one left is the IO0 to set in Flash mode, according to the schematic it is the pin in the middle in the side where the esp shield is, I would guess it is connected to GND via the pushbutton it is there, so check for continuity between ground and this pin when you push the button, if it beeps then you won’t need to solder a wire there and just press the button when connecting the FTDI to usb port.

2 Likes

Too busy with other stuffs to fix that now :smiley:

If you had checked my pictures you would have noticed module in my strip plug is not the same :wink:

Thanks for your investigations and help but it’s based on a different module of the one I have in the power strip unhappy :frowning: so out of GND I think it’s wrong for the other pins :frowning:

This the ESP8266-S3 chip. There are atleast 2 blogs detailing about this. Please read and happy soldering and reflashing


Please note that this chip does not have reset. Also if you are trying to load the firmware directly in the power strip, make sure you DO NOT connect the power strip to wall.

How are you so sure it is not the same?

you are very kind glmnet, I also use mp3 module you developed.

I connected DAC and sounds like a Professional Audio Machine.

I always thanks to your kindness and great codes.

and I’ll challenge my flashing Powerstrip, If my triangle screw driver arrives.

1 Like

The instructions work it is the same wifi module as I have just flashed my power strip and mine also has the reset point on the back.

Here’s pin numbers marked 20190916_114423

1 Like

Oki so with all details you have been kind to supply here I have been able to flash my power strip too but it never starts :frowning:
Tried to flash it in USB from my computer with esptool and also flash it with ESPHome straight from hassio but same:

INFO Successfully compiled program.
INFO Running:  esptool.py --before default_reset --after hard_reset --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 /data/power_strip_bureau_vincen/.pioenvs/power_strip_bureau_vincen/firmware.bin
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
MAC: 84:0d:8e:9c:0e:bc
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 378112 bytes to 260308...
Wrote 378112 bytes (260308 compressed) at 0x00000000 in 23.0 seconds (effective 131.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200

It compiles and uploads successfully and that’s it, nothing else happens :frowning: I have done the shortcut GPIO0 with GND only when I first plugged my USB/serial adapter in hassio computer for flashing !

Any ideas what’s wrong ?
My sketch file in case:

esphome:
  name: power_strip_bureau_vincen
  platform: esp8266
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_passwd
  fast_connect: True
  manual_ip:
    static_ip: !secret ip_power_strip_bureau_vincen
    gateway: 192.168.1.1
    subnet: 255.255.255.0

api:

logger:

ota:

web_server:

sensor:
  - platform: uptime
    name: Uptime_Power_Strip_Bureau_Vincen
    filters:
      - lambda: return x / 86400.0;
    unit_of_measurement: "days"
    accuracy_decimals: 0

binary_sensor:
  - platform: gpio
    pin: GPIO5
    id: "bouton"
    name: "Bouton Escaliers"
    on_press:
      then:
        - switch.toggle: relay_1

switch:
  - platform: gpio
    name: "Multrise Bureau Vincen 1"
    pin: GPIO4
    id: relay_1
    restore_mode: always off
  - platform: gpio
    name: "Multrise Bureau Vincen 2"
    pin: GPIO12
    id: relay_2
    restore_mode: always off
  - platform: gpio
    name: "Multrise Bureau Vincen 3"
    pin: GPIO13
    id: relay_3
    restore_mode: always off
  - platform: gpio
    name: "Multrise Bureau Vincen 4"
    pin: GPIO14
    id: relay_4
    restore_mode: always off

How are you sure it never starts?
Are you just pressing the button and listening for the first relay to switch?
Are you sure that the button is controlled by GPIO5?
After flashing, have you disconnected the device and waited a few seconds to make sure it boots normally?

I’m still new to ESPHome - so someone can correct me if I’m wrong on what I see.

You don’t specify a port for your web_server - the port is optional, but the docs don’t say if there is a default. To be safe add port 80:

web_server:
  port: 80

After this you should be able to connect to is’t IP address from your PC (or .local) and see if the device booted and is online.

Let us know if the web server is available… that is very useful in knowing if the problem is boot releated, or configuration related.

Cheers!
DeadEnd

well I get nothing in USB for logs and device never shows up on my Wifi (I use same setup for all my ESP device so I’m sure of my settings :wink:
For web server port is only needed if you want to use a non standard one :wink:

Update: very strange but the ESP module is not able to boot in normal mode just with the 3.3V of my USB FTDI adapter but no problem for flashing it this way…
So once plugged the power strip back on main power it shows up now online.
For other people that would have same device, here is layout of GPIO in it (I’m still missing the power button on it, it acts on none of the GPIO so not sure what happens there with it…
USB power: GPIO4
Socket 1 (the one nearest of power button): GPIO15
Socket 2: GPIO 5
Socket 3: GPIO14
Socket 4: GPIO12
Status LED on Power Button: GPIO2

Will update this post when I figured out how the power button is wired !

1 Like

Okay, thanks for clarifying… by any chance did you erase the original firmware before flashing?
I have read that sometimes this prevent corruption - maybe your flash did get corrupted somehow.

esptool.py --port /dev/ttyUSB0 erase_flash

Then try flashing again - I don’t know if you need all those extra options though - might be able to just do:

esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 /data/power_strip_bureau_vincen/.pioenvs/power_strip_bureau_vincen/firmware.bin

You could probably leave off the -fs 1MB since it appears it was auto-detected. You can try using dout flash mode too… this is slow, but I believe is the most compatible. Worth a try :wink: .

On the topic of worth a try… there is a newer version of esptool (2.7) you could update, but I highly doubt that is the issue.

Cheers!
DeadEnd