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

Can I still do the flashing if I don’t have male pin headers available? I do have some jumper wires from a kit.

I just copied and pasted from github and did not get that error. Make sure you are grabbing the entire file. Using the “RAW” button in github and doing a select all makes it much easier.

Did anyone got the Sonoff Touch to work.
I have two units, one I have flashed and the other I kept as is.
The flashed unit (flashing was successful) would not broadcast a wifi hotspot, the capacitive touch does not work, the unit does nothing.
The unit which was not modified is working by touching the capacitive sensor. If I take the non-flashed wifi module and install it to the unit that was flashed, I can switch it manually (just to check that the relay switching part is working).
I would appreciate any help.

Thanks,its working now !

I just did a little modification to a Sonoff TH, added GPIO-4 to the 2.5mm TRRS jack (paths were there just disconnected) by added a 0ohm surface mount to the pad, disconnected the 3v3 sleeve and found 5v on the board and jumped to sleeve.

So I can use an HC-04 Sonic Range Finder. Works well in Esp Easy, my short fall is programming.

Eric does your firmware get me to PIN 4 so I can adjust device manager to pickup PIN 4 for a value or I’m I beat?

Thanks for your suggestion, if I disconnect the light switch it still inverts the relay on my sonoff when I use my wc light. My wc light is a pullcord so im guessing the ark on the contact inside to pullcord may interfere with my sonoff relay.

The sonoff stays on online and only the relay inverts when the pullcord is used.

Would you still suggest a capacitor across the mains feeding my sonoff? If so, do you have any suggestions on which one to use?

@jakclark That is strange! So with nothing between J3 and ground you still find that changing another light switch on the circuit forces your Sonoff to switch state? (and the Sonoff does not restart?)

The capacitor should go on the DC (3v3) side to smooth the ESP voltage, not on the mains side. However I would start by tieing the J3 to 3V3 via a 10k resistor and see if that stops the state switch - its an easier thing to test and is more likely to work.

Before you even try this, it might be worth putting the Sonof on another circuit, such as a mains socket in the same room (or on the same RCD) to see if you get the same effect there. If you do then I suspect something dodgy is going on with your .Sonoff.

Hi Dorigal. I know you said your were going to try the way i did my touch to get it working, but did you set NODEMCUFlasher to these setting, 115200 baud, 1Mbyte Flash, 40Mhz Flash speed and SPI Mode DOUT.
I think the main setting is the spi mode to dout as the touch is not esp 8266 based but esp8285 based.
Mine is working fine now apart from the glass keeps falling of the front (build quality is terrible).

Gary

1 Like

I agree, they are built terribly. @dorigal let us know if that works.

I’ve plugged it into an outlet in the same room but my ground floor lighting is on its own RCD ( my outlets are on their own separate rcd). When I do this I do not get any interference with the state chage of my sonoff.

Where is J3 on the sonoff? (I’m assuming the pin that I use to short to ground when the switch is used)

Yes, I meant the pins you short to turn on the device (one pin to the ESP8266 pin and one pin to ground). Im very surprised that it still behaves strangely when there is nothing attached to those pins… Did you try the resistor between 3V3 and the ESP8266 pin (J3)?

FYI You can work out which of the J3 pins is ground and which goes to the ESP8266 by either looking at the trace or using a multimeter.

Gary and Eric, It worked. I guess for some reason the first time I tried flashing it with NODEMCUFlasher, I did not put great attention to setting the SPI Mode to DOUT (when I started the program it already had the last settlings that I used).
Once changed to DOUT, it worked!
Thank you both for the guidance.
Dori

1 Like

Hi Eric,

Thanks for all the effort and information you are sharing with the community.
I need some help.
I have try to flash my first sonoff switch to be use with Smartthings. I can get to the point the green LED on the sonoff goes in to rapidly flashing I then send the command on COM3 and receive this error. Do you know how I can solve this problem?

Error message:

esptool v0.4.6 - © 2014 Ch. Klippel ck@atelier-klippel.de
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from COM1 to COM3
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
stat Sonoff.ino.generic.bin success
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
read 0, requested 1
trying to connect

And this proces repeats a few time.

Thanks

Edward

I’m glad you got it working dori.

Gary

I have a few solutions for some of the issues brought up here.

  1. Unable to flash the board and getting a repetitive “trying to connect” message.

Solution = Flip your TX and RX. I was a bit confused by the pinout in the first post and had this very same issue. Once i flipped them, I was able to flash the image.

  1. Sonoff not broadcasting SSID after flashing.

Solution = Reset the WiFi on the Sonoff before and if needed after flashing the device. You do this by holding down the Sonoff button for about 20 seconds. You will know it reset when the light flashes 5 times. Also, I have noticed that when I flashed new out of the box Sonoffs, I did not need to reset WiFi on the device. It broadcasted the SSID right away while connected via the FTDI. Only devices I previously connected to EweLink had to be reset.

  1. FTDI to sonoff flashing cable

Solution = There is really no need to solder anything onto the sonoff device. It would be very tedious if you had to do it to 10+ devices. I opened up an old PC and was able to use some parts and cables from it to make this connector from FTDI to sonoff pinholes. I’ll post a picture at some point.

Hope this helps…

I used this exact procedure to flash Eric’s image. Worked like a charm. Thanks!!

Eric, I flashed my sonoff POW with your code and it seems to work fine on it’s own but I’m having problems with power reporting in ST. I first tried adding it as a device in IDE using your device handler but I didn’t see any way of adding the IP address of the POW device in there. I then added the handler to the sonoff connect smartapp code and was able to select it when discovering manually. This works but only allows me to turn it on and off. It does not show any power WAV information in ST. Is there any other way I can get it to work?
Here is what I added to the smartapp

def manuallyAdd(){
dynamicPage(name: “manuallyAdd”, title: “Manually add a Sonoff device”, nextPage: “manuallyAddConfirm”) {
section {
paragraph “This process will manually create a Sonoff device based on the entered IP address. The SmartApp needs to then communicate with the device to obtain additional information from it. Make sure the device is on and connected to your wifi network.”
input “deviceType”, “enum”, title:“Device Type”, description: “”, required: false, options: [“Sonoff Wifi Switch”,“Sonoff TH Wifi Switch”,“Sonoff POW Wifi Switch”]
input “ipAddress”, “text”, title:“IP Address”, description: “”, required: false
}

Thanks

I haven’t added the device information into Sonoff Connect yet. Here is what I would do:

  • Delete the manually created device in the Sonoff Connect App.
  • Go back and “discover” the device in the app. It will install the default Sonoff Handler, but that is ok.
  • Then, go into the IDE and assign the Sonoff POW handler to it.
  • Open the device in the SmartThings app and hit “configure” to make sure the appropriate settings are sent over.

Well that worked just fine. Weird.
On a separate note, do you know if there’s a way to get the sonoff inching/self-locking device flashed or is it a different board? I have one I use to remote open/close my garage door but I’m still forced to use the ewelink app for it. Same with the sonoff SV. I’m working on a small motor setup to open/close my blinds.

Thanks

2 Likes

Ditto on including the sonoff inching/self-locking device. That would be awesome as it seems to be the perfect cost effective solution for interfacing SmartThings with my throw back GE low voltage lighting control system. The only other solution I have found is the FortrezZ MIMO, but it is way more than what I need for the application… including cost. TCPExperts - Are the NO/NC contacts on the inching/self-locking “dry”? Based on what I can tell they are, but I haven’t put my hands on one yet to verify.

Thanks in advance!!!

1 Like