Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By bdepauw
#88028 pffff....

I managed already to have Python working on my Windows 7 PC ( I know old and should update to WIN10 ... )
Want to do a backup from current firmware to .bin for my newly never used SONOFF S20
( firmware seems to be not general available and locked per device, so I need backup from this one )

When starting command :
python esptool.py -b 115200 --port COM6 read_flash 0x000000 0x100000 flash_1M.bin
It won't readout and gives error :
AttributeError: 'Serial' Object has no attribute 'dtr'

I'm using a CH340 ESP-01 usb to serial TTL module, and my connections seems correct as I can read out via Putty @ speed 74880 :

ets Jan 8 2013,rst cause:1, boot mode:(3,6)

load 0x40100000, len 2408, room 16
tail 8
chksum 0xe5
load 0x3ffe8000, len 776, room 0
tail 8
chksum 0x84
load 0x3ffe8310, len 632, room 0
tail 8
chksum 0xd8
csum 0xd8

2nd boot version : 1.6
SPI Speed : 40MHz
SPI Mode : DOUT
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

rf cal sector: 251
rf[112]


Someone an alternative solution to backup firmware ? (without esptool ? )
Or a solution for the 'dtr' problem ?

Thanks for any reaction/reply !
User avatar
By psilospiral
#90492 I want to thank you for posting this along with your solution. Commenting out the line
Code: Select all#      self._port.setDTR(self._port.dtr)

did the trick for solving my compile time error on Debian:
Code: Select allAttributeError: 'Serial' object has no attribute 'dtr'

Much appreciated!
User avatar
By psilospiral
#90509 For those interested, I was also able to solve this dtr error by upgrading my pyserial from 2.7 to 3.5, even though I am running python 2.7.16. I removed the # from
Code: Select all#      self._port.setDTR(self._port.dtr)

upgraded pyserial, and was able to compile in Arduino without the dtr error!