Espeasy relay after reboot is on.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
nobody@all
Normal user
Posts: 30
Joined: 09 Apr 2017, 23:27

Espeasy relay after reboot is on.

#1 Post by nobody@all » 11 Dec 2023, 00:58

Hello.
Using espeasy mega-20231130, I have added devices : Switch and relay and servo.
1) Device config is:
Switch input - Switch
Name -switch
Internal pullup - marked
Gpio 12
switch type: switch
Switch button type: Push button active low
debounce 50ms.
2)Device config is:
Switch input - switch
Name -Relay
Internal pullup - marked
Gpio 13
switch type: switch
Switch button type: normal switch

Rules looks like:

Code: Select all

On System#Boot do
  Servo,1,2,0
  GPIO,13,0
  endon

On Switch#State Do
 if [Switch#State]=1
  Servo,1,2,180  
  gpio,13,1
 else
  Servo,1,2,0
  GPIO,13,0
 endif
EndOn
When I power on espeasy state of switch and relay is 1.
What do I don't understand? When system boot i want to have relay and switch 0
Attachments
2023-12-11_004559.jpg
2023-12-11_004559.jpg (53.11 KiB) Viewed 3147 times

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

Re: Espeasy relay after reboot is on.

#2 Post by TD-er » 11 Dec 2023, 08:55

I don't think you need to have a second task for the relay.
If you only act on it via the gpio commands then having a task for it is no longer needed.

N.B. You can also set the boot state of the pin on the hardware tab.

User avatar
Ath
Normal user
Posts: 3526
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Espeasy relay after reboot is on.

#3 Post by Ath » 11 Dec 2023, 10:08

Using the Internal Pull-up option is supposed to pull the pin to high level, so that's probably not the best use in your situation.
/Ton (PayPal.me)

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

Re: Espeasy relay after reboot is on.

#4 Post by TD-er » 11 Dec 2023, 11:54

Yeah, but that should only be affecting this when used as an input.
I can have a look at the code to see if setting the pull-up active actually changes the GPIO mode to input.
Then it would explain the current behavior.

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests