Page 1 of 1

[SOLVED] Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 13:17
by BertB
Earlier this week, I flashed my fresh Sonoff 4ch pro R2 with ESP_Easy_mega-20190830_normal_ESP8285_1M.bin.
No problem here and I could also create some rules, so that a short push on a button, toggles a relay.

The problem I encounter is that some relays toggle unintended.

Is this a known issue?

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 13:50
by grovkillen
What debounce time etc are you using?

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 14:25
by BertB
20msec

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 15:27
by TD-er
This toggling, does that happen when the ESP reboots?

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 15:30
by BertB
No, that is not the problem. It happens when the device sits there.

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 15:32
by TD-er
So no crashes or other unintended reboots?
Maybe also check what GPIO pins are used for the relais and if there is something else addressing these pins.
For example status LED, I2C etc.

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 16:07
by BertB
So far I can see, there are no reboots.

The Sonoff is an off the shelve device.

Here is the known GPIO list for the Sonoff 4CH R2:
GPIO 00 - Button 1
GPIO 04 - Relay 3
GPIO 05 - Relay 2
GPIO 09 - Button 2
GPIO 10 - Button 3
GPIO 12 - Relay 1
GPIO 13 - WiFi LED
GPIO 14 - Button 4
GPIO 15 - Relay 4

Some of these ports are questionable, I guess.

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 17:00
by TD-er
GPIO 4 and 5 are default associated to I2C.
Just check if these are still assigned to I2C in ESPeasy.

Which relay do trigger unintended?

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 17:58
by BertB
4 and 5 are no longer assigned to I2C.
I'll see if I can make some kind of trap for the unintended triggers.

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 18:25
by BertB
This is my rules script:

on System#Boot do
gpio,12,0
gpio,5,0
gpio,4,0
gpio,15,0
endon

on Button1#state do
gpio,12,[Button1#state]
endon
on Button2#state do
gpio,5,[Button2#state]
endon
on Button3#state do
gpio,4,[Button3#state]
endon
on Button4#state do
gpio,15,[Button4#state]
endon

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 21:25
by Patou
Hello
I have the same problem ...
In my case the outputs are switched off randomly once or twice per evening
And not switched ON !!!!
When this happens , on the log I see clearly that an order to switch off has been given
Those units have also a remote control on 433 Mhz !!!
I suspect that there are some interference
In another room I have some remote control on 433 Mhz and sometimes they switch also the sonoff
Question : Does someone knows how to disconnect the 433 Mhz on the sonoff board ?
Good evening everybody
Patou

Re: Sonoff 4ch pro R2 random switching

Posted: 19 Sep 2019, 23:22
by BertB
I just discovered that one of my RF coco (kaku) transmitters actually also switched one of the relays on the Sonoff.
I certainly did not pair the transmitter with the relay, so I think it was a left over from factory testing.

So, I cleared all RF settings and it looks like all the previous problems are gone.

I shall test this overnight.

Re: Sonoff 4ch pro R2 random switching

Posted: 20 Sep 2019, 09:54
by TD-er
CoCo/KaKu devices may not be located too close to each other or else they may cause interference.
Maybe that's also happening here?
I don't know how/if the 433 MHz module is also directly connected to the relais or maybe it is sending commands somehow to the buttons, like if they were pressed?

Re: Sonoff 4ch pro R2 random switching

Posted: 20 Sep 2019, 10:31
by BertB
After erasing all coco devices, i had no more unintended switchings. Apparently the sonoff was paired off factory.
The sonoff has a 433 MHz receiver on board, but i do not yet use it.
Do you think this function can still work with the espeasy firmware?

Re: Sonoff 4ch pro R2 random switching

Posted: 20 Sep 2019, 11:08
by TD-er
BertB wrote: 20 Sep 2019, 10:31 After erasing all coco devices, i had no more unintended switchings. Apparently the sonoff was paired off factory.
The sonoff has a 433 MHz receiver on board, but i do not yet use it.
Do you think this function can still work with the espeasy firmware?
I have no idea how it is connected to the ESP and/or relais

Re: Sonoff 4ch pro R2 random switching

Posted: 20 Sep 2019, 11:50
by BertB
I can Imagine that. I will test the sonoff in the weekend, but i think the issue is solved.

Re: Sonoff 4ch pro R2 random switching

Posted: 21 Sep 2019, 12:58
by BertB
the Sonoff is very stable the last couple of hours, so I think the 'problem' is solved.

I am only still wondering, if it is not possible to disclose the other sonoff functions as well.
With this I mean the timing sces and the 433 mHz controll.

Re: [SOLVED] Sonoff 4ch pro R2 random switching

Posted: 21 Sep 2019, 13:38
by TD-er
Well, Sonoff does have schematics of their boards online, so you may want to check that to see how it is connected.

Re: [SOLVED] Sonoff 4ch pro R2 random switching

Posted: 21 Sep 2019, 15:25
by BertB
TD-er wrote: 21 Sep 2019, 13:38 Well, Sonoff does have schematics of their boards online, so you may want to check that to see how it is connected.
Do you know where?

Re: [SOLVED] Sonoff 4ch pro R2 random switching

Posted: 22 Sep 2019, 02:05
by TD-er
BertB wrote: 21 Sep 2019, 15:25
TD-er wrote: 21 Sep 2019, 13:38 Well, Sonoff does have schematics of their boards online, so you may want to check that to see how it is connected.
Do you know where?
First hit when looking for Sonoff 4ch pro r2 schematic: https://www.itead.cc/wiki/Sonoff_4CH_Pro

Re: [SOLVED] Sonoff 4ch pro R2 random switching

Posted: 22 Sep 2019, 06:46
by BertB
Great. You are much better at searching than me.
I spent for over an hour without result. Also on the Itead site. Perhaps because i was looking for the R2 version.