odd relay sounding clicks coming from a sonoff s20(uk) and off topic wifi ramble

187 views
Skip to first unread message

Phil

unread,
Aug 24, 2018, 11:17:46 PM8/24/18
to SonoffUsers
I have just installed a new sonoff s20 as a modem/ap power controller for quick n easy hard reboots when wifi plays up.

setting Pulsetime to 103 and PowerOnState to 5 so that when turned off the switch /relay will switch back on a few seconds later.

This is working as expected :)   BUT, about 20 seconds after the s20 has switched back on the device emits an audible click VERY similar to the relay switching?, then about 15 seconds later it repeats again.
The sonoff or its slave devices remains switched on and nothing unexpected is echoed in the console screen. tho all devices connected are supplied by DC power bricks that will probably maintain output if the relay is double switching very rapidly ..  and if so i could be killing the relay quickly??

any ideas??

----------------------------------------------------------------------------------
off topic ramble:
why am i resorting to such a sledge hammer approach??

fwiw i have had wifi issues for over a decade, ISP support (and ive been a customer of most of them, can only suggest line upgrades?? Facepalm!)  Ive replaced the isp supplied equipment with a dedicated adsl modem and fairly high spec netgear multiband AP/router (RX7000). and still every few days or so tho sometimes far more frequently all my devices start dropping the wifi, my 10 yr old i7 sony lappy and ps4 seem to establish the most robust connections, with many sonoffs and my chromecast stick suffering the worst. Though ps4 netflix replays will drop quality and  pause for loading during such episodes.  

I suspect the fact my ol college has built a hall of residence just up the road might have something to do with it as the local taxi firm that did have a filthy transmitter has closed down.

Wireshark needs a bit too much required reading for me to use it properly but my current working theory is that the sheer number of local APs (which indicates im well within range of the fore mentioned hall of residence) simply saturates whatever channel my wifi is currently using until my devices signals drop, as a simple reboot of the AP and modem generally sorts it out for an hour or so at worst and a few days at best..

Normally im within reach of a puter to instigate equipment reboots but now with a sonoff in the line i can start to setup an automatic detector and reboot when either a specific or number of devices loose their network presence.

any suggestions for further investigation to determine just whats going on are welcome,  But i do appreciate its off topic for in here..

Cheers ;)



Philip Knowles

unread,
Aug 25, 2018, 2:29:50 AM8/25/18
to Phil, SonoffUsers

It's worth downloadihg inSSIDer to have a look at what channels are heavily used and then picking a relatively quiet area of the spectrum. Then force the channel within the Netgear.
Everything defaults to channel 7 or 11 and then switches if the channel gets full. It doesn't say "hello I'm going to chsnge channel" it just changes channel and then waits for everything to reconnect. Forcing a channel stops that.
Also try to use 5GHz if you can. There's less pollution there and the signal also works better in buildings.
Have you turned off the wifi in the adsl modem? You should turn it off and use ethernet to connect to the Netgear. Using wifi to connect just uselessly uses bandwidth and they will 'fight' each other. It's also worth considering using a separate SSID just for the Sonoffs (possibly on Ch 1 or 14). Some of mine seem slow and wifi works at the speed of the slowest device. That causes problems if you have both the adsl and the Netgear on the same SSID too. Some devices hang onto the first SSID for grim death (iPhones are the worst). They then slow the wifi down as the signal degrades. Other devices see a faster, stronger signal on another channel and switch but you get a bit of drop out with streaming devices. My Zyxel modem has the ability to set up another 'guest' SSID. I'm thinking of putting all the Sonoffs onto that thus keeping the main SSID free for 'real' devices.
Now for the S20. I have an issue with the micro PC running openHAB crashing infrequently. I've put in a watchdog which pulses the power if it doesn't get a MQTT message every five minutes - basically I send a backlog delay 3600; Power1 1. openHAB sends a backlog command every 5 minutes which flushes the delay and then I send the delay and power commands again. The key is that I'm using a small ESP8266 relay from eBay and using the normally closed contact so I switch the relay ON to restart the PC. I've put the board and a 5V buck PSU into an old 433MHz remote controlled socket which keeps it neat. I live in a village with frequent brown outs and/or short outages (2-3 seconds) at this time of year (grain driers). Using the NC contact gets me through nearly all of them unscathed as theres a big enough capacitor in the PC PSU.
By the way, only turn off the Netgear and not the adsl. If you're not using adsl wifi (and you shouldn't be) there's no point turning it off and the adsl has to 'retrain' so you get degraded broadband for a while.
Regards
Phil k


--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Phil

unread,
Aug 25, 2018, 1:31:37 PM8/25/18
to SonoffUsers
Cheers Phil,  

Your insight into the channel switching feature of the wifi kinda bombs my pulled from mid air theory ;) The wifi channel mapping is one feature of wireshark that i have mastered, and that reveals that every channel is heavily populated whenever i have monitored activity. according to the graphical display of channel usage it appears that its only the relative strength of my local signal which allows it to poke over the top of the noise of the masses.

I will remove the adsl modem from the reboot circuit as you suggest, the 5ghz band is enabled but i dont have much in the way of h/w beyond phones that can use it, 

im in a tasmota transition phase atm..  i have a number of stock sonoffs in use as a test of concept,  this has proven very successful to a point and just highlights the benefits of the tasmota alternative.  Now i need to pull all the stock in use boxes and upgrade them, once done i will host a dedicated subnet with either an old isp router as an ap or possibly the Pi i use running mqtt and nodered. well thats the plan.


Back to the s20 tho, I an sure i am missing something crucial?  
your micropc running openhab crashes infrequently, so you use openhab to send a backlog command every 5 minutes to turn the relay on in the device supplying power to the computer after a 5 minute delay (its supplied by com and NC ) so efectivly turning it off
But the command gets sent again every 5 minutes and therfore overwrites the earlier command?
how do you turn the relay back off again? pulsetime?
wont a delay or lag in receipt of the regular command result in an unwarranted power down?







 

Philip Knowles

unread,
Aug 25, 2018, 6:37:34 PM8/25/18
to Phil, SonoffUsers

Yes the NC contact is used and I send a commandl which says delay for 6 minutes then pulse the relay for 30 seconds – I use BlinkCount 1 and BlinkTime 300 – not sure why I prefer Blink to Pulse. I use a cron job to send a backlog command every 5 minutes which flushes the buffer and stops it Blinking.  In a couple of months it’s operated twice so I’ve had no false trips yet – the extra minute gives a little margin for error. I do have to be careful when I’m doing a planned reboot so I send a backlog just before shutting down. You could do something similar to monitor the wifi and automate the wifi reboot. I suppose. There’s no reason not to send multiple delays in a backlog.

Not sure about Wireshark but some of the wifi analysers look at relative rather than absolute signal strength – my Zyxel router does that so there’s always one at 100%

The weakness of the Sonoff is the inability to easily add additional switches. I have a 4ch which I used to automate the cooker hood. I put an AM2301 in the cooker hood and use a PZEM-004T to measure the current to the hob (electric). The hood and light turn on when the hob is turned on (or if the kettle boils) and the speed increases if the humidity increases. It obviously switches off based on humidity. It works very well but I would now use an ESP12 and a 4 channel relay module in a junction box neater and safer.

I use a POW for the immersion heater and ended up taking it out of its housing and putting it in a 2 gang plasterboard back box with a blanking plate. I drilled a 5mm hole in the blanking plate and glued a short length of Perspex rod to the pushbutton so that it can be operated manually – openHAB turns it off if the current drops because the thermostat has tripped or after an hour. I have a DS18B20 mounted halfway down the cylinder and openHAB works out when to turn on the immersion heater based on the cylinder temperature rather than at a fixed time. In the last quarter I saved 100kWh so it’s almost paid for the Sonoff.

Regards

 

Phil K

 

Sent from Mail for Windows 10

--

You received this message because you are subscribed to the Google Groups "SonoffUsers" group.

To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages