How to flashing Magic Home v1.2 with esphome

I have flashed Magic home v1.1 ZJ-WFMN-A before, Now I bought another led controller from Magic home but they updated it.

I tried to flash it the same way as an old one but it’s didn’t work.

This is the V1.1

I have flashed it like this:
TXD --> RXD
RXD --> TXD
GND --> GND
IO0 --> GND

And it’s worked with Esphome.

But the new version of the magic home which is this:

Is not working in the same way, I tried different ways with a different one:

Way 1
TXD --> RXD
RXD --> TXD
GND --> GND
BOOT --> GND

Way 2
TXD --> TXD
RXD --> RXD
GND --> GND
BOOT --> GND

But still didn’t work, Do you have any suggestion to get it to work?

Connect 3v3 power?

not if he’s powering via 12V on the Magic Home then only ground!

@mnayef95 Did you try pulling down boot only @boot then flash?

He doesn’t say that, but he might be. In that case, is it the same GND for the power supply and the FTDI?

@DrJeff @nickrout I have tried to connect the boot to the same GND for the power supply and the FTDI and tried to separate them and still same issue, Tried to connect the boot pin to GND for 5 seconds then disconnect it and flash, but didn’t worked

What are you using to flash? ESPHomeFlasher? Something else?
Are there any errors?

@apmillen I’m using home assistant Esphome add-on installed on raspberry pi 4 model b, I got only one error which is timeout.

post the error.

@nickrout

Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Invalid head of packet (0x46)
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 115200 --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 /data/light_11/.pioenvs/light_11/firmware.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Invalid head of packet (0x46)

The whole log please?

@nickrout

INFO Reading configuration /config/esphome/light_11.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/light_11
Processing light_11 (board: esp01_1m; framework: arduino; platform: [email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.2.7
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Retrieving maximum program size /data/light_11/.pioenvs/light_11/firmware.elf
Checking size /data/light_11/.pioenvs/light_11/firmware.elf
RAM:   [=====     ]  45.4% (used 37156 bytes from 81920 bytes)
Flash: [====      ]  40.3% (used 413152 bytes from 1023984 bytes)
========================= [SUCCESS] Took 17.40 seconds =========================
INFO Successfully compiled program.
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 460800 --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 /data/light_11/.pioenvs/light_11/firmware.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
INFO Upload with baud rate 460800 failed. Trying again with baud rate 115200.
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 115200 --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 /data/light_11/.pioenvs/light_11/firmware.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

Thanks.

Are you 100% sure that:

  • all wires are connected
  • rx<–>tx and tx<–>rx
  • gpio0 is at ground
  • if there is a reset or program switch on the PCB you have pressed it

Also what ftdi do you have. I found the ones based on the cp2102 to be the best.

@nickrout Yes I’m sure, I did it more than 10 times with the 4 different controllers, I have tried two different ftdis but I don’t know the model or make.

What do you mean by this?

  • if there is a reset or program switch on the PCB you have pressed it

I just had a closer look at your pics, there don’t seem to be any pushbuttons.

You say this is a new version magic home. Are you sure it is a esp8366 chip?

Yeah, it could be one of these…

Actually, I don’t know, I can’t find the esp label on it, not the same as the old one.

You can check @Tediore reply it’s the same device.

Bummer. Becoming a major problem, new closed chips locking us into proprietary solutions.

Was just about to say that. Shame to see so many things move away from ESPs.

@nickrout @Tediore I think I can’t flash it :smile:, so I should throw them away and get the old version?

Now I want to flash them because the magic home and home assistant is not synced correctly, for example:
If I turn off the light from the magic home app it takes much time to reflect the home assistant and vice versa, and most of the time the home assistant is not working when turning the light off or on.

Is there a way to solve these issues without reflashing it or buying the old version?