Sonoff-HomeAssistant (Alternative firmware for Sonoff Switches for use with mqtt/HA)

Does anyone know the “2017-Version” I found here: https://www.aliexpress.com/item/2017-New-Sonoff-Smart-Home-Wireless-Remote-Control-Wifi-Switch-Intelligent-Timer-Switch-Diy-Switch-220V/32796752033.html ?
Just a marketing gag by this aliexpress shop owner or something new?

Actually I spoke to Sonoff just last week and asked the same question. The device is the same. It’s a marketing ploy :smiley:

1 Like

After upgrade HA it seem the all my sonoff switch lost its connection and restart every night between 3-4am not sure why without any automation setting…

I got crazy with this GPIO14 crazily changing states when just plugged something on…

But got it working… using only the 10k resistor connected like you sayd.
No need for the 430k resistor…

Just another question!
Is this connection safe for the board? Won’t it toast in some days???

Thanks

It’s quite normal to have a pull up/down resistor. Sleep easy.

Thought it might be useful to place a link here as well for a recall on some Sonoff POW and TH16 units:
https://community.home-assistant.io/t/sonoff-recall-th16-pow-dec-2016-jan-2017/13799

I have just spoken to my contact at Sonoff. She has no idea about a recall and I have sent her the links. She is in sales though so she is investigating and will get back to me. So far everything is OK here, house is still a house.

We will know fairly soon if this is legit or slandering :smiley:

Heres the link direct from ITLead

https://www.itead.cc/blog/sonoff-th16-and-pow-recall-notice

ITEAD got back to me. It’s a very small % of units that are effected. Because they don’t have batch numbers, it’s almost impossible to track. It’s basically left up to the customer to contact them after the fault has occurred and they will replace the unit. Hopefully nothing major happens in that process.

1 Like

I finally decided to give this a try. However, I am stuck at uploading the firmware to the Sonoff.

I am using the basic version of Sonoff

I don’t have any FTDI around so I use my old Arduino UNO as an alternative.

This is how I connect it…

The Arduino editor I am using is version 1.6.5.

My settings in the editor is as follows…

When I press verify button, it was OK. But when upload it, it gives these errors…

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

I did press and hold on to the black elongated button on the Sonoff before plug in the USB port and release it after few seconds.

Not sure will it help but just to add, the LED on the Sonoff did not blink or light up at all. If I plug in the USB port without press, hold and release the black button, the LED on the Sonoff will blink once every 2 seconds.

Please help. Thanks.

I have never used a Uno to program a Sonoff. I have only ever user an FTDI adaptor.

http://www.ebay.com.au/itm/FTDI-FT232RL-USB-to-TTL-Serial-Converter-Adapter-Module-5V-3-3V-For-Arduino-GH-/272279719836?hash=item3f6522cf9c:g:j3QAAOSw5ZBWPbNF

and

http://www.ebay.com.au/itm/40pcs-20cm-Jumper-Wire-Cable-For-Arduino-Breadboard-Prototyping-Female-to-Female-/252324355458?hash=item3abfb41d82:g:p08AAOSwiDFYRR2A

It seems you have the connection right. You just need the FTDI adapter. You need to connect the adaptor to the header on the LED controller like this. Make sure the adapter is set to 3.3V with the onboard jumper otherwise you will blow the controller if you try and program with 5V.

CABLE/FTDI ADAPTER         SONOFF

VCC                        VCC
TX                         RX
RX                         TX
GND                        GND

You need to set the parameters on the IDE like this and change the port to the correct COM port that the FTDI adapter is connected to COM4, COM5 etc.

Hope that helps

I had one of those but it doesn’t work with my Windows. Somehow, the whole FTDI became unusable after I plugged it into my windows. I believe it was due to fake chip used by the FTDI. The link that you provided is most probably using the fake chip as well due to the low price. I am wondering what Windows are you using? Is there any additional steps you took before you plug in your FTDI? I’m using up to date Windows 10.

Yes there was a big issue with fake chips. Actually the issue was with drivers and the way they were signed and made useless after detecting a fake chip. The link I provided was the same one I use on Windows 10. No additional steps.

By using an Arduino, serial data is going from Windowa 10 to the Arduino but unless you have a sketch that passes that data back out to the Sonoff through another serial port I’m not sure how it would work. Never tried it or even bothered to learn how. Get an FTDI and you will have no issues.

@masterkenobi
To get the arduino working as ftdi you have to bridge a couple of pins. iirc it’s reset and gnd. Don’t quote me on the actual pins, but get the right pins jumpered and you’ll be fine.

OK just bought 2 units from Ebay. Hopefully it will work this time.

I have no idea which pin goes to which pin. I had it working with Arduino Pro Mini. Anyway, I tried it by doing so…

…and it still fail.

Do you get any output in the arduino ide?

Yesterday my 5 sonoffs arrived and it was not enough to press the button while powering up but I had to press the button during the whole uploading session (with a high baud rate not a problem at all).

Ah, and what I had to do: use an external 3V3 power source. I connected TX,RX and GND of my sonoff with my FTDI device and V3V and GND form sonoff to the power source. The sonoff and the FTDI hav to share the GND or it wont work (Shared GND for heart beat or link detection? Don’t know it anymore…). 0.5 Amps from standard USB Port is not enough it seems.

My sonoffs (marked as “2017” version, marketing trickery) looks like this:

and this:

I got 5 pcs. At least two of them (did not check the others by now) have a hand soldered capcitor in the middle of the board.
Any comment on this?
I think it could be some communication stability improvement by adding this capacitor.

@KmanOz This is an outstanding piece of handywork, Thanks for sharing with the community and please keep up the good work.

Your instructions on guithub are very thorough and have helped get the job done.

Thanks again.

No problems at all. I’m a bit slack ATM because my new 3D printer has me occupied :smiley: I have a Sonoff 4CH sitting here I need to get writing some code for. That’s next :smiley:

Yes there is some basic serial debug info the Sonoff spits out.