Closed uspass closed 5 years ago
Hi @uspass
What's the issue?
Hi @kueblc ,
I'm sorry if I have posted in the wrong place. I was trying to follow this advice: "Please at least add the device model number, brand name, geographical area where you have bought the device and its flash mode (as seen in the device information). Add the GPIO assignments as well if you have found them to save the developers of alternative firmwares some time." On the other hand, I'm stuck as i have no clue what the serial TxRx protocol between ESP and EFM might be. I have disassembled the code and try to figure it out, but it's a long shot. I was hoping someone has info on that.
Thank you, us
Ah, I see, thank you for sharing!
I may be able to assist with disassembly. Would you post what you have so far?
@kueblc First of all thank you for your offer. I have worked in the past with several assembly languages and this is not my first dis-assembly ;). But is my first ESP. Still learning, so bear with me. Reading the bin structure we get:
File offset | |||
---|---|---|---|
0x00000 | Header | 0xE9 | |
0x00001 | Nr of segments | 0x03 | |
0x00002 | SPI Flash Interface | 0x00 | QIO |
0x00003 | Memory+Speed | 0x20 | 1M, 40MHz |
0x00004 | Entry point | 0x40100294 | |
0x00008 | Segment 1 Offset | 0x40100000 | |
0x0000C | Segment 1 Size | 0x00000574 | |
0x00010 | Segment 1 Data | ||
0x00584 | Segment 2 Offset | 0x3FFE8000 | User data RAM. |
0x00588 | Segment 2 Size | 0x00000308 | |
0x0058C | Segment 2 Data | ||
0x00894 | Segment 3 Offset | 0x3FFE8308 | |
0x00898 | Segment 3 Size | 0x0000021C | |
0x0089C | Segment 3 Data | ||
0x00AB8 | Zero Padding | 0,0,0,0,0,0,0 | |
0x00ABF | Checksum 0xEF | 0xC0 | |
0x00AC0 | Blank | 0xFF,0xFF,…,0xFF | |
0x01000 | Header | 0xEA | |
0x01001 | Nr of segments | 0x04 | |
0x01002 | SPI Flash Interface | 0x00 | |
0x01003 | Memory+Speed | 0x20 | |
0x01004 | Entry point | 0x40100004 | |
0x01008 | Segment 1 Offset | 0x00000000 | |
0x0100C | Segment 1 Size | 0x00057D30 | |
0x01010 | Segment 1 Data | ||
0x58D40 | Header | 0xE9 | |
0x58D41 | Nr of segments | 0x03 | |
0x58D42 | SPI Flash Interface | 0x00 | |
0x58D43 | Memory+Speed | 0x20 | |
0x58D44 | Entry point | 0x40100004 | |
0x58D48 | Segment 1 Offset | 0x40100000 | |
0x58D4C | Segment 1 Size | 0x00006634 | |
0x58D50 | Segment 1 Data | ||
0x5F384 | Segment 2 Offset | 0x3FFE8000 | |
0x5F388 | Segment 2 Size | 0x0000048C | |
0x5F38C | Segment 2 Data | ||
0x5F818 | Segment 3 Offset | 0x3FFE8490 | |
0x5F81C | Segment 3 Size | 0x0000252C | |
0x5F820 | Segment 3 Data | ||
0x61D4C | Zero Padding | 0,0,0 | |
0x61D4F | Checksum 0xEF | 0x8A | |
0x61D50 | Unknown | 0x4E | |
0x61D51 | Unknown | 0x3B | |
0x61D52 | Unknown | 0xE9 | |
0x61D53 | Unknown | 0x5C | |
0x61D54 | Blank | 0xFF,0xFF,…,0xFF | |
0x79000 | Unknown Data | ||
0x79274 | Blank | 0xFF,0xFF,…,0xFF | |
0x7B000 | Unknown Text Data | ||
0x7B08A | Blank | 0xFF,0xFF,…,0xFF | |
0x7C000 | Unknown Text Data | SSID SsidPassword Key Cloud | |
0x7C36A | Blank | 0xFF,0xFF,…,0xFF | |
0x7D000 | Unknown Text Data | ||
0x7D0C1 | Blank | 0xFF,0xFF,…,0xFF | |
0x7E000 | Unknown Text Data | ||
0x7E00A | Blank | 0xFF,0xFF,…,0xFF | |
0x7F000 | Unknown Text Data | ||
0x7F006 | Blank | 0xFF,0xFF,…,0xFF | |
0xFB000 | Unknown Text Data | ||
0xFB064 | Blank | 0xFF,0xFF,…,0xFF | |
0xFC000 | Unknown Text Data | ||
0xFC080 | Blank | 0xFF,0xFF,…,0xFF | |
0xFD000 | Unknown Text Data | ||
0xFD36E | Blank | 0xFF,0xFF,…,0xFF | |
0xFE000 | Unknown Text Data | ||
0xFE36E | Blank | 0xFF,0xFF,…,0xFF | |
0xFF000 | Unknown Text Data | ||
0xFF020 | Blank | 0xFF,0xFF,…,0xFF |
I got 2 distinct dis-assemblies:
Notes:
I have uploaded the idb's in my git. If you need anything just let me know.
Thank you, us
@ctandi Thank you. I'm aware of that doc. Actually it is referred in Note 6.
Cheers, us
Is this the product that has the Tuya water leak sensor? https://www.aliexpress.com/item/2018-NEO-COOLCAM-Smart-WiFi-Water-Sensor-Flood-Leak-Detector-Alarm-APP-Notification-Alert-No-Hub/32882682503.html
@epicurean70 Yes. That's it. It should have an external sensor too, but it is not shown in packing list.
Has anyone been able to flash tasmota via tuya-convert for this water sensor?
I did. The problem is the MCU powers the ESP for few seconds and then cuts off the power. Tasmota should be modified to transmit the info during those seconds.
Closing due to age and relevance. Thanks @uspass for documenting your work.
@uspass so how exactly did you make those modifications? I have the same sensor looking to flash Tasmota on it. I succesfully did the same with a wifi power switch, but with this sensor the same procedure using tuya-convert is not working.
@uspass i would also like to know how you did it
I have one of those tuya water leak sensor. I have drawn the schematics and made some comments on. It has, beside 8266, a second processor that actually deals with IO. All info so far is here: https://github.com/uspass/Tuya-Water-Leak-Sensor
Any info is welcome.
Thanks, us