Created
May 14, 2020 14:11
-
-
Save dreamcat4/de84d48b8ee18b53d12cefe0ce827814 to your computer and use it in GitHub Desktop.
espurna - Tuya dimmer. First connection and dump OFW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read chip | |
sudo esptool.py --port /dev/ttyUSB0 chip_id | |
esptool.py v2.8 | |
Serial port /dev/ttyUSB0 | |
Connecting.... | |
Detecting chip type... ESP8266 | |
Chip is ESP8266EX | |
Features: WiFi | |
Crystal is 26MHz | |
MAC: 2c:f4:32:3d:15:4b | |
Uploading stub... | |
Running stub... | |
Stub running... | |
Chip ID: 0x003d154b | |
Hard resetting via RTS pin... | |
θ79° [id:~/.dev/tuya-dimmer] $ | |
θ84° [id:~/.dev/tuya-dimmer] $ | |
θ80° [id:~/.dev/tuya-dimmer] $ | |
# read flash | |
$ sudo esptool.py --port /dev/ttyUSB0 flash_id | |
esptool.py v2.8 | |
Serial port /dev/ttyUSB0 | |
Connecting.... | |
Detecting chip type... ESP8266 | |
Chip is ESP8266EX | |
Features: WiFi | |
Crystal is 26MHz | |
MAC: 2c:f4:32:3d:15:4b | |
Uploading stub... | |
Running stub... | |
Stub running... | |
Manufacturer: c8 | |
Device: 4015 | |
Detected flash size: 2MB | |
Hard resetting via RTS pin... | |
[id:~/.dev/tuya-dimmer] $ | |
# dump the first 2MB of flash to a file | |
$ sudo esptool.py -p /dev/ttyUSB0 read_flash 0 0x200000 dreamcat4-tuya-dimmer-ofw.bin | |
esptool.py v2.8 | |
Serial port /dev/ttyUSB0 | |
Connecting.... | |
Detecting chip type... ESP8266 | |
Chip is ESP8266EX | |
Features: WiFi | |
Crystal is 26MHz | |
MAC: 2c:f4:32:3d:15:4b | |
Uploading stub... | |
Running stub... | |
Stub running... | |
2097152 (100 %) | |
2097152 (100 %) | |
Read 2097152 bytes at 0x0 in 189.9 seconds (88.4 kbit/s)... | |
Hard resetting via RTS pin... | |
θ61° [id:~/.dev/tuya-dimmer] $ |
cannot verify flash in esptool
$ sudo esptool.py --baud 19200 --after no_reset --port /dev/ttyUSB0 verify_flash 0 ofw/dreamcat4-tuya-dimmer-ofw.2mb.dump2.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 2c:f4:32:3d:15:4b
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash params set to 0x0030
Verifying 0x200000 (2097152) bytes @ 0x00000000 in flash against ofw/dreamcat4-tuya-dimmer-ofw.2mb.dump2.bin...
-- verify FAILED (digest mismatch)
A fatal error occurred: Verify failed.
θ60° [id:~/.dev/tuya-dimmer] 2 $
Verifying 0x200000 (2097152) bytes @ 0x00000000 in flash against ofw/dreamcat4-tuya-dimmer-ofw.2mb.dump2.bin...
Aah. It is a full dump! I completely forgot about that.
SDK might change last 16kb at runtime (at random, it writes all sorts of stuff there). Everything before that should match? I'd guess the truncate
existing file should help
Thanks... unfortunately I never got around to trying that out. But maybe for the next time I come across this error message. Although that is a totally different hardware (so maybe it will not appear next time).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flashing instructions here:
xoseperez/espurna#1729 (comment)
Hey the image size and
md5sum
of the dumped firmware were different from the one which @davebuk had previously uploaded.