-->
Page 1 of 2

Flashing keeps failing at 12% with timed out waiting

PostPosted: Sun Oct 04, 2020 1:55 pm
by GabeZ
Newbie here, first time I ever soldered anything and playing with the ESP8266.

Plan was to use window/door switches from Sonoff with a Sonoff bridge and connect them to Home Assistant. I followed a guide I found and opened the Sonoff ZigBee Bridge, soldered some cables to the board and connected them to the USB to TLL adapter.

When trying to flash the Tasmote ZigBee Bridge image, this always fails at 12% with A fatal error occurred: Timed out waiting for packet header. I tried a lot of things I found through Google but the results remain the same. Some of them: Keeping the reset button pressed before connecting the USBTTL to my laptop and then try to flash. Connecting the USBTTL without using the reset button. Tried rebooting laptop between tries and read several posts on this but I'm not getting any further. Already spent almost 8 hrs on this step.

Using esptool.py I get the following results:
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: a4:cf:12:d9:b9:b6
Uploading stub...
Running stub...
Stub running...
Chip ID: 0x00d9b9b6
Hard resetting via RTS pin...

When I run the command below, I do get a 1MB bin file:
esptool.py --port /dev/ttyUSB0 read_flash 0 0x400000 mybackup.bin

esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a4:cf:12:d9:b9:b6
Uploading stub...
Running stub...
Stub running...
1675264 (39 %)
A fatal error occurred: Corrupt data, expected 0x1000 bytes but received 0xffc bytes

Trying to write to flash:
esptool.py --port /dev/ttyUSB0 write_flash 0 tasmota-zbbridge.bin

esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a4:cf:12:d9:b9:b6
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 2MB
Flash params set to 0x0330
Compressed 540432 bytes to 379979...
Writing at 0x00008000... (12 %)
A fatal error occurred: Timed out waiting for packet header

Trying different baud rates doesn't seem to make a difference:
esptool.py --port /dev/ttyUSB0 --baud 19200 write_flash 0 tasmota-zbbridge.bin

Is there a way I can verify the hardware is still good and I'm just doing the wrong thing?

How can I proof to myself that the wiring is correct to my USBTTL adapter?

Any help is appreciated.
Regards
Gabe

Re: Flashing keeps failing at 12% with timed out waiting

PostPosted: Mon Oct 05, 2020 1:44 am
by schufti
to me it looks like your wiring and commands are ok but your hw (flash on module) is faulty.
the only thing I didn't see is a full erase, you might try
esptool.py --port /dev/ttyUSB0 write_flash 0x0 -e tasmota-zbbridge.bin

Re: Flashing keeps failing at 12% with timed out waiting

PostPosted: Mon Oct 05, 2020 2:32 am
by GabeZ
schufti wrote:to me it looks like your wiring and commands are ok but your hw (flash on module) is faulty.
the only thing I didn't see is a full erase, you might try
esptool.py --port /dev/ttyUSB0 write_flash 0x0 -e tasmota-zbbridge.bin


Had to change the command slightly to get it to run, moved the "-e" :
esptool.py --port /dev/ttyUSB0 write_flash 0x0 -e tasmota-zbbridge.bin

I then says:
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a4:cf:12:d9:b9:b6
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 0.1s
Flash params set to 0x0330
Compressed 540432 bytes to 379979...
Writing at 0x00008000... (12 %)
A fatal error occurred: Timed out waiting for packet header

Re: Flashing keeps failing at 12% with timed out waiting

PostPosted: Mon Oct 05, 2020 3:15 am
by GabeZ
schufti wrote:to me it looks like your wiring and commands are ok but your hw (flash on module) is faulty.
the only thing I didn't see is a full erase, you might try
esptool.py --port /dev/ttyUSB0 write_flash 0x0 -e tasmota-zbbridge.bin


(Not sure where my reply went to, but here is another try)

I had to move the "-e" in the command line, but when I run it, I get the following result:

esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: a4:cf:12:d9:b9:b6
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 0.1s
Flash params set to 0x0330
Compressed 540432 bytes to 379979...
Writing at 0x00008000... (12 %)
A fatal error occurred: Timed out waiting for packet header