Re: Raspberry Pi GPIO home automation by willq44 - Customization

874 views
Skip to first unread message

freäk qnc

unread,
Jun 5, 2013, 6:13:47 PM6/5/13
to web...@googlegroups.com
Apparently nobody is interested in this project or similar. I haven't seen so little activity on a group as I've seen here. So I guess web2py doesn't have a huge user base/following. Was worth a try though. Looks like a very well made system, but apparently isn't something that could do for me. Major deal breaker was to have the GPIOServer.py stopping on its own with no apparent reason or user interaction. As that is the event listening script, having it to stop means the whole system becomes unusable. Also looks like there is nobody available to help others figure out web2py-related issues... so I guess I'll have to go back to the drawing board and look elsewhere.

Thanks to anyone who looked...

Cheers.

PS: Advise to others who like ma may be looking for home automation solutions... web2py didn't do for me so you may want o avoid wasting your time and skip it. If it did work for you and disagree with me... please do contact me. I'd love to be proven wrong and get a working system. Thanks



On Thursday, May 30, 2013 2:55:39 AM UTC-4, freäk qnc wrote:
Hi everyone... I have a quick question... could someone give me a quick example on how I could modify the app presented on instructables by willq44? http://www.instructables.com/id/Raspberry-Pi-GPIO-home-automation/?ALLSTEPS

I would like to change to a toggle the function so that triggering a button will set a GPIO pin to high and hitting it again will turn it to low with corresponding visual feedback (icon button on and off). It's rather simple but as a noob on web2py I need some help... I implemented 3 systems trying to get this simple task of triggering a relay via webui on a standalone (non internet connected) system. 

My experience so far to give you a bit of background context...

I've used BerryIO, a great system and easy to install, but definitely an overkill not very flexible and with no user management for login (must login with machine account (root/admin) since it exposes also system level information. Unfortunately is not simple enough and requires a steep learning curve if wanting to change something, I found no support, groups, or documentation illustrating how to customize it. Not being readily customizable to turn it into something simple (like being able to allow multi user access to a set of triggers) made me almost immediately look elsewhere for my needs.

I have also used webIOPi, by Eric Ptak (aka trouch) he's been great and the system works OK... there are several issues, lacks of authentication which I worked around with a small php login script, but the way webIOPI is built required me to use ProxyPass directive and jumpt through hoops to have it all working. Problem though was that after all the hard work I ended up with an unreliable and too often unresponsive system. There could  be a sporadic delay in execution, but they are so frequent they became unacceptable to let it control anything. 
To try and fix responsiveness as it was happening in patterns that would lead to think it might have been due to dynamic overclocking kicking in and out depending on activity, I tried overclocking and keep the clock steady (at 900MHz), but that made no difference in responsiveness as commands triggered continue to get delayed and queued with delay. 
I also tried using new equipment (wireless N router, oversized 2A power adapter to make sure there would be no downclocking due to low power) to minimize possible slowdowns that could've been attributed to hardware. Nothing worked. WebIOPI is a promising system, but not ready for prime time, I also had to work using quo.js to make the UI compatible with touch events on mobile OSes, but all in all I hope it moves forward eventually since it's a nice system overall that only need more resources and love by more than just 1 dedicated person. Eric announced that will take some time off after diving in and supporting daily the community with his invaluable help.. I hope he'll get some funding and bring webIOPi to fruition for an affordable fee... but until then webIOPi won't do for me.

So out of frustration and need to get things done I went digging and found an old instructable for "raspberrypi-gpio" - a web based interface for the Raspberry Pi GPIO pins with the project hosted on google code

After a few road bumps I had it all working... the lag wasn't terrible and because values of pins are stored in database the reliability was pretty good. The problem that eventually led me to drop it was that starting the service as suggested in the help thread on the instructable page by Daniel Curzon (the author of the useful how-to), caused 2 problems 1) user is prompted by a refresh timing when the script launches and for a headless system this is a deal-breaker already, 2) even when connected to monitor and keyboard and setting the value, the script causes an endless loop that de-facto impedes a full startup and hence causes errors as php/mySQL aren't accessible. Not willing to deal with it all I had to drop it... besides the so-so responsiveness (at times about 4 sec to trigger a pin) wasn't a great motivator to troubleshoot.

So I landed on web2py which at first I didn't get into for lack of experience with python and because there were solutions I was more confident about as they were using LAMP setup basically with a python server pre-made (like webIOPi)...

Still not very straight forward for a noob on web2py and python... so I'll treasure any info anyone will take the time to send my way. 

Thanks for your time and help!

Cheers :)

Jason (spot) Brower

