[SOLVED] Sonoff 4ch pro R2 random switching

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

[SOLVED] Sonoff 4ch pro R2 random switching

#1 Post by BertB » 19 Sep 2019, 13:17

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?
Last edited by BertB on 21 Sep 2019, 12:58, edited 1 time in total.

User avatar
grovkillen
Core team member
Posts: 3262
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Sonoff 4ch pro R2 random switching

#2 Post by grovkillen » 19 Sep 2019, 13:50

What debounce time etc are you using?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#3 Post by BertB » 19 Sep 2019, 14:25

20msec

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4ch pro R2 random switching

#4 Post by TD-er » 19 Sep 2019, 15:27

This toggling, does that happen when the ESP reboots?

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#5 Post by BertB » 19 Sep 2019, 15:30

No, that is not the problem. It happens when the device sits there.

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4ch pro R2 random switching

#6 Post by TD-er » 19 Sep 2019, 15:32

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.

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#7 Post by BertB » 19 Sep 2019, 16:07

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.

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4ch pro R2 random switching

#8 Post by TD-er » 19 Sep 2019, 17:00

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?

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#9 Post by BertB » 19 Sep 2019, 17:58

4 and 5 are no longer assigned to I2C.
I'll see if I can make some kind of trap for the unintended triggers.

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#10 Post by BertB » 19 Sep 2019, 18:25

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

Patou
Normal user
Posts: 36
Joined: 21 May 2018, 10:33

Re: Sonoff 4ch pro R2 random switching

#11 Post by Patou » 19 Sep 2019, 21:25

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

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#12 Post by BertB » 19 Sep 2019, 23:22

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.

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4ch pro R2 random switching

#13 Post by TD-er » 20 Sep 2019, 09:54

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?

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#14 Post by BertB » 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?

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sonoff 4ch pro R2 random switching

#15 Post by TD-er » 20 Sep 2019, 11:08

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

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#16 Post by BertB » 20 Sep 2019, 11:50

I can Imagine that. I will test the sonoff in the weekend, but i think the issue is solved.

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

Re: Sonoff 4ch pro R2 random switching

#17 Post by BertB » 21 Sep 2019, 12:58

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.

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

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

#18 Post by TD-er » 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.

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

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

#19 Post by BertB » 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?

TD-er
Core team member
Posts: 1611
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

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

#20 Post by TD-er » 22 Sep 2019, 02:05

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

BertB
Normal user
Posts: 1019
Joined: 25 Apr 2015, 14:39

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

#21 Post by BertB » 22 Sep 2019, 06:46

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests