Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Home automation implementation

 
Greenhorn
Posts: 2
Mac Netbeans IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm currently in the design phase of my home automation program.

Here is the setup i'm thinking about:
- Raspberry pi: Tomcat & java
- Arduino: Hardware (relays, ...)

My main issue is that i don't know which technologies i should use to make work what i have in mind.

This is what i have in mind.

The arduino is just a simple slave to the raspberry pi.
Whatever command the PI gives (over usb serial), the arduino executes.
The arduino also gives feedback to the pi (ex: when a hardware wall button is being pressed).

On the Pi part, i was considering to use JSF for the frontend stuff (with tomcat).
For the backend stuff (also on the pi) i'm not quite sure.
The backend handling should be a program that's constantly running and listening for data from the arduino. I'll call it the "background daemon" for now.
On the other side, JSF needs to be able to talk to this background daemon.
It is really important that this background daemon is running 24/7 to be up to date on the status of the house.

For the record, Jave EE is new to me.
In the past i have created a home automation program before (java SE), but this was much more scaled down.
It included it's own webserver (own code), but was hard to manage, therefore my intrest in tomcat and JSF.

Can someone point me in the right direction?
 
Bartender
Posts: 2653
18
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tom, thanks for posting.
I can't recommend on the PI part as I have no experience with the platform.

Just a question: why do you want to deploy a J2EE engine for your design?
 
Tom Van der Auwera
Greenhorn
Posts: 2
Mac Netbeans IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have done an home automation project before.
I was spending more time on making the http server to work then the actual controlling of the hardware.
I just don't want to bother with the http server party anymore.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would something like WebIOPi work for you? It's a readymade sensor monitoring web application and is quite popular among Pi enthusiasts.
Edit: I should add that I suggested WebIOPi because it's readymade. Tomcat + JSF + Pi4J is a possible solution, but you'll still have to write front end+controller logic (which as I understood it, you wish to avoid). Personally, I never liked JSF, and if I were doing this, I'd make it a singe page web application using a javascript framework like jquery UI + ajax and use Tomcat purely as a REST server.

Also, I didn't quite understand why there is an Arduino. Are there some analog inputs involved here? A Pi is capable of receiving inputs from switches and sending outputs to relays without using an arduino.

 
Ranch Hand
Posts: 789
Python C++ Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whatever you use, make sure it has high noise immunity since you are going to run it all over your house. Something like RS-485 would work. Nothing is worse than getting a design working and then having to do it all over because it was susceptible to noise. I had a nightmare scenario like that back when I was learning. It was in a restaurant where there were long runs and neon lights everywhere. There was many volts of noise on the runs.
 
Bartender
Posts: 20934
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've done a lot of projects for the Raspberry Pi over the last year. The Pi+Arduino combo is very popular, although for simpler projects, the GPIO facilities built into the Pi can be useful and there are some good shields for it. For that matter, you can make a decent control panel with a shield that incorporates an LCD display and pushbuttons of which I think you can find several models.

My original Home Automation system is X10-based, but support for that platform is not very good anymore. The X10/web controller I bought was effectively useless, in fact, because among other things, the web interface was so slow and error-prone that it made X-10 itself look fast and reliable.

These days I've been looking more at ZigBee/XBee. There are several commercial Home Automation product lines using that as a basis and it's relatively easy to talk to them (I have an adapter board that provides USB-to-XBee communication). And it's easy to work with the XBee units themselves. A garage door monitor requires almost nothing more than an XBee, a battery, and a tilt switch.

As forum moderator for JSF, it's hardly becoming for me to discourage JSF, but I've never tried full-bore J2EE on the Pi myself. While basic Java obviously performs well (Minecraft!), J2EE can be more demanding, both in the completeness of the JDKs and in memory hunger. I'd probably consider using something like node.js or pythong/django as a web platform.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!