unread,
Jun 5, 2013, 11:48:43 PM6/5/13
to web...@googlegroups.com
Hi there, I wouldn't say we are a small community.  But BIG questions take BIG answers.  So it's a pain to answer some of these questions. Infact, your "bump" was even wordy.
I have done projects with arduino and raspberry pi many times.  Even as part of my business.
You question is 60% raspberry and 10% web2py and 30% programming.
I didn't read the entire instructables.  But in doing robotics with web2py, the best route if you want the best control is as follows.
You create 2 basic objects, the web frontend, and a small service in the backend.
I don't deal with the GPIO's much, but if you need an application to keep it "on" in a particular pin, you will need an app to do that. Also helps if you want to further automate and not just have it reacte to web events. (like reacting to a sensor)
So it's a pretty vague response.  But still, I don't quite know what your wanting.  We can have the conversation here, or you can contact me directly and I can help you out there too.
Your lucky, this list is so busy I am usually not subscribed.
BR,
Jason Brower


--
 
---
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

freäk qnc

unread,
Jun 6, 2013, 2:50:09 AM6/6/13
to web...@googlegroups.com
Hi Jason, 

Thanks for your reply. You're right it's a group of about 5k users, although I must say that while on webiopi group with less than 150 users I would get an answer on the same day, which I thought was amazing given the few users and just one developer. I guess the more users the more difficult to get answers as many ask and few can provide an answer. 

Regarding the verbosity of my post you may notice that my original post had a mere 5 lines (well on my large screen it is at least ;D), before I stated "My experience so far to give you a bit of background context..." which was only a recount to give those interested in reading further, an idea about what I had tried before landing on web2py, but was not to needed to understand what I was asking in the prior paragraph.

About the bump, mine didn't mean to be one (which was also about 4 lines long going by my screen). In all honesty I was just thanking everyone on my way out. 
I had spent several sleepless nights digging for info and reading docs to make this work and that got me nowhere. In the meantime the author of the referenced instructable was nice enough to get back to me, but unfortunately it was (in short) with a "sorry can't be of more help" reply. So I figured it wasn't meant for me to go down the web2py path.

I didn't look at what I was asking in terms of percentages, I thought web2py on raspberry isn't much different than web2py on linux, so I thought I was asking 100% about python programming in web2py, while referencing the small application in the linked instructable tutorial, my bad. Anyone curious or wanting to help would have only needed to install that same app on a raspberrypi to replicate understand what was being asked.

Thank you for the generic info which validate what I already knew. Indeed there is the need of a "deamon" or service running on the same host where web2py is installed to have a permanent listener to events (whether triggered by webUI or a sensor change). In the case of the referenced instructable, that'd be the "GPIOServer.py", which once launched (by rooting into the raspberrypi), it will stop for unknown reasons after an unmetered amount of time but surely more than a couple hours. That's already a deal breaker if I can't manage to have that script running reliably and continuously upon each reboot. I haven't tried an /etc/init.d/GPIOServer.py defaults perhaps will do that just before I drop the web2py option.

Concluding, the help I was asking for was by a fellow tinkerer who had followed the same instructable, was about to, or was willing to follow and replicate the same steps. Without doing that, I am aware that the reply would most likely have been "I don't quite know what your wanting." ;D 

To know what I am trying to achieve and the issues I'm experiencing, all that's needed it's simply to upload the application in the instructable on a web2py installation running on a raspberrypi. At that point after following the same steps, it would be clear what I'm asking and, for those with more experience and knowledge than I, it would probably be relatively easy to spot what's needed to be done in order to: 
1) have the GPIOServer.py running without stopping, 
2) have the UI buttons change from simulating button presses on a remote, to a simple click/ON (to set GPIO pin high) and click/OFF (to set the same GPIO pin low)

Thanks once again for the much appreciated reply and for your suggestions to help with this project.

Cheers! :)

Jason (spot) Brower

unread,
Jun 10, 2013, 3:31:56 AM6/10/13
to web...@googlegroups.com
HI,
I'm not totally sure what the gpio file is about, but an easy way to do it is to have while loop in a python file.  Each time it goes through the loop it can do things like check the serial line for sensor data, run any automated items like turning on the lights in the evening, and read for messages that where sent to the server from the internal network. I used ampy back in the day: https://launchpad.net/ampy with that system running, you can check for data from the network and send it as a command to your device.  It's not web2py at this point.  web2py only assembles the ampy messages that are clicked on and sends them to your service running the the backend.
I'd be happy to help you there if you like.  But it's not very web2py related, so I think it should be off list.  Time is limited for me, but we could do something. :)
BR,
Jason Brower

António Ramos

unread,
Jun 10, 2013, 3:54:27 AM6/10/13
to web...@googlegroups.com
Sorry to disappoint you but raspberry pi go a lot better with nodejs javascrcipt framework.Almost no CPU usage....

check this


2013/6/10 Jason (spot) Brower <enco...@gmail.com>

Jason (spot) Brower

unread,
Jun 10, 2013, 4:21:32 AM6/10/13
to web...@googlegroups.com
Sounds interesting.  Personally my system ran with very little cpu at all.  There are way to make it run effeciently.
Node is a fun new technology, but I personally don't trust it for commercial use yet.  It's still at that young and fragmenting stage so the technology could change to fast. :)
Have fun and it would be great to see what you do with the pi.
BR,
Jason

frea...@gmail.com

unread,
Jun 10, 2013, 4:55:20 AM6/10/13
to web...@googlegroups.com
Thanks Jason and Antonio for your help.

Jason, thanks for the additional tips and info. You are right is not web2py related, it's just python related when it comes to having the GPIO working, then again anything assembled with web2py is related to it... the GPIO file contains that while loop you talked about and that's what is necessary to have an event listener as mentioned earlier. Again if not replicating that project we'll continue to have a "failure to communicate", so I agree, it's best we leave it at that as I've also already dropped web2py althogether since it won't do for me and many who like me are looking for an implementation that would work with more simplicity. So I'l off to other option, but I thank you again for your time and help Jason.

About NodeJS, I believe you might be incorrect. Is not as "new" as you think and is already being heavily used for commercial and critical use already... one company making use of it for instance, is Google, as I've been told directly by a Google employee I know.

Anyway I am really glad Antonio passed along the info... first of all I love to see more technologies reaching the pi world and empowering the pi platform, and also because coincidentally I've started to get into nodejs since a short while so that'll be a great learning project from me. Muchisimas gracias por el enlace Antonio! :)

Cheers! ;D


You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/IhMsvEHjmW4/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

António Ramos

unread,
Jun 10, 2013, 6:21:50 AM6/10/13
to web...@googlegroups.com
I' not spanishhh.
Portuguese from Portugal.

I have a web2py app to control all outside workers via an RFID reader. I use arduino to read the card and send it via serial. Then in the local PC  I have nodejs to read it and call a web2py service that via tornado sockets updates a web page.
My web2py app is in the amazon cloud. It works so fasttttttttt just under 20 lines of nodejs.amazing!
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/IhMsvEHjmW4/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Massimo Di Pierro

unread,
Jun 10, 2013, 9:14:56 AM6/10/13
to web...@googlegroups.com
Tell us more. Have some pictures or screenshots?
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
 
---
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+unsubscribe@googlegroups.com.

António Ramos

unread,
Jun 10, 2013, 10:46:55 AM6/10/13
to web...@googlegroups.com
I´m working on putting here some screenshots or a video showing it.
So far
My arduino hardware...


I use:
fullcalendar
pypdf for the printing cards on the rfid card
D3js
Filepicker.io, allows to take pictures to workers from the browser page!!!
Tornado messaging websockets
Coffeescript
and of course 
WEB2PY

I lied, its not under 20 lines of nodejs . Its about 53 lines. Yet, in python i would need some more....








2013/6/10 Massimo Di Pierro <massimo....@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

frea...@gmail.com

unread,
Jun 10, 2013, 2:39:39 PM6/10/13
to web...@googlegroups.com
Sorry my bad deduction ;P Eu no falo Portugues (only IT/EN/ES)... but in all cases: muito obrigado Antonio! :D

frea...@gmail.com

unread,
Jun 10, 2013, 2:51:06 PM6/10/13
to web...@googlegroups.com
Very interesting indeed! I'd love to read your blog/tutorial or watch your video on this project. Very interesting one... btw I love the wooden box for the RFID.
Keep up the great work Antonio!

Cheers! :)

To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Massimo Di Pierro

unread,
Jun 10, 2013, 3:58:16 PM6/10/13
to web...@googlegroups.com
Yes the wooden box is fantastic!

António Ramos

unread,
Jun 10, 2013, 4:40:12 PM6/10/13
to web...@googlegroups.com
The woden box its one piece only with a hole to fix the arduino nano and the rfid reader.
A friend made it. 
I asked him to make another one. 
I need 2 boxes, one to be used in the entrance of our company, so users can pass the card to enter.
The other to be used by our security dept to issue cards  to new users.
They take the foto of the user , then read the tag from the tag directly from the web page, directly to the rfid tag field.
All web, all web2py.


António Ramos

unread,
Jun 12, 2013, 12:35:39 PM6/12/13
to web...@googlegroups.com


2013/6/10 António Ramos <ramst...@gmail.com>

Jason (spot) Brower

unread,
Jun 13, 2013, 3:16:49 AM6/13/13
to web...@googlegroups.com
This is great!  If you want.  Make the video as a tutorial and I can do the voice over and effects work.  I do it for part of my living right now.
https://www.youtube.com/user/BitbarChannel These videos use my voice.  It's for a really powerful android testing platform.
BR,
Jason Brower

frea...@gmail.com

unread,
Jun 13, 2013, 1:57:26 PM6/13/13
to web...@googlegroups.com
Antonio, I kind of understand some of it because I know your project a bit from what you said on the thread, but you should probably do something more in detail, perhaps showing step by step from the "user" side with no tech info and one longer with step by step info for people who want to replicate... you could post your project (if you want to share it) on instructable.com or your blog.

Thanks again for sharing your work Antonio much appreciated

Cheers! :)
Reply all
Reply to author
Forward
0 new messages