Sonoff 2 Gan GPIO,5 at 1 when reboot
Moderators: grovkillen, Stuntteam, TD-er
Sonoff 2 Gan GPIO,5 at 1 when reboot
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
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
- 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
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
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
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
- 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
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
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
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
Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
also I tried putting Low on GPIO 9 but it does no have any effect
Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
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.
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.
Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
Hey
I flashed mega 20191208 normal ESP8285
thanks
I flashed mega 20191208 normal ESP8285

thanks
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
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.
Re: Sonoff 2 Gan GPIO,5 at 1 when reboot
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
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
Who is online
Users browsing this forum: Google [Bot] and 22 guests