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

ive switched to COM2, still no luck, getting this error , even after switching TX and RX

C:\Users\Frederick Umeri\Desktop\ESPEasy_R120>esptool.exe -vv -cd nodemcu -cb 11
5200 -cp COM2 -ca 0x00000 -cf Sonoff.ino.generic.bin
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 COM2_
_ 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
_ 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
_ 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_
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
_ 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
_ 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_
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
_ 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
_ 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_
warning: espcomm_sync failed
error: espcomm_open failed

No I kept mine at default.
I’m wondering wether it’s because your on a Mac using a Virtual machine…
It may not be communicating with the com port like it should

ok, finally got both switches flashed successfully. Connected to power, but nothing happens. No led, no SSID

What was the problem ?
Connect the power from the usb and hold the button down for 20 seconds and the led should flash.
Remove the usb power wait a sec and reconnect the usb power then scan for wireless networks on your Mac and sonoff should appear connect to that with the password configme and load the setup page

Hi @erocm1231 If I flashed the Dual/4CH firmware onto a regular Sonoff, can you tell me which pins on the ESP chip are used in order to connect extra outputs?

Thanks very much mate :slight_smile:

Seems i wasnt holding down the pins properly

The second switch works fine, seems i mixed up the input/output connectors on the first one. correcting that now

Ok, everything works fine now. Even with my echo dot. Thanks so much steve, for your help.

Do you know if theres any homebridge plugin for Sonoff switches?

No probs glad it’s working.
I’ve never used homebridge so not sure but I have seen this not sure if it’s what you want or if it works lol
https://www.npmjs.com/package/homebridge-smartthings

thanks, already have the smartthings plugin for homebridge.

The 4CH uses:

REL_PIN1 12
KEY_PIN1 0
REL_PIN2 5
KEY_PIN2 9
REL_PIN3 4
KEY_PIN3 10
REL_PIN4 15
KEY_PIN4 14

The dual is actually a totally different beast. It has a separate module that speaks to the esp8266 over serial communication. The esp8266 sends a serial command to it and it controls the relays. When you press the button on the board, it writes to the serial connection for the esp8266 to read.

1 Like

Good to know! Thank you and how very strange they have done it that way for the Dual!!!

Do you know off the top of your head if the REL_PIN is high when the device is on, or low when the device is turned on? (I can work it out when things arrive but thought I would ask in advance). (In efficient circuits it is normally better to hold the pin high or even make it an input in order to keep the device off, since that way you can minimise the number of drain resistors and chips can normally drain more current than they can source. Then, when you want the device to turn on you make the pin an output/low… but things made in China rarely follow a logical process!)

Would it be possible to add Temperature to the 2 and 4 relay boards?

Yeah, the Dual is really strange. I don’t know off the top of my head and am on vacation right now without my laptop (using my wife’s) so I can’t currently look it up.

Hello all,

I’ve got my sonoff switch working with the custom firmware, device handler and smartapp. All the functionality is working fine.

However the switch will randomly turn on without input. I’ve noticed it do it once when I turned on another appliance nearby (manually). Is anyone else suffering from interference triggering the sonoff?

Thanks in advance!

Adam

I had this issue too, check out posts 477, 478 then 480

Thank you, I’ve shortened the flying lead to the pushbutton, added a ferite core and rearranged the cables to keep them all apart as best I can, I’ll see how I get on.

Did you make any modifications to your sonoff to solve your problem?

Unfortunately not, I gave up after a while as I reconsidered using these as I’m cautious of the safety risks with the sonoff inside my plasterboard walls. Although they give great control of a lighting circuit for under £20, I’m not sure I want to risk using them.

Also I’d like to be able to dim my lights so I invested in a bunch of ikea Trådfri gu10 bulbs which work great with ST.

Has anyone here got any plausible concerns with using the sonoff inside a wall in the UK (240vac).

Plausible concerns no, there haven’t been any instances of failed devices on these forums from what I have seen, and from looking at the PCB they are actually quite well made and with decent isolation of mains.

However (for the UK) they don’t have a CE mark and also don’t have every certification mark for in wall use (British standard ones) and hence if putting them in a wall I would try and find a fireproof case or something like that to be safe. Ultimately it is insurance being valid which is most important for me, along with whether a qualified electrician would have fitted it. Hence in practice seem fine but in principle there is always a risk.

Also wrt the random switching, I would start with the resistor tying the pin high (not relying on internal pullup), and second then try adding a capacitor between 3v3 and ground, something like 1uF or so at a guess to steay the voltage when something else switches. (you could also try using a capacitor and resistor in series across the pin and ground - that might help too)

I remember reading somewhere that the 2017 versions of these now passed CE certification.
Can’t remember where i read it now

Hi,

I’m using the regular sonoff switch with the custom firmware, device handlers and smart app.

I have set the boot up state to “previous state”, but most times after a power outage it remains off, even when the switch was on before the power outage, and the value for boot up state resets itself to off. Has anyone noticed this behaviour?