Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulse gpio #8

Closed
yuguar opened this issue Apr 11, 2018 · 7 comments
Closed

Pulse gpio #8

yuguar opened this issue Apr 11, 2018 · 7 comments

Comments

@yuguar
Copy link

yuguar commented Apr 11, 2018

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
Copy link
Owner

ThisIsQasim commented Apr 12, 2018 via email

@yuguar
Copy link
Author

yuguar commented Apr 12, 2018

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
Copy link
Owner

ThisIsQasim commented Jun 13, 2018

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
Copy link

kevin9r commented Jun 13, 2018

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:

  • Name: Bed Room
    Accesories:
    • Name: Hallo
      Type: GPIO
      Pin: 18
    • Name: Front Light
      Type: GPIO
      Pin: 17
    • Name: Back Light
      Type: GPIO
      Pin: 27
    • Name: Bright Light
      Type: GPIO
      Pin: 22
  • Name: Garage
    Accesories:
    • Name: Light
      Type: GPIO
      Pin: 23
      Duration: 2
    • Name: Door
      Type: GPIO
      Pin: 24
      Duration: 2
  • Name: Scripts
    • Name: Internet
      Type: Script
      Status: ping -c 1 8.8.8.8 > /dev/null
      Timeout: 0.3
    • Name: Nginx
      Type: Script
      Status: sudo systemctl is-active --quiet nginx 2> /dev/null
      Action:
      On: sudo systemctl start nginx
      Off: sudo systemctl stop nginx

#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
Copy link
Owner

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
Copy link

kevin9r commented Jun 20, 2018

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

@ThisIsQasim
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants