Sonoff 2 Gan GPIO,5 at 1 when reboot

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Sonoff 2 Gan GPIO,5 at 1 when reboot

#1 Post by fishton » 10 Dec 2019, 09:34

Hello

I have just upgraded my Sonoff 2 gangs used for opening/closing my shuttters to EspEasy mega 20191130 version and I am experiencing an issue I have already seen in the past

Each time the sonoff restarts, GPIO 5 is set to 1 causing my blinds to close.

This was definitely not the case for earlier version I was using (2018-06 as far as I remember)

Do you know how I can prevent that to happen ?

thanks a lot
fishton

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

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#2 Post by grovkillen » 10 Dec 2019, 12:00

Have you tried setting boot state for that pin? It's found under the hardware tab.
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:

fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#3 Post by fishton » 10 Dec 2019, 12:29

Hi

I tried that in the past and it was not working so I rolled back to previous version but I must confess I didn't this time

I would really like staying with latest version with Wifi stability updates but if the blinds are closing few times a day won't be manageable :)

I will try putting LOW tonight

thanks
Fishton

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

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#4 Post by grovkillen » 10 Dec 2019, 12:59

Yeah try and get back here with info.
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:

fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#5 Post by fishton » 11 Dec 2019, 10:22

Hey !

So, I have been able to understand the issue here.

when the Sonoff Touch 2 gang is starting, it looks like Switch 2 (GPIO 9) is set to 1 that was triggering a rule based on that value changing and also changing the relay value

I have added :

on System#Boot do
gpio,12,0
gpio,5,0
inputswithcstate,1,0
inputswithcstate,0,0
endon

in the rules

and also changed both buttons to have "Internal PullUp"

and now I still see the switch 2 light showing up but no more relay activation and the light is switched off afterward

any thoughts ?

thanks
fishton

fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#6 Post by fishton » 11 Dec 2019, 10:46

also I tried putting Low on GPIO 9 but it does no have any effect

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

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#7 Post by TD-er » 11 Dec 2019, 11:23

What build did you flash?
It should be ESP8285 and not ESP8266.
GPIO-9 is not available on ESP8266 as it is connected to an external flash chip. On the ESP8285 the flash chip is internal.

fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#8 Post by fishton » 11 Dec 2019, 12:32

Hey

I flashed mega 20191208 normal ESP8285 :)

thanks

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#9 Post by Domosapiens » 12 Dec 2019, 00:49

fishton wrote: 11 Dec 2019, 10:22 on System#Boot do
gpio,12,0
gpio,5,0
inputswithcstate,1,0
inputswithcstate,0,0
endon
inputswithcstate,1,0
inputswithcstate,0,0
Typo .. must be inputswitchstate
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

fishton
New user
Posts: 6
Joined: 10 Dec 2019, 09:29

Re: Sonoff 2 Gan GPIO,5 at 1 when reboot

#10 Post by fishton » 12 Dec 2019, 13:25

indeed, typo

my rules below

on System#Boot do
event,STOP
endon

on Touch1#Switch1 do
if [Touch1#Switch1]=1 do
gpio,5,0
inputswitchstate 1,0
gpio,12,1
timerSet,1,30 //Set Timer 1 for the next event in 120 seconds
else
gpio,5,0
inputswitchstate 1,0
gpio,12,0
endif
endon

on Touch2#Switch2 do
if [Touch2#Switch2]=1 do
gpio,12,0
inputswitchstate 0,0
gpio,5,1
timerSet,2,30//Set Timer 1 for the next event in 120 seconds
else
gpio,12,0
inputswitchstate 0,0
gpio,5,0
endif
endon

On Rules#Timer=1 do
gpio,12,0
inputswitchstate 0,0
endon

On Rules#Timer=2 do //When Timer1 expires, do
gpio,5,0
inputswitchstate 1,0
endon

on UP do
gpio,5,0
gpio,12,1
inputswitchstate 0,1
inputswitchstate 1,0
timerSet,1,30
endon

on DOWN do
gpio,12,0
gpio,5,1
inputswitchstate 1,1
inputswitchstate 0,0
timerSet,2,30
endon

on STOP do
gpio,12,0
gpio,5,0
inputswitchstate 1,0
inputswitchstate 0,0
endon

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests