[OBSOLETE] Sonoff, Sonoff TH, S20, Dual, 4CH, POW, & Touch Device Handler & SmartApp ($5 & $10 Smart Switches)

Give it a shot…

https://drive.google.com/file/d/1xVVnOzHYUaFLVEQQzFkQ3lABmcd8-YoY/view?usp=sharing

Yeah, like I said I can flash this firmware successfully, but it doesn’t do anything. I think people are assuming I’m having problems flashing because I mentioned that the “alternate/new” flash method doesn’t work for me. The original flash method works fine. My problem is not success or fail of the flashing procedure. This particular firmware (after being flashed successfully onto the sonoff basics), does NOTHING. Tasmota and ESPEasy work 100%. I just had to update the wifi settings for Tasmota to work 100%. Now the only firmware I’ve tried that doesn’t function is this one. The crap thing is that this is the firmware I actually want to use. I’ve used 4 different flashing methods now (esptool.exe, flashesp8266.exe, espflashdownloadtool_v3.6.4.exe, and esp8266flasher.exe [nodemcu both 64 and 32 bit]).

  • esptool.exe works. I can flash any firmware I want with it successfully.
  • flashesp8266.exe (this is the updated espeasy flasher) works. I can flash any firmware I want with it successfully.
  • espflashdownloadtool_v3.6.4.exe (this was suggested by Ray and is from expressif) works. I can flash any firmware I want with it successfully. [BTW, this one requires I select DOUT and works 100% so we can probably put the DOUT theory to bed.]
  • esp8266flasher.exe (nodemcu) times out during attempting to WRITE the flash. Communicates with the switch successfully but only fails with writes.

Yes, I 100% sure they are Sonoff Basics. The board says
“Sonoff Basic R2”
“V1.0”
“2017-10-11”
“1 750”
in the top right corner.

The only problem I have is that this firmware doesn’t function after being successfully flashed onto my switches. I get no output on the serial monitor with this firmware at any baudrate I get read out regarding wifi on both Tasmota and ESPEasy. The onboard LED does not illuminate at all. I don’t know how to debug this other than to compare this firmware source and tasmota line by line and hope I can find the bits that make this tasmota work but this one useless.

What does Tasmota display on the information screen at the bottom about chip ID, flash size, etc. My basics don’t show at at the top of the board, trying to see what’s different. If you can flash this firmware fine it seems like something with the EEPROM settings might be getting stuck in the loop. It’s difficult to catch this firmware on the debug as it only spits out before the wifi connect is done so you have to be quick.

I don’t know what to tell you. I used the ESP8266Flasher.exe method when I had the exact same problem that you’re having and it worked fine. You leave everything at defaults except for DOUT, correct?

When you say you “can flash any firmware you want sucessfully” do you mean you can actually get the switch to boot and work after flashing or that the flash process completes. Because the flash process saying it’s done doesn’t mean that it actually worked at all. I ran into this problem several times.

When I say I can flash any firmware I want successfully. I mean that the flash process succeeds. The only firmware I have problems with “functioning” after a successful flash is this firmware.
These are the settings I used:


(forgive the screenshot of the jpg I saved. i didnt realize you could just paste screenshots directly into the reply until just now. i was about to upload this to imgur and link it.)
I based these on the screenshot from the post you linked to. I believe 8Mbit flash size is a non-default setting as well as DOUT. Anyway. Those settings work for other firmwares as well. I’m just perplexed how this could be a flashing problem if the settings I’m using (which are hardware dependent) will succeed in flashing other firmwares…and this one. This particular tool is kinda vague upon completion but others are crystal clear telling you “FAILED” or “SUCCESSFUL” when they finish. Anyway, I think the green FINISH in the bottom left and the full progress bar in this tool means it finished flashing successfully.

I meant silkscreened on the PCB when i was saying thats what the board says in the top right corner. I’ll have to reflash tasmota on one to get you the other info. Though I have ESPEasy 2.0 on one right now I’ll check if that info displays on there…

