logo elektroda
logo elektroda
X
logo elektroda

Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting

peterwup 2589 13
ADVERTISEMENT
  • #1 20320477
    peterwup
    Level 1  
    Posts: 1
    Hello,

    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting

    I tried to read out the flash of the module before I flash a new software.

    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting

    I soldered Rx1/Tx1 /CEN + 3,3V and connected it to two different USB / serial adapter.
    Rx1 is connected to Tx and Tx1 is connected to Rx.

    Used "Beken Writer 1.60" with the following config:
    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting
    Press on "Read flash" connect CEN to GND for a short period and wait.
    I can see that the display changes and the two LED on the board are changing (so rest works) but got only an error.

    Next step I have tried to read out the flash by python script with the following result :
    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting
    - I have changed Rx and Tx with out any result
    - check several baud rates without andy result.

    Woud be great if someone has an idea. Thank you Peter
  • ADVERTISEMENT
  • #2 20320753
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Hello. Your device is most likely using some kind of UART protocol (if it's an older version of Zmai-90) or TuyaMCU protocol (if it'a a newer version). UART protocols are using the same pins that are used for programming - RXD1 and TXD1. TuyaMCU packets sent to WiFi module from the MCU may interfere with programming.

    In order for it to work, you basically need to disconnect Wifi's RXD1 and TXD1 from TuyaMCU. This is done in various ways, depending on the device, sometimes you have to desolder a chip, sometimes to cut the trace...
    In case of this switch, we had to desolder the buttons controller: https://youtu.be/JCqq-gn-X2c?t=190
    In case of this relay, we had to remove capacitor and cut the trace: https://youtu.be/0V0kaRVnk18?t=257
    but in case of this device...

    Can you take off the PCB with WiFi module, power it from your 3.3V power supply (something with a reliable LDO, AMS1117, because current capability is important) and try again?
    Helpful post? Buy me a coffee.
  • #3 20356175
    MariusU
    Level 2  
    Posts: 2
    Hello,
    I have the same module as you, the communication is switched to RX2 and TX2 pins, baud rate is 115200 and config is 8,N,1.
    Have fun on this serial.
  • ADVERTISEMENT
  • #4 20356201
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Your Zmai-90 is using RXD2/TXD2 for TuyaMCU?

    TXD2 is a log output of Beken, not a TuyaMCU data port...
    Helpful post? Buy me a coffee.
  • #5 20356324
    MariusU
    Level 2  
    Posts: 2
    You might be right, all I saw was logs and debug data.
    I have just fried mine by shorting the GND and N line by mistake while it was plugged in mains.
    The game stops here for me, at least for now.
    Please do tell if you manage to flash via serial.
  • #6 20356337
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    Ah okay, so false alarm. You saw just the debug log output of Tuya firmware. The baud rate also fits.

    Is your WiFi module also dead now? Maybe it survived, can you try desoldering it and reading it's flash?
    Helpful post? Buy me a coffee.
  • #7 20378311
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4
    Same at my zmai, i can't read something on him i dont know if will work via wi fi.

    Thanks
  • #8 20391045
    djlukas
    Level 27  
    Posts: 1606
    Help: 94
    Rate: 266
    I replaced the system with ESP in my Zmai.
  • ADVERTISEMENT
  • #9 20391748
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4
    Can you post what esp use? Because i dont find any esp with same pinout like cbu

    Thanks
  • ADVERTISEMENT
  • #10 20391784
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    If the UART lines are in use and you don't want to cut the traces to remove the interference, you can always use this method:



    Bk modules can be easily programmed outside circuit.
    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting
    just adjust pinout to your need
    Helpful post? Buy me a coffee.
  • #11 20391969
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4
    I have this esp c05 but i think is not same pinout like cbu:

    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting

    Yea is different because my chip have only 6 pins on left and right and cbu have 7 with 7.
  • #12 20396756
    djlukas
    Level 27  
    Posts: 1606
    Help: 94
    Rate: 266
    Actually different pin spacing. I thought every Zmai had the same one.
    Here's mine after disassembly
    Zmai-90 CBU Module Flash Reading Issue: Beken Writer 1.60 Error & Python Script Troubleshooting
  • #14 20842801
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14408
    Help: 650
    Rate: 12349
    I have worked on new Zmai-90 recently, the one that is using RN8209C for power metering. It's almost supported by OBK, but still WIP. See more here:
    https://www.elektroda.com/rtvforum/topic4014818.html
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion revolves around troubleshooting flash reading issues with the Zmai-90 CBU module using Beken Writer 1.60 and a Python script. Users report difficulties in reading the flash memory, with suggestions indicating that the module may utilize UART or TuyaMCU protocols, which could interfere with programming. Recommendations include disconnecting the WiFi module's RXD1 and TXD1 pins, adjusting baud rates, and using alternative programming methods. Some users have experienced hardware failures, while others have successfully replaced components or modified their setups to achieve better results. The conversation also touches on the compatibility of different ESP modules and pin configurations.
Generated by the language model.

