Help with flashing Sonoff Dual r3 (please)

Hi all,

I have purchased and received two Sonoff Dual r3 devices and am absolutely struggling to flash them with either Tasmota or ESPHome. I have flashed many devices with both Tasmota and ESPHome using either a FTDI or a raspberry pi (esptool).

I have followed the instructions on the blackadder page and followed along in the various youtube tutorials, but for some reason this time, i am getting stuck. I am getting the same errors with both sonoff devices.

When using the raspberry pi,

  • to erase the firmware i have tried both:
sudo ./esptool.py --port /dev/ttyAMA0 erase_flash

and

esptool.py --port /dev/ttyAMA0 erase_flash

with the same result

esptool.py v3.1-dev
Serial port /dev/ttyAMA0
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:b9:7e:69:9a:08
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...

A fatal error occurred: Timed out waiting for packet content
  • to flash the firmware i have tried both:
sudo ./esptool.py --chip esp32 --port /dev/ttyAMA0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 bootloader_dout_40m.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 tasmota32.bin

and

esptool.py --chip esp32 --port /dev/ttyAMA0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 bootloader_dout_40m.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 tasmota32.bin

to the same result

esptool.py v3.1-dev
Serial port /dev/ttyAMA0
Connecting.......
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:b9:7e:69:9a:08
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Flash will be erased from 0x00001000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0000ffff...
Compressed 15872 bytes to 10320...
Writing at 0x00001000... (100 %)
A fatal error occurred: Timed out waiting for packet header

When using the a windows machine, with esp-flasher i get the following error:

Using 'COM9' as serial port.
Connecting........_____....._____....._____....._____....._____....._____....._____
Unexpected error: ESP Chip Auto-Detection failed: Failed to connect to Espressif device: Timed out waiting for packet header

When trying to flash, i can see the rx led on the ftdi adapter flash, but the tx never flashes or lights up.

I have even gone out and purchased a new FTDI adapter thinking it was at fault, but it gives exactly the same error. This is the version i have (and yes i have updated the drivers)


http://deviceinbox.com/drivers/1486-ftdi-d3xx-cdm-drivers.html

Any help would be appreciated.

I had the same issue. Problem is the FTDI doesn’t pass enough power to let it boot. Once you have a successful flash you need to mains power it to get it onto wifi. Just be careful with the mains voltage and unplug the FTDI just in case.

Thanks for the reply @stevemutch0911. Can i just clarify what you have stated (or at least my understanding of it). You are saying that the flash is successful but that i need to then power the device with mains to find and configure tasmota? or are you stating that i need to solder a separate 3.3v power supply to the 3.3v and GND points on the device in order to flash, as the FTDI wont supply enough power, and then connect it to mains power after a successful flash?

thanks in advance

It flashes fine connected to the FTDI Michael but once you see it complete in the serial log and it hard resets it won’t boot up and connect to the WIFI as there isn’t enough power coming through the FTDI.

Once it successfully flashed desolder the leads, put the unit back together and power it L IN and Neutral with mains power and it boots up onto the WIFI. Done 5 of these now and works every time.

1 Like

Thank you for your help.

I will report back as soon as i have received my next delivery as it looks like i have blown both of the r3 devices in my attempt to flash (before your messages).

Thanks

Michael

Ok, so, update.

I received two more Dual r3 over the weekend, (its funny how an order from iTead can take over 2 months for the first two to arrive, then only a few days for the second order to arrive). I again attempted to flash via the Windows esp-flasher app, and again it failed with the exact same errors. I then went out an purchased a new micrSD card so i can build a fresh raspberry pi install and noticed an issue from my original parameters. Where i had esptool.py --chip esp32 --port /dev/ttyAMA0...., i should have had esptool.py --chip esp32 --port /dev/ttyS0.... I ran it with the revised parameters

esptool.py --chip esp32 --port /dev/ttyS0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 bootloader_dout_40m.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 tasmota32.bin

and successfully flashed one unit. I tried this with the original two units, but i think i cooked those. I will flash my last unit later tonight.

Thanks for the assistance.

Hope this helps others stuck in the same situation.

Hi I had the same problem where they wouldn’t flash saying it couldn’t erase flash, It was due to a bad earth connection on the GND pad, I placed my earth on the - side of the 6.8uf cap as show as an alternative on the tasmota flash instructions and it worked perfectly maybe give this a go on your other units that wouldn’t flash.

Hi
Can you share code for ESPHome to control this sonoff dual R3 ? Please

2 Likes

Is any chance to add to this Sonoff also sensor temperature like Dallas Ds18B20 ?

Hello guys, I had problems flashing esphome to the DualR3.
I got the unit flashed but it didn’t boot. I can’t remember the exact message, sorry.
Anyway, I bought one of the serial converters that was recommended in the esp webpage and it worked first try. The CH340G.

Maybe someone has the same problem as me and this helps.

image

By the way, the FTDI worked in the past with some arduino projects and I read the logs so maybe there’s some sort of compatibility issues with the eshphome firmware. I’m no expert to tell.