Sonoff Basic, No Compile Errors, No flash Errors, No Joy!

610 views
Skip to first unread message

James Sinkiewicz

unread,
Aug 10, 2017, 11:48:59 PM8/10/17
to SonoffUsers
I have a new Sonoff basic unit. I followed BRUH video https://www.youtube.com/watch?v=-JxPWA-qxAk including
PubSubClient v 2.6.0 library installed
ArduinoJSON v 5.11.1 library installed
PubSubClient.h file modified to mqtt max packet size to 512

Downloaded latest zip of tasmota
Modified user_config.h to local Wifi and MQTT settings
Generic ESP8266 board, (1Mk 64k SPIFFS)

After reading some problems, I even changed the #define CFG_HOLDER to 00000001 

I used a external DC power supply to give the SONOFF power and grounded the power supply, Sonoff and USB converter grounds together. 

Compiled sketch no errors
Flashed no errors

Nothing. No wifi, no IP, nothing!
Hours later...no days later, I am here looking for help.




Scott D

unread,
Aug 11, 2017, 3:24:18 PM8/11/17
to SonoffUsers
A few questions, first, to make sure I understand your issue.  Do I understand that:
  • You used the Arduino IDE to build and upload your code,
  • The build/upload process seems to complete just fine with no reported errors (you can even successfully upload the entire code build to the Sonoff),
  • You then reset (or cycle power) your Sonoff,
  • And after that reset Sonoff seems to be dead - no Wifi connection, no flash on the green LED at startup, nothing?
If I have all that right, did you verify that the programming mode in the Arduino IDE is set to DOUT - not DIO?  The Tasmota code base was recently modified to require this as (apparently?) Sonoff made recent changes to their design.  I found myself in the situation I described above a few days ago, and fixed my problem by setting the programming mode to DOUT.

Ryan Tregea

unread,
Aug 11, 2017, 11:20:59 PM8/11/17
to SonoffUsers
I'm in the same boat as the poster, Thanks Scott for the suggestion, No such luck on mine,
Mine was the exact same as James' problem, All flashed beautifully, But nothing upon restarting

I set it to DOUT and I got the ESP messages that usually means I messed up the wiring
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

I switched the TX and RX pins in case, But same exact error... Not sure what to do after this.

Any help would be greatly appreciated

Ryan Tregea

unread,
Aug 12, 2017, 1:43:16 AM8/12/17
to SonoffUsers
Further to this... I had the same problems flashing another esp sketch, so i switched it to DOUT instead of DIO... and on the 3rd attempt it flashed..
This other brand sketch had a bunch of issues though... Couldn't get it to read my MQTT etc... 
So went back to this firmware... Flashed again and again... eventually one of them took... and then boom looks like it's working, Having troubles with Wifi... But at least i can see serial messages... now I can do the rest.

James Sinkiewicz

unread,
Aug 12, 2017, 12:45:35 PM8/12/17
to SonoffUsers
Scott,

First off, I can't tell you how happy I am that you replied! 

I did everything as you mentioned. I thought I would try to go to the least common denominator first in order to figure out what was going on. I used a DC power supply to supply good known voltage to the Sonoff and I used an Arduino clone with reset set to ground as my USB-UART converter. I have uploaded a picture of the setup. You can see from the Arduino IDE image that the blink example program loaded the firmware just fine with no errors. TX/RX lights flashed, everything all good. Afterward, I pressed the reset button on the Sonoff (although I have seen videos of this same upload and the reset was not required to get the blink). I get nothing. I get the same result when I try ESPEasy, Tasmota, other examples. It seems to work, but doesn't.

Thanks again for your reply and advice. Looking forward to finding the problem and moving on to flashing my Sonoff's with custom firmware.


Scott D

unread,
Aug 12, 2017, 3:54:27 PM8/12/17
to SonoffUsers
James, I'm at a loss now, unfortunately.  Just in case, I double-checked the GPIO you're using to blink the green LED and... yeah... that ought to work!

I don't think this is relevant any longer, but just in case it may be, I'll tell my story anyway.  I purchase three Sonoff basics;all three worked as advertised when they arrived.  When I tried to flash Tasmota one of them worked fine but the other two fell into the state your is in - the flash operation seemed to go just fine, but there was no sign of life afterward.  I spent a couple days poking around on them with no luck until others started to report that new Sonoffs seemed to be susceptible to doing exactly what I saw.  Apparently some new Sonoffs use the ESP8285 (ESP8266+internal flash) and they require the use of the DOUT programming mode.  Even though my Sonoffs didn't have 8285's in them, I tried DOUT anyway and both immediately flashed - and have been working fine ever since.  I'm not sure why.

I wish I were of more help, but I don't see what you're missing.  Wild guess, and nothing more, but do you happen to have a simple FTDI USB/Serial converter lying around to try?  I wonder if maybe the 8266 has an issue with the use of the Arduino setup?  

Ryan, I'm happy to hear you have it going, but I have to admit that I'm nervous reading about the instability you seem to be encountering.  What happens if you try to force the firmware to clear and reload its config space (either "restart 1" in the console or simply hold down the Sonoff button for > 4 seconds)?  I wonder if maybe your config space got corrupted during all your trials?  Note that this will revert all settings back to whatever you defined in user_config.h.

James Sinkiewicz

unread,
Aug 12, 2017, 8:29:35 PM8/12/17
to SonoffUsers
Scott, you're a gentleman for helping out. You should know that I got my Sonoff flashed with your kind assistance. I did indeed read that Tasmota was now requiring DOUT instead of DIO, but thought that was a Tasmota programming decision, not a new Sonoff requirement and since I was just trying to get the Blink program working, I did not change the flash mode. But with your suggestions, I said hey, what the heck, the thing was bricked anyway; so I changed my Arduino IDE tools setting to DOUT and let her rip with the Blink example program again and it Blinks! Keep in mind that my Sonoff's, like yours, use the ESP8266 chip not the ESP8285.

Now I am off to try on some Tasmota!

Thank you again! 
 

Scott D

unread,
Aug 12, 2017, 10:42:30 PM8/12/17
to SonoffUsers
That's great!

You wrote, "I said hey, what the heck, the thing was bricked anyway".  That's exactly what I told myself when I got to that point.  :)

aardvarkk

unread,
Mar 11, 2018, 6:44:57 PM3/11/18
to SonoffUsers
Took me forever to get my Sonoff Basic going, and the big stumbling block I was running into was the DOUT flash mode. Without setting the mode to DOUT, nothing worked! After setting it to DOUT, I was able to get a blink program going. Thanks very much to everybody in this thread!
Reply all
Reply to author
Forward
0 new messages