FAQ

TL;DR: 115200 baud and 8‑N‑1 were observed on RX2/TX2; "Have fun on this serial." This FAQ helps Zmai‑90 CBU owners troubleshoot flash‑read failures, pin roles, and safe serial access. [Elektroda, MariusU, post #20356175]

Why it matters: It shows how to fix read errors, choose the right pins, and avoid damage while flashing your Zmai‑90.

Quick Facts

How do I fix Beken Writer 1.60 “Read flash” errors on a Zmai‑90 CBU?

TuyaMCU traffic on RXD1/TXD1 often blocks programming. Disconnect the Wi‑Fi module’s RXD1 and TXD1 from the TuyaMCU. You can desolder the intermediate chip or cut the traces, depending on the board. Then power the module from a reliable 3.3 V LDO like AMS1117 and retry the read. This isolates noise and stabilizes the supply for flashing. [Elektroda, p.kaczmarek2, post #20320753]

Which UART pins handle programming on the Beken‑based Zmai‑90?

The bootloader uses RXD1 and TXD1 for programming. These are the same lines the device MCU uses for UART or TuyaMCU communication. Disconnect that path during flashing to prevent collisions. [Elektroda, p.kaczmarek2, post #20320753]

Why do I only see logs on TXD2 instead of Tuya data?

You are connected to the log UART. “TXD2 is a log output of Beken, not a TuyaMCU data port.” Expect debug prints rather than Tuya payloads on that pin. [Elektroda, p.kaczmarek2, post #20356201]

What baud rate and serial settings have been confirmed by users?

One report showed serial activity on RX2/TX2 at 115200 baud, 8‑N‑1. Use those settings when listening for logs or verifying output. [Elektroda, MariusU, post #20356175]

Do I need to isolate the TuyaMCU before flashing?

Yes. TuyaMCU packets on RXD1/TXD1 interfere with the Beken bootloader. Disconnect those lines from the TuyaMCU before any read or write. You can desolder the MCU or cut traces, depending on your board’s routing. [Elektroda, p.kaczmarek2, post #20320753]

How do I program the BK module outside the circuit?

You can avoid interference by flashing off‑board. “Bk modules can be easily programmed outside circuit.” How‑To:
  1. Remove the Wi‑Fi module from the main PCB.
  2. Wire its pins to your programmer per the BK pinout.
  3. Flash with your tool, then reinstall. [Elektroda, p.kaczmarek2, post #20391784]

What if I accidentally short GND and N while the device is powered?

You risk instant hardware failure. A member shorted GND to N on mains and reported the unit fried. Unplug before soldering or probing, and avoid live work to prevent catastrophic damage. [Elektroda, MariusU, post #20356324]

Can I desolder the Wi‑Fi module and read its flash?

Yes. After a mains fault, a helpful suggestion was to desolder the Wi‑Fi module and attempt a flash read externally. This can bypass board‑level issues that block UART access. [Elektroda, p.kaczmarek2, post #20356337]

Can I read the flash over Wi‑Fi instead of UART?

No success was reported here. One user couldn’t read the unit and wasn’t sure if a Wi‑Fi method would work. A confirmed Wi‑Fi dump isn’t documented in this thread. [Elektroda, lionboy, post #20378311]

Did anyone swap the CBU for an ESP chip?

Yes. A member confirmed replacing the system with an ESP in their Zmai‑90. The specific ESP model wasn’t provided in that post. [Elektroda, djlukas, post #20391045]

Is there a suggested ESP module to replace the CBU?

ESP8685‑WROOM‑06 was proposed as a CBU replacement and ordered for testing. The post included product links for reference. Consider this path if serial flashing stalls. [Elektroda, lionboy, post #20836413]

Does ESP‑C05 match the CBU pinout?

No. A user compared modules and noted a pin mismatch: their ESP had 6 pins per side, while the CBU had 7 pins per side. That prevents a direct swap. [Elektroda, lionboy, post #20391969]

Are Zmai‑90 modules consistent across batches?

Not always. A teardown found different pin spacing than expected. Check your module’s footprint and spacing before choosing a replacement or designing an adapter. [Elektroda, djlukas, post #20396756]

How do I use the CEN pin to trigger a flash read?

In Beken Writer, click Read Flash, then momentarily pull CEN to GND to reset into read. The LEDs may change, indicating reset, yet errors can still occur if lines are noisy. [Elektroda, peterwup, post #20320477]

What’s the OpenBK status for the RN8209C Zmai‑90 variant?

The RN8209C‑based Zmai‑90 is almost supported in OpenBK, but it’s still work in progress. Watch the linked thread for updates. [Elektroda, p.kaczmarek2, post #20842801]
Generated by the language model.
ADVERTISEMENT