Sonoff 4CH Pro Questions - Odd problem
Posted: 04 Feb 2018, 02:03
I'm new to the world of ESPEasy. I want to build an electronic 12v system to control an external antenna switch for my ham radio shack. I picked up a Sonoff 4CH Pro, and it works great, but I have a couple of odd issues I'm encountering which is probably due to my lack of experience. Any feedback would be appreciated.
I have my unit configured as follows:
Version: ESPEasy mega 20180130
Controllers: none
Hardware:
- Wifi Status LED GPIO-LED GPIO-13(D7). Inversed LED unchecked.
- I2C interface: GPIO<->SDA: GPIO-4(d2), GPIO->SCL: GPIO-5(d1)
- SPI Interface: Init SPI unchecked
- GPIO Boot states: all pins set to "default".
Devices:
4 Switch input->Switch, named Button1/2/3/4, maps to GPIO 0/9/10/14 respectively. Switch-Type switch, button type: push button active low. Internal pullup checked, inversed logic & send boot state off, delay 0.
Rules:
Notifications: None
I have S6 set to 1, K5 1-4 set to 1, and K6 1-4 set to 0.
Basically, in addition to controlling the unit remotely via http, I want to have the buttons configured so each button will toggle a relay.
My problem:
The unit boots ok. However, shortly after booting (maybe 60 seconds), LED4 will flash green briefly. Randomly (apparently), immediately after a green flash, I will see a:
SW : Switch state 0 Output value 0
EVENT: Button4#Press=0.00
ACT : gpio,15,1
SW : GPIO 15 Set to 1
Which toggles relay 4 on. After a random (seemingly) amount of time, I'll get another green flash on LED4, with another Event generated that turns off relay 4.
This process repeats ad infinitum.
few other things I should mention: the rules seem to work great otherwise, i can press buttons 1 through 4 and have relays 1 thru 4 turn on and off. And, of course, if the green light flashes and turns on relay 4, I can press button 4 to shut it off, but that sort of defeats the purpose since I need all four pins to create a 12v bcd matrix to feed to the antenna switch
So, my two questions are:
a. What is the green flash on LED4 indicative of, and
b. Any ideas on why this Event is being generated which simulates pressing button 4, when I'm not touching anything? Is there a setting I've missed or do not understand causing it?
Thank you everyone.
I have my unit configured as follows:
Version: ESPEasy mega 20180130
Controllers: none
Hardware:
- Wifi Status LED GPIO-LED GPIO-13(D7). Inversed LED unchecked.
- I2C interface: GPIO<->SDA: GPIO-4(d2), GPIO->SCL: GPIO-5(d1)
- SPI Interface: Init SPI unchecked
- GPIO Boot states: all pins set to "default".
Devices:
4 Switch input->Switch, named Button1/2/3/4, maps to GPIO 0/9/10/14 respectively. Switch-Type switch, button type: push button active low. Internal pullup checked, inversed logic & send boot state off, delay 0.
Rules:
Code: Select all
On System#Boot do
debug 4
GPIO,12,0
GPIO,5,0
GPIO,4,0
GPIO,15,0
endon
on Button1#Press do
if [Button1#Press]=1
gpio,12,0
else
gpio,12,1
endif
endon
on Button2#Press do
if [Button2#Press]=1
gpio,5,0
else
gpio,5,1
endif
endon
on Button3#Press do
if [Button3#Press]=1
gpio,4,0
else
gpio,4,1
endif
endon
on Button4#Press do
if [Button4#Press]=1
gpio,15,0
else
gpio,15,1
endif
endon
I have S6 set to 1, K5 1-4 set to 1, and K6 1-4 set to 0.
Basically, in addition to controlling the unit remotely via http, I want to have the buttons configured so each button will toggle a relay.
My problem:
The unit boots ok. However, shortly after booting (maybe 60 seconds), LED4 will flash green briefly. Randomly (apparently), immediately after a green flash, I will see a:
SW : Switch state 0 Output value 0
EVENT: Button4#Press=0.00
ACT : gpio,15,1
SW : GPIO 15 Set to 1
Which toggles relay 4 on. After a random (seemingly) amount of time, I'll get another green flash on LED4, with another Event generated that turns off relay 4.
This process repeats ad infinitum.
few other things I should mention: the rules seem to work great otherwise, i can press buttons 1 through 4 and have relays 1 thru 4 turn on and off. And, of course, if the green light flashes and turns on relay 4, I can press button 4 to shut it off, but that sort of defeats the purpose since I need all four pins to create a 12v bcd matrix to feed to the antenna switch

So, my two questions are:
a. What is the green flash on LED4 indicative of, and
b. Any ideas on why this Event is being generated which simulates pressing button 4, when I'm not touching anything? Is there a setting I've missed or do not understand causing it?
Thank you everyone.