Re: [web2py] Re: initilize GPIO in web2py-Scheduler

2015-05-26 Thread Dave S


On Saturday, May 23, 2015 at 6:02:34 AM UTC-7, Ramos wrote:

 Why do people use raspbery pi ?

 I use electric imp or even esp8266 and have my sensors connected to the 
 cloud where the app lives.

 No more problems with setting up linux, drivers, etc

 Its IOT time!!


a) First I've heard of electric imp or esp8266
b) Raspberry Pi isn't just a sensor platform (that wasn't even what it was 
developed for).

/dps
 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: initilize GPIO in web2py-Scheduler

2015-05-23 Thread António Ramos
Why do people use raspbery pi ?

I use electric imp or even esp8266 and have my sensors connected to the
cloud where the app lives.

No more problems with setting up linux, drivers, etc

Its IOT time!!



2015-05-22 19:55 GMT+01:00 Niphlod niph...@gmail.com:

 every scheduler task is executed within an isolated process. I don't know
 the internals of GPIO but I guess you'd need either:
 - istantiate gpio, retrieve the value, act upon it (e.g. setting a new
 value)
 - set two tasks: one (the 1st) that either is repetitive but stores
 somewhere if it ran correctly or that doesn't repeat itself, and the other
 one to repeat (2nd to nth)


 On Friday, May 22, 2015 at 5:36:59 PM UTC+2, Aydin S wrote:

 I'm trying to set a pin to high (for instance) in a periodic way using
 web2py in an embedded linux.
 I set the GPIO to output for example :
 GPIO.setup(pin 20, output)
 and then
 if xy
 GPIO.setup(pin 20, high)

 and run the scheduler every 10 second
 The problem with this is that every 10 second when it gets to the line
 which sets the pin to be output, it turns it low (that's the default).

 I am frustrated with scheduler to get it to run two functions so that I
 can put the pin initialization in one which runs only at startup. I tried
 to use the crontab -e and initialize there, but it looks like web2py models
 does not have access to those and failed to run.

 I've been thinking to make a creative way to bypass GPIO setup after
 first run of scheduler and I was successful but scheduler fails in the
 second repeat because does not know the setup apparently.

 Web2py experts please help me find out the solutionThanks


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: initilize GPIO in web2py-Scheduler

2015-05-22 Thread Niphlod
every scheduler task is executed within an isolated process. I don't know 
the internals of GPIO but I guess you'd need either:
- istantiate gpio, retrieve the value, act upon it (e.g. setting a new 
value)
- set two tasks: one (the 1st) that either is repetitive but stores 
somewhere if it ran correctly or that doesn't repeat itself, and the other 
one to repeat (2nd to nth)

On Friday, May 22, 2015 at 5:36:59 PM UTC+2, Aydin S wrote:

 I'm trying to set a pin to high (for instance) in a periodic way using 
 web2py in an embedded linux.
 I set the GPIO to output for example :
 GPIO.setup(pin 20, output)
 and then 
 if xy
 GPIO.setup(pin 20, high)

 and run the scheduler every 10 second
 The problem with this is that every 10 second when it gets to the line 
 which sets the pin to be output, it turns it low (that's the default). 

 I am frustrated with scheduler to get it to run two functions so that I 
 can put the pin initialization in one which runs only at startup. I tried 
 to use the crontab -e and initialize there, but it looks like web2py models 
 does not have access to those and failed to run.

 I've been thinking to make a creative way to bypass GPIO setup after first 
 run of scheduler and I was successful but scheduler fails in the second 
 repeat because does not know the setup apparently.

 Web2py experts please help me find out the solutionThanks 
  



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.