ThisIsQasim / WebGPIO

A simple web UI for controlling the GPIO pins on a Raspberry Pi
GNU General Public License v3.0
72 stars 30 forks source link

Pulse gpio #8

Closed yuguar closed 6 years ago

yuguar commented 6 years ago

Hi there , Is there any possibility to change code to be able to pulse gpio for set amount of time ? As in after web click to change gpio state (turn on relay) and after set period of time change back to previous state (turn off relay) . This is wery useful for some applications as in remotes (garages) or some motor actuated valves etc. Thanks for reading and keep up the good work !

ThisIsQasim commented 6 years ago

It is certainly possible. I’ll see if I can spare some time over the weekend, shouldn’t take long. Any suggestions as to how to go about the UI?

On 12-Apr-2018, at 1:00 AM, yuguar notifications@github.com<mailto:notifications@github.com> wrote:

Hi there , Is there any possibility to change code to be able to pulse gpio for set amount of time ? As in after web click to change gpio state (turn on relay) and after set period of time change back to previous state (turn off relay) . This is wery useful for some applications as in remotes (garages) or some motor actuated valves etc. Thanks for reading and keep up the good work !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ThisIsQasim/WebGPIO/issues/8, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARdynic1q-O7lia00oP3ntjHD2vA5eQ0ks5tnmDjgaJpZM4TQp7S.

yuguar commented 6 years ago

Well it could only be done in script (to set duration in seconds or miliseconds...as done for pin numbering and "section" names) to keep it simple for usage with non variable "things" ..relays,remotes,motor actuators etc.. Luxury variant would be clickable (editable) box in GUI for user to input duration ..useable for lights , sprinklers , hot water tanks etc ..would it be in seconds minutes or how ever coder sees fit ;) .

ThisIsQasim commented 6 years ago

All configs should now be defined in config.yml file. You can also define a duration key for a pin so it will turn on for the given duration and then turn off.

kevin9r commented 6 years ago

If i try to put the duration to another pin i receive: Config file not found. Please provide a valid config.yml file. See exampleconfig.yml for reference. My config.yml:


Rooms:

Settings:

Host: 0.0.0.0

Port: 8000

Debug: True

SSL:

Enabled: False

Path: default

Certificate: WebGPIO.cer

Key: WebGPIO.key

Inverted: False

RefreshRate: 4

ThisIsQasim commented 6 years ago

It appears to be an indentation issue. The example config is using two spaces to for each level. Since Duration key should be defined at the fourth level you should make sure there are 8 spaces before it.

kevin9r commented 6 years ago

Hey, i don't understand what you mean? Can you explain it with a example? Thanks!

ThisIsQasim commented 6 years ago

Your config.yml file has a syntax error since you have put a tab before the Duration: key. Convert the tab to spaces and it will work. You can also verify your yml file by uploading it to yamlint.com