Tasmota: Latest version of sonoff basic does not enter flash mode

Created on 20 May 2017  Â·  222Comments  Â·  Source: arendst/Tasmota

Just got 4 new sonoff basic (5 pin on the board). None of them can enter flash mode. Press program button and connect usb to computer, does not show any thing different to output console.

I also have some old sonoff 4CH. With same computer, same USB cable, same configuration, I can access flash mode on old devices. So I believe it's not the problem of cable or connection. Seems that there is some kind of protection on the newer firmware.

Any suggestion on what I should do next step for debug ? (Sorry I am a software engineer, newbie to hardware part..)

Seen similar issues on other thread, related to different modules:
https://github.com/arendst/Sonoff-Tasmota/issues/453
https://github.com/arendst/Sonoff-Tasmota/issues/443

wechatimg4
wechatimg5

stale

Most helpful comment

The reverse of RX / TX has solved the problem. (Sonoff S20)
THX!

All 222 comments

Ignore the pin further from the button. The wiki shows which pin is which. You must hold down the button as you insert the vcc pin (then you can let go). It should now be in flash mode.

yeap, I followed exactly what the wiki says. It does not work.
This is the only thing serial port prints. It does not give out anymore info like the old 4ch does.

--- Miniterm on /dev/cu.usbserial 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

This is the upload error.
Uploading .pioenvs/sonoff/firmware.bin
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
* [upload] Error 255

Try to execute pio run -v -t upload from a PlatformIO serial console and analyse the output.

Got 2 new sonoff-basics looking exactly the same as yours (including the hardware mod, extra component soldered between D5 and C?). They flashed without issues.

Did have another problem. After successfully flashing 5.0.7 unit didn't give any sign of life anymore. Re-flashing didn't help. After flashing a 4.0.3 backup image it starting working and then did an upgrade via web to 5.0.7 without further issues. YMMV

@arendst
Thanks for guiding! Here is the the output. Is there anything helpful?

[skipped some complication message].
Auto-detected: /dev/cu.usbserial
esptool -vv -cd ck -cb 115200 -cp "/dev/cu.usbserial" -cf .pioenvs/sonoff/firmware.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel ck@atelier-klippel.de
setting board to ck
setting baudrate from 115200 to 115200
setting port from /dev/tty.usbserial to /dev/cu.usbserial
espcomm_upload_file
espcomm_upload_mem

opening port /dev/cu.usbserial at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
* [upload] Error 255

@gdave321 did your device print out anything in serial console before the flash? These ones do not print anything out.. What's the date print on the warranty label on your devices? Mine is marked as 2017/03/15 (the only date I can find out of the device).

wechatimg5

I have a very similar issue. My date is 2017/3/10. I cannot flash it in any way. No terminal output.
And all flash attempts result in:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

Have you tried swapping around the TX/RX connections?

I have tried that yes.....

I made some progress! Though still have no idea of why, and the way to success is not reproducible.

Out of the 4, I randomly got two worked... A rough sequence of what I did is: swap TX/RX,
so the connection is TX-TX, RX-RX. hold the power button, plug in usb cable. Keep holding power button all the way, do not release. And then out of many times of try, it just uploaded !!!!

Highly suspect this is related to some kind of timing issue (sth. like input any key within this N seconds, otherwise it will reboot normally.). Since even after the succeed upload, I can't reproduce with the same device twice.

Also another thing I noticed is, green light does not flash everytime it's plugged in. So would it be possible that this new model need 5v power supply ? Don't want to risk burning it...

Trying..... but I am not not able to produce the same result as you did....

The reverse of RX / TX has solved the problem. (Sonoff S20)
THX!

Still not able to flash it......... no idea on how to solve it....

same here… I have 2 more left that still with no way of flashing..

If anyone could help pointed out which one is GPIO 0, wiring GPIO 0 with
GND might work?

On Thu, 25 May 2017 at 4:00 PM DarkAllMan notifications@github.com wrote:

Still not able to flash it......... no idea on how to solve it....

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-303948903,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABW_Nkyz7MJN0syNF_sCaK2RIqnby-ISks5r9TUOgaJpZM4NhQQ0
.

Is there an update to this issue?

Not sure if they have perhaps made a change.. but on my sonoff Dev I have to hold the flash button down until flashing starts (well actually I think there is a 2second window - but easiest to just hold the button down until flashing starts).

Worth a try?

I did try, but nope...nothing...

I had the same issue with S20. I had to swap RX/TX, and then just kept trying to flash it following @whhsw's directions and eventually it uploaded. Appears to be some sort of timing issue with the new model?

The people who succeeded, what baud-rate were you using and how many times did you try it? Having the same issue with a new sonoff.

I have 4 basic and 4 Pow on the way. So I'll let you know.

@mihalski thanks, I just realized that my reseller didn't send me a basic, but rather a sonoff RF, it seems to have different demands when it comes to booting it, so I might have a different problem, (but this info will probably be useful for other people)

Yes. I got 2 RF units thinking they would be better.. But in fact they're a much bigger pain in the ass.

Have you managed to flash them? I tried shorting the resistor while holding down the button(I think it was R21, can check later) but it doesn't seem to go into programming mode. How can you tell if it is? Is the led flashing etc?

Where can you see the difference between the basic en the RF on the board?

From: kristoffernolgren [mailto:[email protected]]
Sent: vrijdag 23 juni 2017 11:02
To: arendst/Sonoff-Tasmota Sonoff-Tasmota@noreply.github.com
Cc: DarkAllMan randall.kam@gmail.com; Comment comment@noreply.github.com
Subject: Re: [arendst/Sonoff-Tasmota] Latest version of sonoff basic does not enter flash mode (#463)

Have you managed to flash them? I tried shorting the resistor while holding down the button(I think it was R21, can check later) but it doesn't seem to go into programming mode. How can you tell if it is? Is the led flashing etc?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-310612714 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABglByDeg051lQV2usvPeXEKdvkGTlknks5sG38JgaJpZM4NhQQ0 . https://github.com/notifications/beacon/ABglB93HaaKDul3SZSvajoJpxqVo30Vgks5sG38JgaJpZM4NhQQ0.gif

I used s dab of solder to short. Then I discovered I needed to take it off to use the devices :P wasn't too hard to remove.

But yeah.. I programmed and am using them. Was a lot more finicky than standard Sonoff/Pow/TH.

You can tell when it starts programming :P

@mihalski I'm trying to remove error-factors, like my FTDI, the script i'm using to program, connecting rx/tx etc, when I try to start the sonoff in programmin mode, it still connects to the wifi for example, is it suppose to do that? I just ordered a couple of new non-rf sonoffs to see if everything else works as it should...

@DarkAllMan The RF has an additional circuit attatched with an antenna, you can see it in the lower left corner on this image, upper photo, should be pretty easy to spot: https://www.itead.cc/wiki/images/thumb/d/d8/Sonoff_rf_parts.jpg/400px-Sonoff_rf_parts.jpg

No it should not connect o wifi in programming mode.
Just use Arduino IDE with your FTDI. We all know that this should work and it has always eventually worked for me.

IF you try 5 times and it fails.. swap tx/rx and try again.. Even when I think I'm bashing my head against the wall with these things it eventually works.. The RF units were the first to really piss me off though.

Then mine is NOT an RF version :)
Thx. Also, I think mine is dead now….. Ordered a new one….

From: kristoffernolgren [mailto:[email protected]]
Sent: vrijdag 23 juni 2017 11:12
To: arendst/Sonoff-Tasmota Sonoff-Tasmota@noreply.github.com
Cc: DarkAllMan randall.kam@gmail.com; Mention mention@noreply.github.com
Subject: Re: [arendst/Sonoff-Tasmota] Latest version of sonoff basic does not enter flash mode (#463)

@mihalski https://github.com/mihalski I'm trying to remove error-factors, like my FTDI, the script i'm using to program, connecting rx/tx etc, when I try to start the sonoff in programmin mode, it still connects to the wifi for example, is it suppose to do that? I just ordered a couple of new non-rf sonoffs to see if everything else works as it should...

@DarkAllMan https://github.com/darkallman The RF has an additional circuit attatched with an antenna, you can see it in the lower left corner on this image, upper photo, should be pretty easy to spot: https://www.itead.cc/wiki/images/thumb/d/d8/Sonoff_rf_parts.jpg/400px-Sonoff_rf_parts.jpg

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-310614802 , or mute the thread https://github.com/notifications/unsubscribe-auth/ABglB_00gTKF05ISz3SjScQRkh7UcR58ks5sG4FZgaJpZM4NhQQ0 . https://github.com/notifications/beacon/ABglBz1nAH-7HvFqhNZGIQN11hkDE2grks5sG4FZgaJpZM4NhQQ0.gif

@mihalski thx! And what about the LED, should it blink, be dead etc? Can you put it in programming mode even if rx/tx is the wrong way around? Is there something else that is required for triggering programming

I have tried to boot it with mulitple firmware, including Tasmota and espEasy, using arduino and esptool.py (osx) but it seems I can't get it to boot correctly so the IDE doesn't really seem to be the problem, atleast not yet...

I'll answer some of those questions when my new units arrive.. But..

Yes.. You don't have to be connected at all to put it into programming mode.. It's just that you can't program it unless it's in programming mode.. I honestly can't remember what the lights to.. It might be worthwhile looking at youtube for this.. Let me see if I can find anything useful..

Booting doesn't sound like your problem. It's programming.. It's ABUNDANTLY clear when programming is working.. So there is never any doubt.. You can see it programming in the Arduino IDE.

Yeah, I seem to be failing at getting in to programming mode. He says "without programming cable and pushbutton we can start programming the device." The pushbutton is the one that sets gpio0 to zero and the programming cable is the cable used to connect the sonoff to Ftdi, he mus mean with, not without right?

with or cannot :P

Just got my new sonoff wifi switches - spent about three hours and failed to put any of them to flash mode.. If anyone had any luck with that - please share :)

I got my 4 power/4 standard today. Won't be able to test till Sunday AEST. Will let you know.

@paggard what version do you have?

@kristoffernolgren do not have them at hand now - will post exact info later... but they are very recent - bought them 10 days ago directly from ITEAD.

@paggard allright, intrested if it's an RF or a basic etc?

@kristoffernolgren - mine are not RF versions.

@kristoffernolgren here is my board. The seal on the enclosure shows '2017 3 15'
sonoff_board

Received a new one with date 2017-3-15
Unable to enter flash mode.... still trying multiple times, switching RX/TX, holding pin untill upload... etc etc..
But nothing seems to be working.......

I will be doing this tomorrow. I'll let you know.

I've tried to flash a few dozen times now without success.
I've never had this much trouble before, so perhaps they have changed something.

Itead uploaded a new schematic of the board in March, so chances are they changed something.

https://www.itead.cc/wiki/File:Sonoff-Schematic.pdf

You should still be able to get it into flash mode by connecting GPIO0 to Ground before powering on the device.

@Lennyz1988 I've already checked the board - the button is for sure connecting Ground and GPIO0...

For what it's worth you can flash the firmware OTA without needing an FTDI now. I just got it to work.. hope to create a docker container that can do it for you. I think you will at LEAST need wifi so that you can join the ITEAD access point that a Sonoff provides.

@mihalski that sounds way better! Do you have any docs etc? How did you figure it out?

I'll try to write something basic up tonight. Also would like to create a docker container to automate it, but that's a steep learning curve as I've never built a docker container before :P

Cool and very interesting afaik, it wasn't possible before. Has sonoff done an update or something.

Btw, I just got 5 sonoff basic models, I could put them into programmer mode without problem. I did not manage to flash them but got stuck half-way through. I think it's due to a crappy FTDI-module. Some people say it worked for them to change and I had a china-clone, so have ordered a new one.

@paggard Then people should be able to flash. There is not a single ESP8266 that doesn't get into program mode with GPIO0 pulled to ground.

Well this is a pain. I was about to start working on some documentation when I got home from work and what happens? the most conspicuous Sonoff Pow in the house dies on me. No TV. No lights in the living area. First one to die on me.

Pro tip.. Backup your configs..

For what it's worth I just programmed the Sonoff Pow via FTDI on my first attempt.

Running into a problem doing it the OTA way.

I got 4 basic models, tried flashing 2 of them. all dated 2017-03-15. used two separate FTDI boards, (purchased a $20 one from Jaycar!!! and a FTDI basic 3.3 from Sparkfun) swapped RX, TX over many times, no luck - can flash nodeMCU without issue.

Search for SonOTA on Github.. It works.

This maybe the issue for those with the RF version. I've swapped the resistor around but still have not had any luck. https://tech.scargill.net/even-more-sonoff/

esptool.py ... write_flash --flash_mode dout ... fobar.bin ?

Maybe just need DOUT? Worked for m.

I have just received two Sonoff Basics. I used arduino to upload basic blink program to blink pin 13 just as a test, with some serial output to test if it is working. It seemed to upload fine with Arduino with no errors, but it did not blink and there was no serial output from the loop.

So briked 2 sonoffs trying to do OTA, not Sonota fault, I made some guess as to what to do because there is no doco and got things a bit mixed up, I have posted over there, but back here now, has anyone been able to flash using ftdi on a 2017-03-15 sonoff basic? Or even managed to get that version in to flash mode?

same as JSCSJSCS , can flash any sketch normally , but then it aint work ,
i can add , that there is output on the serial though , the problem i that you may not see it , as the Baudrate is auto set to 74880 , and then you may see this output

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

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v3de0c112
~ld
Fatal exception (0):
epc1=0x4021c1d4, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

I solved the problem with the sonoff basic received august 2017 setting on arduinoide the model as ESP8285. Bye

@gnkarn I finally solved my problem. At first I had an issue that I can't even remember, so I tried a simple blink program. That is as I described, seemed to flash, but didn't. I knew Tasmota's more recent firmware require DOUT as the flash mode, but thought that was a Tasmota requirement, not a Sonoff one, so I did not change it. But finally I said what the heck and changed the flash mode in Arduino IDE to DOUT instead of DIO and it worked! The I tried Tasmota again and it worked too. Good luck!

Hi Everyone - has the same issue.. I could get into program mode and upload sketch - but it never run - even a simple blink sketch. Spend hours troubleshooting....

Solution was to change board type to ESP8285 as per @emanuelefanton

Thanks very much

the correct solution is to use DOUT instead of DIO mode for the flashing step.
ESP8285 makes this change, but it also changes other things.

thank you guys ,
i will give a final shot at it , but i suspect that something got failed on this one , because i did already what you proposed , it flashes , ok but it aint work .

so , i tested , another unit , it worked right from the first attempt .

my conclusions ( not certain though ) , are that somehow , that was damaged while flashing the unit with tasmota the first time , with the wrong setup (DIO), and even when i was able to flash it again , it never recovered full functionality . i know it sounds strange , but it is what i can see in practice so far .

I have been using ESP to program my sonoff, now I have to use Arduino because it needs to be DOUT now, but I have never used it, I have the board (8266) drivers installed, but i cant find out anywhere how to flash the new software, can someone help pleaee

Graham

Hello All,
I have a wired problem where it smoked the device when starting flashing!
I thought I made a mistake and tried another one, and double checked all powers and grounds according the this link
http://www.andremiller.net/content/programming-an-itead-sonoff-wireless-smart-switch-esp8266

When first powered in regular mode, it powered with no problem and LED started blinking indicating it is in regular mode, but again when I started flashing process, it then smoked the device again. I think it smoked the 3.3 regulators. Could some one help what could be going wrong?
I got an original FTDI cable and made sure it is a 3.3V device.

Thanks

the only reason a basic would smoke is if you applied 5v to it. make sure you
are using a 3.3v FTDI cable

@ahajmousa @davidelang is on the right track. Do not trust what your read on your USB/UART adapter. Use a multi-meter to confirm which pin is which. You may be getting 5V from the pin marked 3.3V and vice versa. I just received a NodeMCU micro-controller marked with two D2's on it.

with version 17/5/15: switching rx/tx did the job

Don't know if this will help, but- I program all of my esp modules with Arduino. My frustration was growing as I could not upload to the Sonoff. Nothing I did seemed to work. When watching the boot text on a terminal program, I saw a checksum error.

The solution, at least for me on the Arduino IDE was to change the "Flash Mode: DIO" to "DOUT".
That fixed it. (Googling the error also produced suggestions to change the Flash Mode to QIO, but that wasn't an option on the Arduino IDE).

Hope this helps someone.

@ahajmousa Listen to @davidelang and @JSCSJSCS. I have one FTDI that I can switch between 5 V and 3.3 V, but that switches only the data ports. The power pin still delivers 5 V (!)
20170907_112537

As for DOUT, read https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips#20170714---tasmota-needs-compile-flash-mode-option-dout-on-all-devices

DOUT has been the required mode for some devices for a long time, the
documentation has been saying to use DOUT for several months now.

But anything that gets the word out on this helps, thanks.
k

After 4 hours a searching the web, this thread was my way out of endless trouble.
For a sonoff with an ESP8266 from 2017-06-20 DOUT was the solution.
Flashed it sucessfully with "nodemcu firmware programmer".

settings sonoff esp8266 2017-06-20

Hi guys, same manufacturing date than @oloid-design and the same for me, the only way to get a wifi access or any sign of life was to flash with the IDE Arduino selected ESP8266 module 80mhz 40mhz flash 115200 1M(128kb) SPIFFS DOUT. I spent many hours to find the tips !!! hope this will help people.

A lot of people say this but not what they flash

Sent from my iPhone

On 22 Sep 2017, at 22:07, Gis70 <[email protected]notifications@github.com> wrote:

Hi guys, same manufacturing date than @oloid-designhttps://github.com/oloid-design and the same for me, the only way to get a wifi access or any sign of life was to flash with the IDE Arduino selected ESP8265 module 80mhz 115200 1M(64k SPIFFS. I spent many hours to find the tips !!! hope this will help people.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-331560845, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ad8x_igOCUkjauyly3YSnuJhnoWEuRBqks5slCGegaJpZM4NhQQ0.

Please do not use the 8265 setting, instead use the DOUT mode.

@gpw1057 I flashed ESPEasy 2.0 with arduino IDE 1.8.4 and it's working fine.
@davidelang I did mistake in the config i corrected my previous post.

tried all of the above, still no luck on my end, I can get it to flash, but there is no life afterwards

Greg, since this is your only post, if you want assistance, try describing what you have done so far.

Sure,

I have 5 of these sonoff wifi switches Im trying to get updated. nothing has worked so far

I've tried both the arduino ide and the platformio for flashing following the instruction to the letter
I've tried using ESP8266 && ESP8265
I've tried changing to 1M(128kb) and pretty much all other options there
I've tried flashing blink, sonOTA and a couple other random sketches
I've tried swapping rx/tx - wont flash when swapped, only flashes when tx->tx & rx->rx

To flash I hold down the button plugin in the transfer cable release the button and click upload which compiles and uploads the sketches to 100% and says done but when plugging in the devices there is no life

Attaching screenshots of what Im working with.
I it always uploads successfully but there is no indication that it works, it does not connect to wifi and no lights flash

arduino_ide
20170907_163051
20170907_162721

On Sun, 24 Sep 2017, Greg Keys wrote:

I've tried both the arduino ide and the platformio for flashing following the instruction to the letter

does this include DOUT mode ane 1M(no spiffs)?

yes

On Sep 24, 2017 8:54 PM, "David Lang" notifications@github.com wrote:

On Sun, 24 Sep 2017, Greg Keys wrote:

I've tried both the arduino ide and the platformio for flashing
following the instruction to the letter

does this include DOUT mode ane 1M(no spiffs)?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-331771142,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADIV-9ELSZy5ILDx8uJUrDQr29E_f3ZQks5slyPZgaJpZM4NhQQ0
.

yes

On Sep 24, 2017 8:54 PM, "David Lang" notifications@github.com wrote:

On Sun, 24 Sep 2017, Greg Keys wrote:

I've tried both the arduino ide and the platformio for flashing
following the instruction to the letter

does this include DOUT mode ane 1M(no spiffs)?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-331771142,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADIV-9ELSZy5ILDx8uJUrDQr29E_f3ZQks5slyPZgaJpZM4NhQQ0
.

@gregkeys suppose all went fine as long as your wifi credentials are wrong you won't see a connection.

So simply after flashing your device remove an re-apply a serial connection. Enter command seriallog 3 and configure your device using the many available commands from the wiki.

Hi @gregkeys are you sure that your arduino nano is able to flash as a ftdi r232 adapter ? What is the chipset in the back of nano ?

You should try a real ftdi controller.

1/ flash a 1mb binary with FF
http://www.pratikpanda.com/completely-format-erase-esp8266-flash-memory/

2/ follow this :

IDE Arduino 1.8.4
ESP8266 lib with 2.3.0 (not 2.4.0)
selected ESP8266 module
80mhz
40mhz flash
115200
1M(128kb)
SPIFFS
DOUT
no debug
and nothing for the debug

I am like Gis- I've never tried using a Nano to program any of my esp devices. Are you sure you aren't flashing the Nano?
You should be using a real FTDI device. This is the one I am using: [https://www.amazon.com/gp/product/B00DJUHGHI/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1]

I am also wondering how you are connecting to the Sonoff- I don't see any header pins on the serial port in your photo.

I am also wondering how you are connecting to the Sonoff- I don't see any header pins on the serial port in your photo.

Be carreful, if some data are lost due to bad connection with RX/TX

@Gis70 Yes I am positive you can use the nano, here are several videos of people flashing the esp8266 using a nano

I'm beginning to think that recent batch's of sonoffs have bad esp8266's

No one ever said it couldn't be done from the Nano- just that no one trying to offer you assistance here has ever done so.

I have 5 Sonoffs and a dozen esp-01's here here and they all program over the FTDI adapter quite well.

But back to my original question:
How you are connecting to the Sonoff? I don't see any header pins on the serial port of the Sonoff in your photo.

@SteveRMann Im holding pressure at an angle on the the 5 pin unsoldered header placed through the 5 holes on the sonoff.

@SteveRMann for the sake of arguement I soldered a header onto the sonoff and reflashed, the results were exactly the same, upload succeeds to 100% but there is no life from the unit

Im holding pressure at an angle on the the 5 pin unsoldered header placed through the 5 holes on the sonoff.

The opportunity for data noise using this method is astronomical. No serious engineer would ever try that method.

And you only need four pins for the serial port.

I soldered a header onto the sonoff and reflashed, the results were exactly the same, upload succeeds to 100% but there is no life from the unit

Are you using the Arduino IDE?
Walk us through the steps you are taking- starting with the .ino file you are trying to flash.

@SteveRMann then its a good thing I'm just s silly engineer :P regarding the steps taken please read the thread comments I've already detailed out the steps I've tried so far also note that I did try with soldered pins with the same results.

Hi. The last chance for you is to go to the issue 169 and follow the
thread. Erase with python tool then flash a binary from tasmota. (The good
one not the one for Sonoff Touch.) If doesn't work buy a ftdi programmer.

Le 28 sept. 2017 6:45 AM, "Greg Keys" notifications@github.com a écrit :

@SteveRMann https://github.com/stevermann then its a good thing I'm
just s silly engineer :P regarding the steps taken please read the thread
comments I've already detailed out the steps I've tried so far also note
that I did try with soldered pins with the same results.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-332726488,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP0hTEIFqZHMkka9IPFBDPEhLt5W7Fdoks5smyR7gaJpZM4NhQQ0
.

then its a good thing I'm just s silly engineer :P regarding the steps taken please read the thread comments I've already detailed out the steps I've tried so far

No, you have not detailed the steps taken. You have offered snippets of things you tried and tangential references that have little to do with your issue. But nowhere have you offered a detailed review of the steps you've taken. It was an effort just to find out how you were connecting to the Sonoff serial port.

Simply put, there is something wrong with your process or your software.

@gregkeys When I use an onboard chip from a microcontroller to program a SONOFF, I have to bypass the microcontroller in some way, otherwise you just end up programming the microcontroller. I have not used a Nano in this way, but in your image, you have power, ground, TX and RX leads going to the SONOFF. I don't see any leads putting the Nano in bypass mode. Like I said, I haven't used a Nano before, but as an example, when using an Arduino UNO (or clone) to program a SONOFF, one has to set a jumper between RESET and GROUND on the UNO to tell it to not listen, just pass along the serial comms.

@JSCSJSCS Yeah its not really obvious in my image but the ground & reset are shorted which puts the nano is passthrough mode.

It's important to remember that getting the device in flash mode has nothing to
do with the tasmota software. This is a hardware feature of the chip.

If GPIO is connected to ground before power is applied to the chip, it WILL go
into flash mode.

If the problem is that flashing the device doesn't produce the expected result,
there are only a handful of possibilities

  1. the serial data is not getting to the chip as expected.

  2. there is stuff in the config section of the chip that has ended up looking
    like a valid configuration to the software (CFG_HOLDER value is found at the
    right place) wipe the device with all 0's or change the CFG_HOLDER value and
    flash again so that the bad config isn't accepted.

  3. the device has been partially fried by having 5v applied to it during
    programming.

you can always try grabbing some form of 'hello world' program for an ESP8266
and flash that. If it doesn't work, see #1 or #3 above. If it does work, but
tasmota doesn't work, then see #2 above.

These chips are pretty much immune from being bricked (by anything other than
over-voltage anyway)

@gregkeys This is a long thread and I while did a quick find to make sure I was not repeating someone's previous suggestion, I could be doing so. I would suggest finding out what USB-UART chip the Nano has and reinstalling that driver again. There may be some corrupted bit or two in your current file.

@JSCSJSCS serial is controlled via FTDI FT232RL chip, tried reinstalling drivers to no avail..... really thinking that the has been some bad batches lately, I'm seeing a lot of threads show up with people experiencing the same issue

@gregkeys I guess all you can do is order another batch. I take it you've programmed previous ones with your nano. If the new ones work, send the old ones back.

Switching rx/tx worked for me. My full process:

  1. Install Platform.io into VS Code Windows 10
  2. Download and extract Sonoff-Tasmota repo v 5.8.0
  3. Uncomment line 'env_default = sonoff-minimal'
  4. Connect FTDI pins to Sonoff Basic (sticker date 2017 06 20, version TH_V1.1) in order from switch left to right 3V3, Tx, Rx, GND
  5. Hold button for 2 secs while plugging in USB. Light on Sonoff stays off
  6. Click upload

I struggled for an hour with a Sonoff S20, it was manufactured around 2017 March.
But I think it was my fault in the end.

If all power+gnd wires are connected correctly, when I plugged in the USB FTDI adapter, the Sonoff LEDs should be on, and the Sonoff actually should works (with factory software)

  1. My first problem was that solder didn't stick properly to the Sonoff board, so my ground connection was loose. I solved this by checking connections with a multimeter and then fixing the solder joint.

  2. I tried swapping RX-TX, but in my case, the original description (RX-RX, TX to TX) was correct, this wasn't an issue

  3. However, I have had some problems with the espeasy tool and command/batch file. It started uploading, but then it stopped halfway.

The solution was to do the proper timing (press button on Sonoff, only then plug in the power).
Then I tested with esptool.exe, with flash mode: DOUT (!) (-fm switch), it made it halfway, then gave an error.
At this point, at least I know the programming mode is active on the Sonoff.

So I tool the NodeMCU firmware flasher, and that did the trick!
Speed: 115200
Programming: 40 MHz
Mode: DOUT (!!!)

So: watch out for proper connections (and soldering), make sure the device is really in programming mode, and use the "DOUT" mode for flashing.

Dont try to flash sonoff th_v1.1 there is no update for this version .

do you mean that it's not ESP8266 based? If it is, then Tasmota will work on it
unless some functionality is run through other chips (unlikely)
k

It is esp8266 just there is no software for this version. I think the pinout is different .

well that cant be true about pinouts being different cause out of three thv1.1 devices i tried flashing since yesterday two failed but third is working fine, out of two that failed 1 was working until i flashed a second time

i have try flash sonoff th_v1.1 and don´t work... any one do this ?

I had untold problems with flashing.

I've been tinkering with micro controllers for a while so I couldn't understand why I was having problems. I have have 2 different and very reliable USB/UART devices from reputable companies (including Arduino) that I have been using for years without issue. Having failed with both of them, I knew that they were not the problem.

Turns out, like many things in electronics, things are fine in one context but not in another.

Anyway, I bought FTDI's High Speed USB to UART cable, C232HD-DDHSP-0 (3.3v), and Silcon Lab's CP2102N-MINIEK (5v signals) from a reputable supplier (Farnell Element 14). Both of them worked without issue.

Flashing problem solved.

There are a lot of comments,I'm not going to read them all, what I did to flash is hook everything up but power pin, plug us into laptop, hold button down, supply power while holding button down, wait 3 to 5 seconds. You will see no response from sonoff basic but you will be good to flash.

For you guys struggling to flash the sonoff with an FDTI adapter, I went through the same process, spent two days trying to flash two sonoff basic with no luck (upload failed /sync error), then I tried the Sonota method and I have successfully flashed 4 sonoff basic (same manufacturing date), one B1, two BN-Z01, one sonoff POW and a S20. All of that with no soldering, just wifi, DNS spoofing and boom! flashed.

Here:
https://github.com/mirko/SonOTA
Go to the wiki section for more info.

Well, there is no problem wit sonoff th_v1.1
flashing, everything works with communication. ilackskill
wrote correctly. the problem is that after flashing the sonoff is not working, no led blink no wifi connection.
i found just one bin file that fits to this sonoff.
Msonoff(th_v1_1)_20010_07688.zip

@Pauliussss Sir, you just saved me! I got my very first SonOff Basic 3 days ago, and I was planning to start playing around with ESPeasy to learn how to integrate those smart switches in my system.
But I went almost when, after flashing the firmware, the SonOff went "dark" with no sign of activity and no green led.
Unfortunately it took me a while to find your comment but then the revelation: it is indeed a th_v1.1 manufactured on 2017-5-5.
So thanks to you I switched to TASMOTA, installed Platform.io (which is a super-easy and very nice way of dealing with code for some n00b like me) and finally resurrected my SONOFF!
Thank you so much! I really hope others with the same problem might be able to find this discussion.

what was the solution? can you send the bin file?

@Pauliussss The solution is flash the .bin file that you uploaded, i just did it with esptool

esptool.py --port=/dev/cu.usbserial-portxxxx -b 115200 write_flash 0x0 filenamexxxxxx.bin

@Pauliussss I did the following:

  1. Flash the bin you provided, directly with ESPeasy tool.
  2. The SonOff immediately came back to life after flash. Green led blinking. Obviously the AP was not accessible since I didn't know the password.
  3. So I installed the latest Sonoff-Tasmota inside Platform.io and compiled for my version of SonOff with my AP e my Pass.
  4. The only problem is that for the first time only in order to complete the flash via Platform/Atom i had to keep the button pushed until the end. After the first time every other flash went just fine with the normal procedure. (enter program mode --> release button --> flash --> reboot)

Thanks now it works the web server is on:) thanks for changing the firmware

what next:) what is the best way to use iphones homekit?

espcomm_open failed

trying platformio arduino ide and all times this error persist.
have changed rx - tx and the error persist any one have one idea why ?

Try keeping pushed the button for the whole time, not only for a few
seconds to enter programming mode.

For What its worth I got a new sonoff couple days ago and was unable to flash Ive got many before and flashed with no issue, I read through a lot of these posts trying the suggestions, nothing worked,I went back to basics tested the cable and tried running software I knew worked before. Its always the simple things the header that I got soldered on was not 100 percent, I just followed the pins and found points on board to check for continuity and it was as simple as that. If everyone with a new sonofff cant flash them then its probably a problem with the boards but as people are still flashing them no issues guess its human error, check and check again. If anyone has sonoffs they cant flash and have given up on them please free to mail them to me.

@isugaee I can assure you I double-checked my steps at least 5 times in
order to exclude human error. Sure, a bad soldering can happen and you are
true: users should always check for simple things first before going for
something worse. Anyway, can you tell us which version was your SonOff
board (usually printed in the top corner) and when it was manufactured?

It's manufacture date is 2017 5 5, It flashes OK but I'm getting some
strange errors on Ota updates which refuse to work, but direct flashing is
OK. I'm new to Ota will read and play a bit more. Ive been getting the
sonoff from same place for bout 2 years. I noticed it said the chip was
esp8266ex when I used the python flash tool. I've got a bunch of slampher
lights arriving this week hopefully they will be easy to get into flash
mode seems there are a lot more different boards on those. Good luck hope u
get to bottom of it

On Dec 1, 2017 1:55 PM, "NeoMod" notifications@github.com wrote:

@isugaee I can assure you I double-checked my steps at least 5 times in
order to exclude human error. Sure, a bad soldering can happen and you are
true: users should always check for simple things first before going for
something worse. Anyway, can you tell us which version was your SonOff
board (usually printed in the top corner) and when it was manufactured?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-348408404,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AgkZtKnjlEXgwHMYH57_RlOzzywgurADks5s75TJgaJpZM4NhQQ0
.

eveything works ok with flashing. just now searching how it is possible to connect sonoff to homekit

I have flashed 10 Sonoff devices successfully over the last few months. I just got two new TH10's (v2.1 2017-6-8) and was having this same problem - error: espcomm_open failed.

I tried various combinations/incantations from above - swapping tx/rx, changing compile options, holding down/not holding down button after power time, etc. All using Atom - my standard install route.

I no longer even got a blue led flash from either when powered up normally, so wondered whether I bricked them.

However, flashing with esptool.py just worked. Easily. Phew.

at least sonoff connected to the homekit and siri:)
sonoff tasmota + instaled homebridge + mosquitto mqtt server.:)

Mine would only flash using "Generic 8285 Module"

Took me ages to get it figured out but works fine now.

just come the report that I got 5 sonoff basic and currently I opened 2 of them and they are both 2017-5-5, and I just flash tham with the new firmware, so far so good.
I use a arduino uno to connect them and flash them in PlatformIO

and now I am on the 3rd one, this one seems flash OK, but has difficulty to connect to router.....
not sure why, the green light stable for a while and blinking..... and there is no DHCP record for this one
if I flash with fixed IP, still I won't be able to open the web page, strange

edit: OK a reset of the device fixed it

First to say: I've not yet tried to flash my sonoff th16 (just received yesterday)
My advice is to improve the setup using a power supply with electrolytic capacitor at least 47uF that stabilizes the output. Is it your case? if not, I'd use an AMS1117 3.3V regulator + a capacitor or a 6A DC5V power supply with trimmer for regulation (down to 4.6) and two diodes on both leads to reduce the output voltage to around DC3.4V (measure it before power up the 8266). If you have, you can still add the 3.3 regulator to be safe. I hope this setup will help in reducing (if not eliminating) random result in flashing.

Does somebody know the password for "Msonoff(th_v1_1)_20010_07688.zip" file
Thanks

i had similar issues and this is how i fixed them:

  1. switched to a PL2303 based USB-TTL adapter with 3.3V source
  2. connected at first only the 3.3V and GND pins, then plugged in the USB adapter while holding down the button on the sonoff and then I let go of the button and connected the RX and TX cables (crossed). It was enough to just disconnect one of the two RX/TX cables actually

the rest was according to the instructions on the wiki page. after i did all that the flashing worked flawlessly, before it worked only every now and then. the other USB-TTL was based on a C320 or something chipset.

my sonoff was produced in 2017.6.20

hope that helps.

The solution for the Sonoff TH_V1.1 (2017-5-5) for me was offered here:
https://www.letscontrolit.com/forum/viewtopic.php?f=5&t=3386&start=10#p18240
I used the ESPEasy R120 firmware.

I, too have a newer SONOFF with the RF module. I also purchased a sonoff touch. I removed the sonoff touch board and used the ground pin on the 4 pin header an grounded GPIO 0 using the pictures on a different post and whalla, the FDTI232 flashed it using the Arduino Tasmota sketch. But when I try to put the Basic Sonoff into programming mode, no-go. So I installed the EWELINK app just to see of the module was working and it is. The app says the model is a Sonoff pro. It's running the standard firmware 1.5.5 but there is a notice that there is a new version 1.6.0 available. I have not tried running that update, yet. I keep getting these errors
Archiving built core (caching) in: C:\Users\me\AppData\Local\Temp\arduino_cache_43038\core\core_esp8266_esp8266_generic_UploadTool_esptool,CpuFrequency_80,FlashFreq_40,FlashMode_dout,UploadSpeed_115200,FlashSize_1M0,ResetMethod_nodemcu,Debug_Disabled,DebugLevel_None_____4a456663f995b75d67edb5ddf0880e0d.a Sketch uses 494568 bytes (48%) of program storage space. Maximum is 1023984 bytes. Global variables use 50840 bytes (62%) of dynamic memory, leaving 31080 bytes for local variables. Maximum is 81920 bytes. warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed error: espcomm_upload_mem failed
2018-02-12 17 31 07
2018-02-12 20 49 15
2018-02-12 20 50 54

I had the same problem as @gregkeys, where the module seemed to program fine through the Arduino IDE, but was unresponsive after programming.

I followed the recommendation of @Gis70 and it worked. I also used the connector held at an angle technique, so I guess I, too, an not a real engineer.

I programmed a second board without flashing the memory with 1M of 0xFF.
It worked as well, so I don't think this was necessary. I did make changes to the Arduino settings and
I used Arduino IDE 1.8.5 instead of the recommended 1.8.4, but all other settings were the same:

ESP8266 lib with 2.3.0 (not 2.4.0)
Board: Generic ESP8266 Module
Flash Mode: DOUT
Flash Frequency: 40 MHz
CPU Frequency: 80 MHz
Flash Size: 1M (128K SPIFFS)
Debug Port: Disabled
Debug Level : None
Reset Method: ck
Upload Speed: 115200

Update: I was able to program 4 additional sonoff basics (plus the sonoff touch) with the arduino script. The problem is with the sonoff (Sonoff pro) with the 433Mhz receiver attached. It's not the setup. Updating the firmware on the pro version did nothing to help and it's now running the stock 1.6.0 firmware.

@jeffhunsinger Thanks, you save my day!! ESP8266 lib version 2.3.0 was the key :]

I had a similar problem with my wemos d1:
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

After a tons of hours I figured out that the onboard CH340 was probably a faulty one.
So I used a regular FT232 , and an EXTERNAL 3.3V powersupply, used the common arduino environment ,
Board: Generic ESP8266 Module
Flash Mode: DOUT
Flash Frequency: 40 MHz
CPU Frequency: 80 MHz
Flash Size: 1M (NO SPIFFS)
Debug Port: Disabled
Debug Level : None
Reset Method: nodemcu
Upload Speed: 115200
and behold the micro is resurrected once again.

i tried to flash 3 of SonoffBasic v.1.1, but two of them failed. When I connect to PC, and entering flash mode, two red led is on - on my cp2303 usb/ttl adapter, and i can not do anything. It is not related to the PC, or adapter, tried with different devices , same result.
Is there anyone, with the same issue? Any solution? thx in advance!

Hi,
I just trying to flash my first sonoff basic. But no luck:-(
Device works fine with original application.

It is TH_V1.1 2017-5-5. Firmware inside is 1.6.0.
u_imag0023

I've tried many thinks, switch RX/TX, keep button down during upload, but still I got following error:

esptool

$ esptool.py --port=/dev/ttyUSB0 -b 115200 write_flash 0x0 ../Msonoff\(th_v1_1\)_20010_07688.bin 
esptool.py v2.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

Arduino IDE

home/marian/.arduino15/packages/esp8266/tools/esptool/0.4.12/esptool -vv -cd ck -cb 115200 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/arduino_build_388524/sonoff.ino.bin 
esptool v0.4.12 - (c) 2014 Ch. Klippel <[email protected]>
    setting board to ck
Nastala chyba při nahrávaní projektu.
    setting baudrate from 115200 to 115200
    setting port from  to /dev/ttyUSB0
    setting address from 0x00000000 to 0x00000000
    espcomm_upload_file
    espcomm_upload_mem
opening port /dev/ttyUSB0 at 115200
    tcgetattr
    tcsetattr
    serial open
opening bootloader
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

I have no idea, what to check/try next. How can I check, what happen on serial line? I've used Arduino serial monitor and minicon, but there is nothing.

I have the same version as yours - and cant flash it - just 3/1 was successful. I have no idea what to do - any suggestion from others? thx

That's strange .. It seems that, maybe, there is something wrong with solderings pins on board, check it twice, for sure.
Try some older IDE version, 1.6xx, some peoples say that this could help. Follow setting upper in this thread (https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-365139699) and double check that you're using 2.3.0 core, that's A VERY important.
Try to put sonoff to flash mode and upload fw a few times. sonoff's internal LED has to blink at the end, if not, there is someting wrong.

Btw, what kind of TTL board are you using? I use this one: https://www.ebay.com/itm/-/381374421597 , switchet to 3.3V (Win7 64bit).

Hi,
I've tested with 2.3.0, many times - no change.

I'm using USB-ART CP2102 converter - on image above. I tested it with different device and I saw messages from this device on serial console.

Regarding this. If I run serial console (minicon on linux), should I see something there?
I can see in /var/log/messages

Mar  4 20:21:49 worker kernel: cp210x 3-3:1.0: device disconnected
Mar  4 20:21:50 worker kernel: usb 3-3: new full-speed USB device number 31 using xhci_hcd
Mar  4 20:21:50 worker kernel: usb 3-3: New USB device found, idVendor=10c4, idProduct=ea60
Mar  4 20:21:50 worker kernel: usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar  4 20:21:50 worker kernel: usb 3-3: Product: CP2102 USB to UART Bridge Controller
Mar  4 20:21:50 worker kernel: usb 3-3: Manufacturer: Silicon Labs
Mar  4 20:21:50 worker kernel: usb 3-3: SerialNumber: 0001
Mar  4 20:21:50 worker kernel: cp210x 3-3:1.0: cp210x converter detected
Mar  4 20:21:50 worker kernel: usb 3-3: cp210x converter now attached to ttyUSB0
Mar  4 20:21:50 worker mtp-probe[25791]: checking bus 3, device 31: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
Mar  4 20:21:50 worker mtp-probe[25791]: bus: 3, device: 31 was not an MTP device

but nothing in minicom. There is a message - "unconnected"
Pins are soldered properly.

Also it is strange, that esptool does not work. It is independent on arduino IDE setting.

$ esptool.py --port=/dev/ttyUSB0 -b 115200 flash_id
esptool.py v2.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

I've got a second Sonoff basic from my coleague (from the same parcel), so I will test it. And I also have Sonoff Touch which I'm planning flash as well.

I had the same problems with flashing one out of two mew sonoffs. One worked with PlatformIO with the other one, after lots of trying and switching cables, i ended up using the esptool.py script.

Double checked the pins and first erased the memory with the script. After that i downloaded the tasmota bin and flashed the Sonoff that way without a problem.

So that might be worth trying for people with the same problems.

But my does not connect at all. I've tested latest (v2.3.1) esptool.py, different baudrates, nothing worked.

It does work when you just power it up and try to look for it using the Itead app?

The timing is not that critical in my case. Push button and hold, connect USB and erase flash. And again; try to reverse tx/rx

mkyral - have you also checked TTL lines are switched to 3.3v ?
Do not push the button, plug adapter into USB port
Any green light on Sonoff ?
Mar 4 20:21:50 worker...bus 3, device 31: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
$ esptool.py --port=/dev/ttyUSB0
Shouldn't that be USB3 not USB0?
Hold button on Sonoff, while down -- plug USB adapter in, wait 2-3 seconds, Sonoff should enter programming mode (led off) then attempt to flash
(edit: sorry old eyes, saved pic and enlarged, connections look good, must have been angle)

@Nroj : yes, I've paired my sonoff with official app and it work.

@Oxyandy :

have you also checked TTL lines is switched to 3.3v ?

Yes, I'm using 3,3V. There are 3,3V and 5V pins.

Do not push the button, plug adapter into USB port
Any green light on Sonoff ?

Yes. Sonoff connects to my wifi - led flash several times and then stays on. I see it in official application.

Mar 4 20:21:50 worker...bus 3, device 31: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
$ esptool.py --port=/dev/ttyUSB0
Shouldn't that be USB3 ?

No. usb3 is port, not tty. I've only one /dev/ttyUSB device. Mostly ttyUSB0, but sometime it changes to ttyUSB1.

Hold button on Sonoff, while down plug USB adapter in wait 2-3 seconds, Sonoff should enter programming mode (led off) then attempt to flash

Yes. I'm doing it in this way. Also I have switch on 3,3V. When I switch it on without button press - green led is blink. When I switch it on with button pressed, led stays off. Then I run fw upload, I see Tx led flashing on TTL, but there is no reply from sonoff. And yes, I've tried switch Rx/Tx, also changed wires. Still can't communicate with sonnof.

(edit: sorry old eyes, saved pic and enlarged, connections look good, must have been angle)

Yes. I'm sure that wiring is correct.

I can buy one more USB-TTL and test serial communication between them.

Yeah wiring is correct, even TX & RX, look right..
From your log above showing connection of device - /var/log/messages
Not a linux user here, but that log said USB3 so that is what ? Confusion for me
So what happens when you specify USB3 instead of USB0 ?
Anyhow do you have a windows machine you can use ?
I have a Firmware flashing front end.. no playing with settings, it wont let you..
happy to upload that for.. is run, if a .bin is in same folder as EXE, it will show in a drop down menu
select the firmware.bin then click button 'Flash'
Newbie proof - if that helps ?
EDIT do you see TX & RX lights flicker on programmer ?

From you log above showing connection of device - /var/log/messages
Not a linux user here, but that log said USB3 so that is what ? Confusion for me
So what happens when you specify USB3 instead of USB0 ?

usb3 is physical USB port on my laptop. If I change USB port, number will change.
But still I will have ttyUSB0 as this is my first serial device. On windows you also have COMx regardless on USB port you use (I think).

Anyway, with wrong ttyUSBx device, esptool fails with really ugly error message. So port is correct.

Edit: lower in log there is a message that usb 3-3 is connected to ttyUSB0:
Mar 4 20:21:50 worker kernel: usb 3-3: cp210x converter now attached to ttyUSB0

Anyhow do you have a windows machine you can use ?
I have a Firmware flashing front end.. no playing with settings, it wont let you..
happy to upload that for.. is run, if a .bin is in same folder as EXE, it will show in a drop down menu
select the firmware.bin then click button 'Flash'
Newbie proof - if that helps ?

Well I have dual boot on my company laptop. Maybe I can try, even I don't use Windows for about 10 year ;-)

Maybe I'm newbie in Sonnof, but not in linux and I'm a programmer with some HW skills.

EDIT do you see TX & RX lights flicker on programmer ?

As I wrote above:
_Then I run fw upload, I see Tx led flashing on TTL, but there is no reply from sonoff._

Rx led is not flashing. Only Tx.

Well this sure is worth a try, no point in banging your head over something simple that 'should work' but isn't - I wont repeat the usage in the email so here is:
Drop these 2 files into a folder, run the EXE, select the firmware to flash
click flash..
Drop me an email @ google's service user oxyandy
Then I'll send you a zip file all of 21Kb
Worth a try ;)

So tested on windows, issue remains. Behaviour still the same - tools are not able to connect to sonoff. Flash failed.

C:\Users\mkyral>esptool.py --port COM9  read_mac
esptool.py v2.3.1
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

C:\Users\mkyral>

So my current status:
I was not able to flash any of my Sonoffs (2x Basic, 1x Touch). Soon I should receive next two Sonoff Basic. I also ordered different USB-UART converter plus standard esp8266 module to test the flash process itself.

Did you already try an external power supply?
Sometimes the USB adapter cannot deliver enough power for the board to program...
Just take the 3.3v from an Arduino or other source and connect ground for both USB adapter and the external PSU.

Not yet.
According to datasheet, the 3.3V output has max current 100mA. And I have only Arduino Nano where is less. I have to find out more powerful 3.3V supply.

Hi
Have a sOnOff Basic R2 V1.0 2017-01-11. Never see this one in previous comments or google search (can find Dual R2 but mine is a Basic one)
I can't go to flash mode (try several flash.cmd, esptool.py....)
Pleas help to put in flash mode
Regards

What worked for me was the following:

Download the nodemcu flasher: https://github.com/nodemcu/nodemcu-flasher
After that, open the program and go to the advanced tab. Set the settings there as told:
115200 baud rate
1 Mb
40 MHz
SPI Method: DOUD
Then go to the config tab and select your bin file. After this, click on the operation tab and select your COM Port and click "Flash". It should work flawlessly.

So I bought AMS1117 3,3V, output current should be up to 500mA. I've connected it to USB mobile charger - 5V, 2,4A max.

imag0029

As you can see on picture, green light is on, Sonoff is connected to my wifi and works with official application.

When I power Sonoff on I can see some garbage on serial console:
obrazek

Then I switch Sonoff to boot mode - green light stays off. But still I got the same error messages as above :-(

Hi again
I spend now days on this new release of sOnOff
It's Ok with a previous release but KO with this NEW one

I can't go into flash mode !

trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
--- or
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

2018-03-10 11 20 09
2018-03-10 11 20 28
Thanks

For me it looks like they changed something, maybe module expects different initial sequence when connecting via serial line. I have no idea, if it is even possible.

Maybe they changed serial port setting. This 8N1 stuff...

mkyral my boards are same date as you - I have nearly 40 of them and no problems - 57600 baud in the message you posted earlier, shows garbled characters have you tried 115200 ?
I am surprised you even got that because esptool.py --port COM9 read_mac - does not even connect
You can not connect to flash if you are using a serial monitor at the same time..
Open your serial monitor set baud to connect to serial at 115200, then power up the sonoff

This garbage is when I start sonoff (connect to external 3.3V). On 115200 is as well, but different.

I tried direct flash, without opening console and still no luck. Switched Tx/Rx - no change:

/home/marian/.arduino15/packages/esp8266/tools/esptool/0.4.9/esptool -vv -cd ck -cb 115200 -cp /dev/ttyUSB0 -ca 0x00000 -cf /tmp/arduino_build_451280/sonoff.ino.bin 
esptool v0.4.9 - (c) 2014 Ch. Klippel <[email protected]>
    setting board to ck
    setting baudrate from 115200 to 115200
    setting port from /dev/ttyUSB0 to /dev/ttyUSB0
    setting address from 0x00000000 to 0x00000000
    espcomm_upload_file
    espcomm_upload_mem
opening port /dev/ttyUSB0 at 115200
    tcgetattr
    tcsetattr
    serial open
opening bootloader
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
resetting board
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
trying to connect
    espcomm_send_command: sending command header
    espcomm_send_command: sending command payload
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

A little bit strange is that I miss some options in command above. E.g. I don't see -mb dout and according to help, default is QIO.

Arduino IDE 1.8.5
obrazek

Board: ESP8266 community 2.3.0 installed

I don't know half those cmd line parameters - I do it direct from the python folder...
(but I have that simple tool I sent you that works flawlessly too)
esptool.py --port COM5 write_flash -fs 1MB -fm dout 0x0 Firmware_to_Flash.bin
So with no serial monitor programs open -- try a direct cmd like
esptool.py --port COM5 read_mac
Do you get a response ? (windows parameters above)
esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 Firmware_to_Flash.bin
Backup existing & label according to number on sticker (locked to each device)
esptool.py --port /dev/ttyUSB0 read_flash 0x0 0x100000 Backup_1M.bin
If you are seeing garbage after turn on of Sonoff via serial connection, you must be connecting somewhere..

Unfortunately nothing works:

[19:11:46 marian@worker ESPEasy_R120]$ esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 ESPEasy_R120_1024.bin
esptool.py v2.2
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

If you are seeing garbage after turn on of Sonoff via serial connection, you must be connecting somewhere..

There is nothing else. I can see Rx led flashing when I'm connecting sonnof to ground. I think it is caused by the external 3.3V power source - USB uart convertor is always on and receive all signals from sonoff from very beginning.

A loopback test will confirm if your usb device is working properly too

So loopback test works only in one direction. One USB-TTL is probably bad.
But I'm still not able to connect to Sonoff. It is possible that the serial line there is also broken. (Maybe I destroyed it by mistake).

I'll wait for two Sonoffs that are on way and will test them with brand new USB-TTL converter to avoid any issue caused by my previous tests.

You soldered header pins ? How about a picture ?

when testing loopback in Putty, connecting RX to TX, type you will see what you type, if yes - disconnect the cable - type again, you will not see anything when you type... This means your device is fine
Another way - http://www.usconverters.com/downloads/support/usb-serial-rs232-loop-back-test.pdf
Get AccessPort137.zip here as mentioned in pdf
http://www.usconverters.com/index.php?main_page=page&id=15&chapter=0

You soldered header pins ? How about a picture ?

m_20180313_143010_91
m_20180313_143117_93

when testing loopback in Putty, connecting RX to TX, type you will see what you type, if yes disconnect the cable type again, you will not see anything when you type... This means your device is fine

Ahaaa. Its that simple. I'm so stupid :-D
Just tested, none of them works properly - I need new one. USB-TTL converter and Sonoff.

SonOff changed something, me thinks. My old SonOffs work great using the standard ribbon cable/ switch fixture. I just tested several old ones using this programming fixture. My old SonOffs are marked "SonOff TM" no version numbers. the Three I just received are marked "SonOff TH_v1.1" just like the picture above. I will send these back or contact vendor through Amazon. That should get their attention. My recommendation is... DON"T BUY ANY MORE until this problem resolved

sparkgap I have flashed over 35 Sonoffs with "Sonoff TH_v1.1" on the board
not a glitch..

Hi
Mine are sOnOff Basric R2 V1 2017-10-1 (see pictures in my previous post)
Same issue can't go into flash mode
So someone manage to flash these ?
Regards

xMadelain what do you mean will not go into flash mode ?
Holding button down, powering Sonoff it will not go into flash mode (no LED)
instead the LED is illuminated ?

I have v1.1 -as above picture - 1 of 3 is flashed without a problem as before --- using win7-flasher-nodmcu custom fw - after a lot of try 2nd flashed. Fortunately finally the 3. is flashed too, but i can not connect to the device anymore. In the second case i have temp removed the capacitor next to the big blue one - i find just this different between my old sonoffs and these new ones - by eye.
In my usb/ttl has two leds for rx/tx. In case I can connect, first both are off. In case of , when i cant connect rx always on.
Any suggestion ?

I haven't been following this thread because I don't use Tasmota.
But, I do have a bunch of Sonoff Switches (SonOff TH_v1.1).  Just to
make sure something hadn't changed I opened one, soldered the header and
flashed a blink sketch from the Arduino IDE.  Works just fine.

Here is the sketch:

/*
   Sonoff Blink sketch.
   This sketch blinks the LED on the Sonoff Switch.

   IDE settings:
     Board: "Generic ESP 8266 Module"
     Flash Mode: "DOUT"
     Flash Size: "1M (no SPIFFS)"
     Debug Port: "Disabled"
     Debug Level: "None"
     IwIP Variant: "v2 Lower Memory"
     Reset Method: "ck"
     Crystal Frequency: "26 MHz"
     Builtin LED: "2"
     Upload Speed: "115200"
     Erase Flash: "Only Sketch"
*/

define LED_PIN 13

void setup() {
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  delay(1000);
  digitalWrite(LED_PIN, LOW);
  delay(1000);
}

Steve Mann
WB9PRU

On 3/14/2018 2:14 AM, W5YAR wrote:
>

SonOff changed something, me thinks. My old SonOffs work great using
the standard ribbon cable/ switch fixture. I just tested several old
ones using this programming fixture. My old SonOffs are marked "SonOff
TM" no version numbers. the Three I just received are marked "SonOff
TH_v1.1" just like the picture above. I will send these back or
contact vendor through Amazon. That should get their attention. My
recommendation is... DON"T BUY ANY MORE until this problem resolved

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-372916020,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHt3IcJ1n9nZENa9_U6i_QI2xCfFCrBoks5teLVcgaJpZM4NhQQ0.

On 3/14/2018 2:14 AM, W5YAR wrote:
>

SonOff changed something, me thinks. My old SonOffs work great using
the standard ribbon cable/ switch fixture. I just tested several old
ones using this programming fixture. My old SonOffs are marked "SonOff
TM" no version numbers. the Three I just received are marked "SonOff
TH_v1.1" just like the picture above. I will send these back or
contact vendor through Amazon. That should get their attention. My
recommendation is... DON"T BUY ANY MORE until this problem resolved

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-372916020,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHt3IcJ1n9nZENa9_U6i_QI2xCfFCrBoks5teLVcgaJpZM4NhQQ0.

Hi,
Based on my discussion with @Oxyandy about 5V vs 3.3V and 5V TTL vs. 3.3V TTL and this video When 3.3v isn't actually 3.3v: USB to Serial adapters, I've bought a new USB-TTL converter. Again based on CP2102 STC chip as my previous. Its from local store, but looks exactly like this. On some pages is also called "6Pin USB 2.0 to TTL UART Module Converter"

Then I tried loopback test - just connect Rx toTx on the converter and try sent some text via putty or linux console. It worked, I was able to see text I've typed on first terminal on the second terminal.

Next I measured Tx/Rx voltage as shown on video - 3.2V and 2.98V. So this convertor uses 3.3V TTL logic. Looks good, it is compatible with Sonoff.

Then I connected Sonoff to external 3.3V source (5V from USB charger stepped down to 3.3V via "AMS1117 3.3V Power Supply Module" and measured Rx/Tx voltage on Sonoff - 3.2V and 3V.

@Oxyandy also suggested to use 5V Vcc on Sonoff, so I've tested, connected Sonoff directly to 5V (only VCC and GND) and measured Rx/Tx voltage on Sonoff. I got 4.89V and 4.6V! So not 3.3V TTL, but probably 5V TTL this time. Is it possible?

Anyway, I've switched back to 3.3V power source, connected Rx/Tx between Sonoff and USB TTL converted, connect together GND pins of converter, Sonoff and external power supply.

Then I switched Sonoff to Flash mode and tested esptool (again).

But now...

$ esptool.py -p /dev/ttyUSB0 read_mac
esptool.py v2.2
Connecting........_____....._
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
MAC: dc:4f:22:2d:42:38
Hard resetting...

Great Now I was able to flash Tasmota and then it successfully connected to my wifi and mqtt:

tele/sonoff/LWT Online
node/indoor_main/hygrometer/0:79/relative-humidity 53.0
stat/sonoff/RESULT {"POWER":"ON"}
stat/sonoff/POWER ON
tele/sonoff/UPTIME {"Time":"2018-03-14T18:02:00","Uptime":"0T00:04:28"}
turris/temperature/board 50
turris/temperature/cpu 78
stat/sonoff/RESULT {"POWER":"OFF"}
stat/sonoff/POWER OFF

So first Sonoff successfully converted :+1:

Hi @Oxyandy
My sOnOff Basic R2 V1.0 is ok with eWeLink

Connect to a USB to TTL Converter Module with Built-in CP2102
No LED illuminated when I set power on

To go into flash mode I press button down and after set 3.3V

Then try from PC several tool (flash.cmd espEasy tools)
Also try to connect to RaspPi 3 an esptool.py

Always the same : Can't connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
or .....----.....
.....

DO some home ever flash a sOnOff Basic R2 ?

Merci

I stand corrected. v1.1 is now working. I used StereRMann's setup shown in a previous post. I still suspect something has changed with v.11 as compared to my previous versions (with no "v" numbers). By changing my Flash Mode from QIO to DOUT , I was able to get all my sketches working on the v.1.1 . I have not tried the DOUT on my original SonOffs to see if it fails, but will try tomorrow. I have no idea what the Flash Mode does, but will read up on it. All I know is that I have been using the defaults for several years with no problem, until v.1.1

Mkyral haha great, I am glad you didn't give up, hope I helped ;)
Now let's hope you can do it again..
Back up your firmware (maybe too late now) but it is such a good practise to do..

@xMadelain read up about testing your "USB to TTL Converter Module with Built-in CP2102"
2 others that could not get a result have now solved their issues
report back results

https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Dual-and-Dual-R2

On Thu, Mar 15, 2018 at 7:18 AM, xMadelain notifications@github.com wrote:

Hi @Oxyandy https://github.com/oxyandy
My sOnOff Basic R2 V1.0 is ok with eWeLink

Connect to a USB to TTL Converter Module with Built-in CP2102
No LED illuminated when I set power on

To go into flash mode I press button down and after set 3.3V

Then try from PC several tool (flash.cmd espEasy tools)
Also try to connect to RaspPi 3 an esptool.py

Always the same : Can't connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
or .....----.....
.....

DO some home ever flash a sOnOff Basic R2 ?

Merci

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-373160348,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ai6cJWEpiEUhYGz73PKGGRUj-v0qjEpEks5teXsGgaJpZM4NhQQ0
.

@xMadelain: based on my experiences from last two weeks

  1. Check that your USB-TTL converter works properly.
  2. Try external 3.3V power source that is able to give more current (200 mA and better)

I jus ordered a 6 pack of sonoff from ebay, "Sonoff ITEAD WiFi Wireless Smart Switch Module Shell ABS Socket for Home DIYR" and i cant seem to get these things into flash mode
i have a arduino mega 2560 set and i went out and got a FTDI Adapter USB Controller as i couldnt get it to flash with the mega 2560

i followed everyones steps and i cant seem to get whats wrong.

i purchased a FTDI adapter as everyone is using this usb adapter, my micro center had one which is a inland FD232 (Not sure if i can post a link here)

anyway, i noticed everyones videos of them flashing the sonoff always has the windows chime turn on when connecting the FTDI, as if a usb device is plugged in. i cannot get this chime to happen at all.

ive flipped the tx and rx wires, im holding down the gpi0 to ground toggle switch and all that, but i cant seem to get this thing going. the usb ftdi makes the sonoff work, meaning im able to power it on and the green light flashes, i then hold down the toggle switch-unplug usb- keep toggle switch held down - replug usb-- sonoff led does not turn on, no usb windows chime occurs.

i tried uploading in arduinio ide bu i get a comm failure.... but theres no com port even recognized becuase the sonoff wont go into flash mode
any sugggestions as to what i am doing wrong?

Hi,
i had the same problem like you guys on a Basic R2.
To prevent some trobble i thougt about to put Tasmota on a ESP-01.
--> Everything works just fine
now i soldered the ESP8266 and the EEPROM from the ESP-01 to the Sonoff.
--> Everything works fine again (so the "original" layout is still the same)
But then i uploaded Tasmota over the same serial-adapter and supprise ...
--> IT WORKS !

so very supprised i soldered the both ICs from the Sonoff on the ESP-01 and now i can upload the code on it, but it isn't able too execute it right (baudt rate is about 74880).

I have no idea why. But i recognized while soldering, that the ESP has some more markings than the other.

img_4216
(the original ESP8266 from the Basic R2 Sonoff)

When you plug the FTDI into a PC, you should hear the "device connected"
chime and see a new COM port on the Device Manager window.  However, I
have a couple of FTDI devices that Windows 10 simply won't recognize.

There are two primary manufacturers of USB to RS-232 chips: Prolific and
FTDI.  FTDI chips are made by Future Technology Devices International
(www.ftdichip.com) and Prolific is a licensed manufacturer. The Prolific
Chipset is one of the most cloned ones around and Prolific implemented a
check in their drivers to cause issues with unauthorized clones - some
work, some don't.  (They do work on LINUX computers because the drivers
are more generic).

The problem is that you generally can't tell before buying if your
adapter contains a counterfeit chip or the real thing from FTDI or
Prolific.  Go with the FTDI chip set if you can.  It won't be the
cheapest adapter you find on eBay.

To determine if your FTDI adapter is working with Windows, open the
Device Manager and expand the Ports (COM and LPT) line.  Plug in the
FTDI adapter.  If you see a yellow exclamation mark on the adapter's
icon, you probably have a bogus Prolific chip.

I have a few Adafruit 954 usb-to-ttl serial cables that work perfectly,
but they supply 5-Volts on the red wire.
(ttps://www.amazon.com/gp/product/B00DJUHGHI/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1).

I also have some 3.3-volt FTDI adapters from Sparkfun
(https://www.sparkfun.com/products/13263)

Both of these use the FTDI chips.

Hope this helps,
Steve Mann

On 3/15/2018 5:32 PM, bigvic9o wrote:
>

I jus ordered a 6 pack of sonoff from ebay, "Sonoff ITEAD WiFi
Wireless Smart Switch Module Shell ABS Socket for Home DIYR" and i
cant seem to get these things into flash mode
i have a arduino mega 2560 set and i went out and got a FTDI Adapter
USB Controller as i couldnt get it to flash with the mega 2560

i followed everyones steps and i cant seem to get whats wrong.

i purchased a FTDI adapter as everyone is using this usb adapter, my
micro center had one which is a inland FD232 (Not sure if i can post a
link here)

anyway, i noticed everyones videos of them flashing the sonoff always
has the windows chime turn on when connecting the FTDI, as if a usb
device is plugged in. i cannot get this chime to happen at all.

ive flipped the tx and rx wires, im holding down the gpi0 to ground
toggle switch and all that, but i cant seem to get this thing going.
the usb ftdi makes the sonoff work, meaning im able to power it on and
the green light flashes, i then hold down the toggle switch-unplug
usb- keep toggle switch held down - replug usb-- sonoff led does not
turn on, no usb windows chime occurs.

i tried uploading in arduinio ide bu i get a comm failure.... but
theres no com port even recognized becuase the sonoff wont go into
flash mode
any sugggestions as to what i am doing wrong?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-373529602,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHt3IYizTYmMwdWZLClPx1g6ayMFyBqcks5tet3agaJpZM4NhQQ0.

@mkyral
Hi
Thanks.
So i buy a ywRobot external module. It delivers a 3.3v and 1a to sOnOff
But still can't flash my sOnOffBasic R2V1.0 (can't connect with several tools)
I've read previous post from @Viper-Gtr
Don't you think that sOnOff change something on R2 ?

DO someone manage to flash a R2 ?

Merci

Hi,
So I've bought another serial adapter
https://www.amazon.fr/gp/product/B01C2P9GD2/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1
COM4, Voltage are Ok
But still same issue
DOUT, 26M, 26.7Mhz, 16Mbit
T:\sOnOff\flash_download_tools_v3.6.3_0\FLASH_DOWNLOAD_TOOLS_V3.6.3\ESPFlashDownloadTool_v3.6.3.exe:96: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
('self.chip: ', 'ESP8266')
RF option applied...
test offset : 0 0x0

case ok

CONNECT BAUD: 115200

....._____....._____....._____....._____....._____....._____....._____....._____....._____....._____[2018-03-20 20:25:32,443][ESP8266Loader_spi[1]][espDownloader.pyo][line:351][ERROR]: Chip sync error: Failed to connect to ESP8266: Timed out waiting for packet header
Do some one really manage to flas a sOnOff Basic R2 V1.0 (see @Viper-Gtr post)?

Hi everybody,

I have about the same issue: I can't enter flash mode, but the funny thing it that I succeed it some months ago with the same sonoff basic. I just want to flash a more recent firmware, but now it fail to connect. I use the same cp102 TTL (that works on others sonoff few days ago). I'm not sure about my usb hub so I use an ywRobot to deliver more current. I redo the welds, because I'm not sure about them. It does not change anything

Does the sonoff green led should turn on or blink when connected to 3.3v ? In my case, I see nothing.
The sonoff button is not easy to handle, perhaps there is a bad electric contact. I hear the click when I press, but not always when I release it. Is it possible to simulate it elsewhere on the board ?

Hi
+1
Investissement tried several serial adapter, external power supply, several flash tools on several sOnOff basic R2 v1.0 (I have only this model !)
I never manage to enter flash mode

Do someone success flashing this version ?

Le 21 mars 2018 à 10:24, rafal98 notifications@github.com a écrit :

Hi everybody,

I have about the same issue: I can't enter flash mode, but the funny thing it that I succeed it some months ago with the same sonoff basic. I just want to flash a more recent firmware, but now it fail to connect. I use the same cp102 TTL (that works on others sonoff few days ago). I'm not sure about my usb hub so I use an ywRobot to deliver more current. I redo the welds, because I'm not sure about them. It does not change anything

Does the sonoff green led should turn on or blink when connected to 3.3v ? In my case, I see nothing.
The sonoff button is not easy to handle, perhaps there is a bad electric contact. I hear the click when I press, but not always when I release it. Is it possible to simulate it elsewhere on the board ?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I redo again the welds, connect on motherboard 2.0 usb directly instead of USB3.0 powered USB hub, then after several tries, it works ! Now I can do OTA flash so I'm happy :-)

I was facing the same issue on mine. I had one working flawlessly, 2 (same batch), no luck.
After trying multiple things I got it working using a similar method I use for flashing my standalone ESP's.

  • Use an external 3.3v power source
  • Connect the grounds of the external power source and the serial adapter
  • Use a bi-directional bridge (5v-3.3v) to translate the RX-TX signal from the adapter to the sonoff (something like THIS) and keep the adapter in 5V

Setup:
img_20180330_124651
(Main breadboard line is powered on the right by 3.3v power supply on the right).

If that still hadn't worked, my next step would have been to put a capacitor between + and - (100uF)

i cant put my sonoff t1 r2 europe version in developer mode allready flashed OTA but stop conecting to network and want to flash it again no luck putting in flash mode. CAn anyone help? im doint the right sequence!

Hi, I though I can solve this problem and hope it effect to all of you too.
For access to flash mode in latest version of sonoff (Sonoff TH_V1.1 2017-5-5). Should following this step:

  1. Pressing the black button
  2. Connecting the USB while pressing the button (LED without blinking)
  3. Still pressing the button for 10 sec then unpress black button
  4. Upload! and enjoy

My configure as below:
Generic ESP8266 Module (version 2.3.0)
Flash mode : DOUT
Flash frequency : 40Mhz
CPU : 80Mhz
Flash size : 1M (64K SPIFFS)
Debug port : disable
Debug level : None
Reset method : ck
Upload speed : 115200
Port : /dev/ttyUSB0

Hi. the above worked for me (Sonoff TH_V1.1 2017-5-5 / Win10).
...but:

  • Used external Power source
  • Got a new serial Interface/Programmer (USB to TTL; HW-597)
  • Used original Microsoft OTA-Driver

thanks.

after 4 hours of struggling, web searching and trying everything... IT WORKS.
I noticed that Sonoff Basic (TH_V1.1 2017-5-5) is very sensitive for voltage drop.

My first setup looks like this:
iMac -> USB extension cord -> USB to TTL -> breadboard -> Sonoff
With this setup I was always finished with:

opening bootloader resetting board trying to connect espcomm_send_command: sending command header espcomm_send_command: sending command payload trying to connect ... trying to connect espcomm_send_command: sending command header espcomm_send_command: sending command payload warning: espcomm_sync failed error: espcomm_open failed error: espcomm_upload_mem failed error: espcomm_upload_mem failed

Then I was pissed off for my breadboard (cables jumped out from it), I switched to:
iMac -> USB extension cord -> USB to TTL -> Sonoff
and surprisingly the flashing process starts, but always ends in about 10-15%.
So I decided to remove my USB extension cord and my setup looks like:
iMac -> USB to TTL -> Sonoff
And it worked at first time!

Some details:
USB to TTL - CH340G (HW-597)
Drivers - https://github.com/xvoland/My-Arduino-Config-Files
IDE - Arduino IDE
IDE Board configuration - Generic ESP8266 Module (version 2.4.1) with recommended settings
Flashing - I was holding up black button until esptool starts

Hi, hand the same problem:

after flashing (no errors), the SonOff went "dark" with no sign of activity and no green led.
Sonoff basic: v1.1 manufactured on 2017-5-5

But with changing some parameters on arduino IDE (see img) i was able to flash it.
esp sonoff
EDIT: i used a generic FTDI-232 board for the connection

I was unable to get the USBASP V2 FTDI device to work on windows but was able to flash Tasmota directly with a Raspberry Pi 3. I roughly followed the instructions here https://blog.3d-logic.com/2017/12/01/using-raspberry-pi-to-flash-esp8266/

Using Pin 1 for 3.3v, Pin 6 for GND, Pins 8 & 10 for Tx & Rx. When you plug in Pin 1 to the 3.3v input pin on the Sonoff, it will cause the Raspi to reboot. You'll need to connect everything, hold the Sonoff button, then plug in the Raspi.

I did compile Tasmota in the Arduino IDE, but wasn't able to get that to work directly. I used ESPTOOL to flash and this worked well. Note - On the Raspberry Pi 3 you should use /dev/ttyS0 by default - on other non-bluetooth models, probably need to use /dev/ttyAMA0. I could not test with GNU Screen or Minicom, but Esptool just worked.

I too had issues with flashing the sonoff and I think it was partly because of not having the correct settings. I used the following settings from the above posts, flashed the blink program and got it working.

/*
IDE settings:
Board: "Generic ESP 8266 Module"
Flash Mode: "DOUT"
Flash Size: "1M (no SPIFFS)"
Debug Port: "Disabled"
Debug Level: "None"
IwIP Variant: "v2 Lower Memory"
Reset Method: "ck"
Crystal Frequency: "26 MHz"
Builtin LED: "2"
Upload Speed: "115200"
Erase Flash: "Only Sketch"
*/

Connectivity:
Sonoff <-> FTDI <-> Laptop's USB (no other converters)

Other steps:

  • ensure you hear a click when you press or release the button.
  • hold the button for a few seconds as suggested in the above posts

Hi, I can't seem to find a solution to this problem, I see the sonoff basic pin holes are blocked, but I managed to connect pins from the back and flashed 3 sonoffs successfully. I tried flashing three more but after successfully flashing, the other sonoffs do not broadcast the sonoff ssid, rather what they show is the ITEAD ssid requiring some password, I tried reflashing to no avail, is there a solution to this?

espgenericsetup
I got mine to work; has to over-write the WiFi settings

I also have the exact same Sonoff basic as the picture in first post, excluding the hardware mod between D5 and C10. I bought 5 from Amazon. They are all exactly the same with version (SonOff TH_v1.1 2017-5-5 1741) I cannot get it to flash on any of them. I have tried on Windows, MacOS, Raspberry Pi with Arduino UNO, 2 different USB TLL converters. I have tried Arduino IDE, esptool, PlatformIO. Nothing works.

@sj-louw
SonOff TH_v1.1 2017-5-5 - I have plenty - over 40 no problem flashing, have you flashed previously ?
Used esptool.py ?

@Oxyandy I have tried with esptool.py, yes, on MacOS, Windows and Linux (Raspberry Pi). Is it possible to explain your exact flashing setup? Specifically the TTL adapter you are using, the software you are using to flash, and the software version. If you are using esptool.py, what are the exact parameters you are using? Is it also possible to explain the exact pinout between your TTL adapter and the SonOff? Maybe pictures if you have?

The version of the boards that you have, is it the same as in the first post, with or without the hardware mod (Capacitor between D5 and D10)?

I have previously flashed raw ESP chips (ESP-12F), but it always seems very much touch and go, in terms of sometimes it works other times not.

It seems that the reason for these boards to not be able to enter flash mode with the normal button press technique, is that it is the same board as what the RF version use, excluding the actual RF module. Furthermore, the be able to get these boards into flash mode, or the RF boards, someone has figured out with a good explanation here: https://piandmore.wordpress.com/2017/12/16/hacking-the-sonoff-rf/

@sj-louw
So you are able to flash now ?
Interesting, that article simply suggests that the button is only momentary

  • not holding GPIO0 to GND when pressed...

I'll keep this in mind, maybe helps others

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

Thanks to whhsw the reverse of RX / TX has solved the problem with PL2303 and Sonoff RF Bridge, flashing via Easy flasher.

My only success was to use a raspberry pi now. I was able to flash instantly, where all other methods failed. I had the same issue with shelly 1 now, so i think it maybe was the 3.3v power of my TTL adapter...

So, i had such a problem. I had bougt 12 sonoff basic modules. And i had flashed only 7 from them. I tried all mentioned above.... But the problem was in soldering and quality of connectors between USB-TTL (CH340) and sonoff. Only when i soldered wires from programmer directly in board (rx, tx, vcc, gnd), all worked good! So try not to use connectors between sonoff and USB-TTL converter.

That's interesting! Lately I'm only holding a presoldered jig to the boards and works every time. Only manual pressure and no soldering. This is especially handy with the T1 Sonoffs. The 232 converter signal levels should operate at 3.3V, even it is a jumper for this on the FTDI boards double check it

That's interesting! Lately I'm only holding a presoldered jig to the boards and works every time. Only manual pressure and no soldering. This is especially handy with the T1 Sonoffs. The 232 converter signal levels should operate at 3.3V, even it is a jumper for this on the FTDI boards double check it

It happened only with 5 sonoffs, other 7 works good without soldering. May be there is quality issue on the sonoff board, i assume some problems with soldering of esp8285 and other components. Later on, when more sonoffs arrive, i'll try to reseat chip on its place.

Great, please keep us posted! I am keen to see the new Sonoffs DIY version. I've seen the box,I'm not a fan of it!

Sent from my Android phone with GMX Mail. Please excuse my brevity.On 5/9/19, 10:09 e8geny notifications@github.com wrote:

That's interesting! Lately I'm only holding a presoldered jig to the boards and works every time. Only manual pressure and no soldering. This is especially handy with the T1 Sonoffs. The 232 converter signal levels should operate at 3.3V, even it is a jumper for this on the FTDI boards double check it

It happened only with 5 sonoffs, other 7 works good without soldering. May be there is quality issue on the sonoff board, i assume some problems with soldering of esp8285 and other components. Later on, when more sonoffs arrive, i'll try to reseat chip on its place.

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-490796772",
"url": "https://github.com/arendst/Sonoff-Tasmota/issues/463#issuecomment-490796772",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]

It seems that the reason for these boards to not be able to enter flash mode with the normal button press technique, is that it is the same board as what the RF version use, excluding the actual RF module. Furthermore, the be able to get these boards into flash mode, or the RF boards, someone has figured out with a good explanation here: https://piandmore.wordpress.com/2017/12/16/hacking-the-sonoff-rf/

You saved the day! Thanks!

just flashed two units..only way was not cross the RX/TX and you've to keep holding the button for the whole time..

Same problem hehe. I started to think my Sonoff was dead since the green led was not lighting anymore. Then I made this:

  • Disconnect Vcc
  • Disconnected Gnd
  • Press the Button
  • Reconnect Gnd
  • Relead the Buttoon
  • Connect to VCC

And then sundelly the green led starts blinking again! WTF!

Success!!

Finally it worked.
Let me share my experience.

Basically I followed this reference:
https://medium.com/@jeffreyroshan/flashing-a-custom-firmware-to-sonoff-wifi-switch-with-arduino-ide-402e5a2f77b

I was thinking that the flashing process the Sonoff should be blinking the green led. It wont!
Maybe some steps aren't required but I will describe what worked for me:

1 - Invert Rx and Tx so Rx of FTTD is conected to SONOFF's Tx and Tx of FTTD is conected to SONOFF's Rx.

2 - I changed the Board to ESP8285 since it read my card and told me it was a ESP8285 and not a ESP8266.

3 - Flashing Procedure:

Make sure FTTD's Vcc is connected directly to SONOFF's Vcc. Some people put an adicional push button but I connected it directly.

3.1 - Disconnect Usb from Computer
3.2 - Disconnect SONOFF's Gnd (Don't Connect it to to any wire)
3.3 - Press and Release the Black Button once
3.4 - Press the Black Button and Hold it Down
3.5 - Now Connect SONOFF's Gnd to Gnd Wire that leads to FTTD's Gnd
3.6 - Connect the Usb to Computer
3.7 - Continue Holding the Black Button Down
3.8 - Count 12 seconds
3.9 - Release the black button up

In this moment I thought that something should happen but nothing happens. The sonoff don't give any clue that it is in the flashing mode. The green LED doesn'k blink or anything like. You just have to trust it is in flashing mode.

3.9 - Hit Upload button at Arduino IDE
3.10 - It should Connect and Write the Program to the SONOFF

4 - After that disconnect USB.

5 - Connect it again and go to Serial Monitor. If you are using the Simple "Simple Wifi Switch" program it will show you its IP

Put its IP on the browser and press On/Off and the LED should light on/off acording to your commands.

I hope it helps

I fixed this problem by throwing my Sonoff in the trash!
Problem solved.

1 - Invert Rx and Tx so Rx of FTTD is conected to SONOFF's Tx and Tx of FTTD is conected to SONOFF's Rx.

This is what worked for me.

I did try, but nope...nothing...

I did swap the wires RX/TX and i hold the flash button pressed before connecting to energy.

the new issue is that im stuck on Erasing flash (this may take a while)...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vujagig picture Vujagig  Â·  3Comments

luisfpinto picture luisfpinto  Â·  3Comments

belidzs picture belidzs  Â·  3Comments

grizewald picture grizewald  Â·  3Comments

esp32x picture esp32x  Â·  3Comments