question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tried to revert to the original firmware on a DIN rail switch - ZMAI-90

See original GitHub issue

Was able to successfully convert this device to Tasmota. However, as I expected, the metering features were not available. Before flashing I collected traces of the serial communication between the ESP8266 and the V8921 metering MCU, in an attempt to use the commands after the conversion, to retrieve the metering data. However, after reflashing, the V8921 does not respond to the commands. I assume that there must be initialization data sent during bootup which I was unable to collect.

In an attempt to put the device in the original state, I tried to use the backup generated by tuya-convert, and flash it using the NodeMCU PyFlasher. This resulted in the device entering an apparent loop condition, dumping what appears to be a repeating pattern of 21952 bytes through the serial port (at 115200 bps) - see attached file.

It there any obvious incorrection in the way the backup was reflashed? Here is the output of the command used for flashing (used NodeMCU PyFlasher):

Command: esptool.py --port COM3 --baud 115200 --after no_reset write_flash --flash_mode qio 0x00000 C:\Users\Luis\Documents\dev\home_automation\tasmota\zmai-90\firmware-xxxxxx.bin --erase-all

esptool.py v2.6
Serial port COM3
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: bc:dd:c2:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.3s
Flash params set to 0x0030
Compressed 1048576 bytes to 509810...
Wrote 1048576 bytes (509810 compressed) at 0x00000000 in 45.2 seconds (effective 185.6 kbit/s)...
Hash of data verified.

Leaving...
Staying in bootloader.

Firmware successfully flashed. Unplug/replug or reset device 
to switch back to normal boot mode.

Is there eventually config data (e.g. in the EEPROM) that the backup doesn’t cover?

Thanks!

bootup_mcu_to_v9821_with_backup_01_115200_seq.zip

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19

github_iconTop GitHub Comments

4reactions
kueblccommented, Nov 26, 2019

That would explain it, the firmware is looking in the wrong place for the RF calibration data. Try explicitly setting flash size to 1MB with esptool.py when uploading.

2reactions
kueblccommented, Nov 26, 2019

Just noticed also that esptool.py reported an auto-detected flash size of 2MB. tuya-convert has only been designed and tested with 1MB devices.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reverse engineering the ZMAi-90 DIN rail meter/switch and ...
I will try first to use tuya-convert, may it works. Otherwise, if I use it without trying first it could connect to tuya...
Read more >
Single phase Din rail Smart Switch with Energy monitoring ...
Hi! I bought a zmai-90 shorturl.at/uxyPV and I plan to update the firmware by tasmota and try to use it to measure consumption....
Read more >
ZMAi 90 smart meter in Home Assistant with Tasmota firmware
buy the itm linkhttps://www.zemismart.com/wifi-relay-p0290.html.
Read more >
Home Automation - Smartkit | Page 419 | MyBroadband Forum
I have several, but the first one I bought as a test is still running the original Tuya firmware because it got installed...
Read more >
USER MANUAL EN. QUBINO SMART METER - Z-Wave Alliance
For Qubino, safety is first, so we have prepared lots of safety tips and ... no simpler installation than DIN rail installation –...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found