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

dth_lighting

(Jon Turnbull) #1360

Guys I have read loads.

Thought I had dome everything. Flashed and can no longer connect in ewe link.

But I cat complete the steps to set up the wifi it. I cant see as an access point any ideas what I could be doing wrong

Please help


(Jon Turnbull) #1361

I had the SPI mode set to DIO as the instructions I followed didnt say to change that

Just flashed another with DOUT selected but still cant see it as an access point.

Now have managed to see it as access point and add it to my wifi.

But in smart app on phone it doesnt find any sonoff devices at all.


(Peter Schultze) #1362

I’m in the same boat. I can Flash easily (espeasy 2)but want a recommendation on which exact bin firmware to Flash so that I can use erocssmart app. I have never been able to successfully use an access point from a sonoff. I prefer to Flash with ESP easy as it is very easy.
So far I have flashed the erocs original bin file and ESP 8565 normal without success.


(Jon Turnbull) #1363

Ok i read that the NODEMCU was a better way…
So I did that and flashed and I can gain access to access point and set to my home wifi.
But then cant get on them in smarthings app.

Sonoff.ino.generic.bin is the firmware I flashed…


(Peter Schultze) #1364

Ok. I’m embarrassed that the very first post method worked great for me after lots and lots of fails with CMD prompts and EspEasy. Not sure why my “successful” ESPEasy flashes didn’t get me to success but flashed Sonoff.ino.generic.bin using NodeMCU like Jon and following the first post to a specific tee and have now finally been able to 1)access the Sonoffs access point, 2)enter my router info and 3) now the Sonoff is connecting to my router. I won’t be able to test whether I can get them in the Smartthings app until tonight.


(Jon Turnbull) #1365

BUT what am I missing…

It did just show up in app for 30 seconds but I added it then it vanished

CAnt get it back did you publish the smart app and device handler in IDE


#1366

Make sure the wifi is on the same subnet as your ST hub. It should all be able to see each other automatically but if not put the IP address of the Sonoff into the device manually. I do recommend setting them up as static DHCP devices in your router much like the ST hub should.

If you have any issues with the flash, yes I would use the NodeMCU method with DOUT and then if you have to, do the hard reset on the switch afterwards by holding down the button for 10 or more seconds (or is it more?) to factory default the settings.


(Jon Turnbull) #1367

They are both connected to same
I think Ie I have one router only no other access points.
The hub is connected with cat 5
Am I missing something

I havent set up any subnets at all so guess they are all on the same one as there is only one.

Or do I need to create on.

Thanks

jon


#1368

Sounds like you have a standard single subnet network as long as the WiFi devices can “see” the wired devices and aren’t segmented some how like on a guest type network you should be good. Set the Sonoff to a static DHCP type reservation and just punch it into the app. You’ll need to put your IP of the ST hub as well on the web config inside the switch as well as setting any other options.


(Jon Turnbull) #1369

Thats very kind of you but may as well be written in french which i dont read lol

So I need to log on to my router and determine somehow which is the switch ip and get its ip address.
Im assuming it wont show up as something sensible like sonoff.

I then in the app add the device manually correct?

I have the latest BT home hub.
I havent set anything with static ip always looks too confusing.

Dont want to cock up things…
my ST hub can see all ST devices ie door sensors proximity sensors and motion sensors, also wemo plugs and Ikea bulbs so I am guessing everything is on one subnet.

Not had any issues with anything until these.

sorry for all the NOOB questions


(Reimo) #1370

Now when firmware source code is public is there a brave man who will write code for 2 gang switch? :grinning: I have 2-gang switch waiting to test code! Maybe it is easy and just mixing togehter touch switch and Sonoff Dual firmwares?


#1371

Yes, get the IP out of your router. Which router do you have?


#1372

Which 2 gang switch? If someone had one I could borrow for a bit I am sure I could modify things to get it going.


#1373

I have flashed this on several sonoff devices and it generally works great. One thing I have noticed though is if there is a fan or other large power draw device on the same circuit as the sonoff, when the fan is turned on or off it occasionally toggles the sonoff as well. Had anyone else noticed this? It doesn’t seem to happen when on Tasmota. This is with sonoff basics. Any suggestions?


#1374

Just flashed my first batch of Sonoff Basic and it works like a charm.
I’m a Linux user and I wanted to share with you how simple it is to flash the Sonoff with ESPTool.

I’m using Debian Linux 9, but this will also work on Raspberry Pi, Ubuntu or other DEB based distros.
When I plug in my FTDI Adapter, it resolves to /dev/ttUSB0

Install Python PIP and ESPTool if not already installed …

sudo apt-get install python-pip
sudo pip install esptool

Get the latest firmware and flash to Sonoff

wget https://github.com/erocm123/SmartThingsPublic/raw/master/devicetypes/erocm123/sonoff-wifi-switch.src/Sonoff.ino.generic.bin
sudo esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 Sonoff.ino.generic.bin

And here is how the output for a successful flash looks like …

esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash params set to 0x0320
Compressed 349296 bytes to 242367...
Wrote 349296 bytes (242367 compressed) at 0x00000000 in 21.4 seconds (effective 130.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Then I reboot the Sonoff with VCC and Ground and configure WiFi.
The advantage of using Linux is that you can use unofficial China versions of the FTDI adapter
without having the worries of the driver corrupting the binary like the windows driver does when it detects fake chipsets.

Hope this will benefit other flashers :slight_smile:

Cheers.


#1375

Are you using the GPIO 14 external switch option? This is typical if so due to interference. You can correct the issue by using a 10k pull up resistor between 3v3 and the GPIO 14 pin.


#1376

Thanks for the tip! I am using an external switch so using a resistor is what I need to do. Sounds easy enough. Will these work? 10k resistors


#1377

I used some 1% metal film resistors but it doesn’t have to be precise on things. Amazon had a kit with all kinds of resistors for like $10 so I snagged it. Just doing a pull up resistor. Google Sonoff Basic pull up resistor GPIO14 and you will find a bunch of threads along with diagrams.

I ended soldering one leg through the 2nd hole near the board gaps. It’s 3v3 as well as the first pin on the header for programming but this one wouldn’t get in the way if I needed to flash it again. I did my first one with the resistor underneath but such a pain to get it right and make the case still fit. I went with the top side on my others. Funny I talk about this when one I had installed on a 2 gang box never ghost switched until today. Been fine for weeks.


(Reimo) #1378

I got this 2-gang: https://www.banggood.com/EJLINK-EL-02-2-Gang-AC-90-250V-2A-400w-86-Type-EU-UK-Smart-WiFi-Touch-Light-Wall-Switch-Module-Wirel-p-1257765.html?rmmds=myorder&cur_warehouse=CN

I also got same design 1-gang switch and flashed it with 1-gang touch switch firmware from first post and it has been working OK for several months for now. So I guess they manufacture these sonoff switches using all the same esp pins for inputs, leds and switching?


(James Scholes) #1379

I only have the 1 button version I’m afraid. I was planning on getting some 2/3 button ones but they didn’t meet my wife’s aesthetic criteria, and I can’t replace the buttons with something which will. Similarly to @digiblur I’d be happy to take a look at one though. I’m in the UK.

NB: also available from ebay