Yep, I was meaning silkscreened as well. Mine have the Sonoff TH_V1.1 2017-5-5 on them.

I believe your settings are wrong on the speeds as these are what I use in Arduino IDE.flash_Settings

Your processor is at the wrong speed and you have the wrong flash size selected. Don’t know if those will affect it but I’m pretty sure they do.

@erocm1231 Wonder whether the 4CH switch firmware and the two corresponding DHs, 4CH DH and child device DH, could be modified to support the Tuya wifi (2.4G) 3-gang wall switch running on SmartLife app. There is also another brand of wifi (2.4G) 3-gang wall switch that runs on eWeLink app.

Your settings are the same as I use with Arduino as well as with Atom. I only used the settings in my screenshot in that program based on the settings recommended in that thread linked by Ray. Weird as it is, it doesn’t seem to matter that it’s 26 instead of 40 and 8MB. That tool doesn’t even offer 1MB flash size as an option… BTW, here is a direct link to the post Ray directed me to try earlier.
https://www.letscontrolit.com/forum/viewtopic.php?p=18240&sid=9d2e482f61716ae12f83c0af584ff67d#p18240

Your memory size is right, as the Sonoff Basic has a 1 megabyte/8megabit memory chip. I guess your switches and/or flashing setup just doesn’t allow this firmware to be used. I do believe there’s a project on GitHub where someone was developing a ST handler to connect with Tasmota.

LOL, my bad I need to focus on one thing at a time. I didn’t notice it clearly says Mbit.

Anyway, I have news. I revisited the NodeMCU flasher with the last of my untouched switches. Attempted a flash with the settings from the first post. No luck. Then recalling you mentioned to try lower baud rate, I worked my way backward from 115200. They all failed. Same timeout at some random point while writing. But…lo and behold when I got to 19200 it succeeded! I then thought about how you and I discussed that this firmware communicates at 19200 rather than 115200 like the others. Coincidence? Seems crazy to me.

So, I put power to it, and it booted up and it gave me the AP. Firmware functioning, finally! I’ll try a couple more switches when I have some time this evening and make sure it wasn’t a fluke. I don’t want to jinx it but I think It might be figured out.

Awesome. Yeah it is just a coincidence as the serial port speed can be whatever the firmware developer wants. It is simply a line of code that says Serial.begin(115200);

Glad you got it going.

Bummer. That one switch seems to be the only one that will succeed flashing via NodeMCU. I just tried 3 more and all of them failed with the same settings. I’m disgusted with this.

Do you have one of these switches on hand or have some internal pics of it? I’ve found some other reports showing there is another microcontroller attached to the GPIO pins to break out to the relays.

I just tried one for kicks… Held down the button, plugged in USB, let go, and hit flash. It went right on through and I could see the new firmware. Not sure what is odd about your setup, try another USB cable?
nodemcu_snf_basic

I got one but in use via IFTTT to virtual switch on ST. Need a couple more. So trying to look for a ‘smarter’ solution for ST integration like the Sonoff swtiches. Will take a photo of the board when I am free.

I’ve tried other cables in the past but as a last ditch effort I decided to try a USB 2.0 port instead of the 3.0 ports I had been using. I’ve now flashed 3 successfully with those settings on a USB 2.0 port. Sigh. I ignored the USB port itself because I had no trouble flashing other firmware. It looks like my issues finally, truly are resolved. Thanks for hanging in there with me digiblur.

1 Like

YESS!!! Glad to see you got it figured out and took the effort to come share with others what the issue was.

Side note… the modified MQTT modified firmware image I posted is some how working fine but some how showing AP SSIDs like it isn’t setup. Super weird and shouldn’t be doing that. I’m wonder if it is flipping back and forth and I don’t know it. I didn’t mess with any of that code though which is the odd thing.

1 Like

Would not work with my older “fake” FTDI adapter. Worked immediately with a new 7.99 Inland FTDI I purchased at MicroCenter. Was nice to see it flash after tons of time wasted with the old FTDI.
Thanks for the work!