Web Server for Home Automation/Control

2,319 views
Skip to first unread message

chiques

unread,
Dec 4, 2011, 1:19:01 PM12/4/11
to Beagle Board
Hello Fellow Beagleboard Community Members,

I am writing this post on the basis I have limited knowledge to C/C++
programming and very limited knowledge of creating webservers.

My goal is to design my own DIY home automation using the Beagleboard
and any applicable modules (e.g. AtTinyXX controller).


This is what I "THINK" I need to set up:

1. Load Apache Web Server on my BB

2. Write some QT Code to interface a browser with the I/O ports on the
BB which will in turn send signals to my AtTiny controller.


I am a hardware EE so the latter (#2) is what I expect to be the
challenge.

The reason I am posting this is because I'd like to input on my
choices to load Apache on the BB. Is this the wisest decision or is
there something more practical.

Any advice or comments is greatly appreciated.

Giorgionetg

unread,
Dec 6, 2011, 6:14:08 AM12/6/11
to beagl...@googlegroups.com
I'm still waiting my BeagleBone to do the same your thing.. :) and also to support my website (hosted, not dedicated server) to make a spider web, and manage the processing about large images files (to resize)..

Let me know if u find some problems.. :)
I'm tuned!! ^^

Mustafa Aldemir

unread,
Dec 6, 2011, 9:54:35 AM12/6/11
to beagl...@googlegroups.com


2011/12/4 chiques <bajag...@gmail.com>
Hi,

I don't really have any experience with home automation but I can give you a few starting ideas.

- You can control your system remotely through the browser. You don't need QT or similar interface.
- You can run an Apache web server on the BB
- You can call system commands from PHP. http://php.net/manual/en/function.system.php
- You can control the GPIO on BB with a C/C++ program.

To sum up, write and compile a program in C/C++ to interface your BB with ATTiny (or anything). Make a webpage in PHP which simply calls this program.

I hope it gives you an idea.

mark hubrich

unread,
Dec 6, 2011, 11:36:14 AM12/6/11
to beagl...@googlegroups.com

I'm kinda doing the same thing but sending serial strings out the usb to an arduino running firmata. Since I haven't figured out the gpio on my beagle yet.

On Dec 6, 2011 8:54 AM, "Mustafa Aldemir" <mus...@aldemir.net> wrote:



2011/12/4 chiques <bajag...@gmail.com> > > Hello Fellow Beagleboard Community Members, > > I am wr...

Hi,

I don't really have any experience with home automation but I can give you a few starting ideas.

- You can control your system remotely through the browser. You don't need QT or similar interface.
- You can run an Apache web server on the BB
- You can call system commands from PHP. http://php.net/manual/en/function.system.php
- You can control the GPIO on BB with a C/C++ program.

To sum up, write and compile a program in C/C++ to interface your BB with ATTiny (or anything). Make a webpage in PHP which simply calls this program.

I hope it gives you an idea.

-- You received this message because you are subscribed to the Google Groups "Beagle Board" group...

MarioACIC

unread,
Jan 5, 2012, 2:09:00 PM1/5/12
to beagl...@googlegroups.com
might give you a look at the following link for a similar project

http://proyectotea.wordpress.com/about-tea/

I hope to be helpful in your purposes,

vitoracmm

unread,
Jan 5, 2012, 2:28:56 PM1/5/12
to Beagle Board
Hi, why to use Apache Web Server , u could code everything in nodeJS
nodejs is really powerfull and scalable and easy to code, u have full
control of everything on web responses and requests

a simple example of a server would be

var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(80, "127.0.0.1");

This would serve a webpage containing Hello World basic example... U
could do everything u want served by the way u want,web pages,files,
data streams..
Instead of wello world u could serve a web page with the IO's status
on beagle bone.

I recommended u to play arround nodeJS (go to nodejs homepage they
have all well documented with lots of examples) and u won't be
disappointed

Regrads







mark hubrich

unread,
Jan 5, 2012, 3:41:49 PM1/5/12
to beagl...@googlegroups.com

The NPM also makes it even more simple.

-- You received this message because you are subscribed to the Google Groups "Beagle Board" ...

Dave Hylands

unread,
Jan 5, 2012, 4:17:26 PM1/5/12
to beagl...@googlegroups.com
On Thu, Jan 5, 2012 at 11:09 AM, MarioACIC <mquint...@gmail.com> wrote:
> might give you a look at the following link for a similar project
>
> http://proyectotea.wordpress.com/about-tea/

This is another weather based project using BeagleBoard:
http://oww.sourceforge.net/

I would expect that a much smaller web server like Mongoose would be
appropriate:
http://code.google.com/p/mongoose/

--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

Giorgionetg

unread,
Jan 24, 2012, 2:35:53 AM1/24/12
to beagl...@googlegroups.com
Hi chiques, have you solve the problem with BB??
I worked just a little bit on node.js, but I'd like so much to feel at home (ubuntu, apache, mysql)...

Let me know... :)

Con

unread,
Jan 24, 2012, 12:48:11 PM1/24/12
to Beagle Board
Hi there,
a couple of us here in Dublin are doing similar work. I have a
heating controller, based on an Arduino, and a an XBee modem.
Currently, I control this using a small windows Netbook, also with an
XBee modem attached, and running Apache.

The plan is to use the Beaglebone in place of the Windows box, Node.js
in place of apache. Functions on the Node.js server will be exposed as
RESTfull Web Services, consumed by an iPhone App.

All is going well so far. If there is anything specific I can help you
with, let me know.

Cheers,
Con

Jake

unread,
Jan 24, 2012, 11:28:58 PM1/24/12
to beagl...@googlegroups.com
Con,

Thanks for your offer to help.  I am starting to learn nodejs and javascript, and have some basic questions:

I would like to create a webpage (hosted on the beagleboard) with a button, that when clicked, sends a message over the beagleboard UART.  I am having trouble understanding how the button on the webpage would be linked to the nodejs SerialPort function.  I think the button on the webpage would be written in client-side javascript, but how does this notify the server-side nodejs script of the button click action?

Also, I have read the standard Hello World nodejs example.  But how do you replace the overly-simple Hello World string with an HTML file (e.g. index.html) that has links to client-side javascript files?  Then, as I mentioned above, like a button back to the nodejs serialport?

Thanks!
Jake

pezman

unread,
Jan 25, 2012, 6:47:08 AM1/25/12
to Beagle Board
My $0.02 is that node-xmpp in combination with a cloud service like
Nimbits or Pachube is the cleanest way to make an automation server.
In particular, it lets the bb push information readily. For
example, if someone turns a light on, the bb will send an IM to
Nimbits or Pachube. Conversely, if you want to turn a light on
remotely, you can just send the bb an IM.

At any rate, xmpp is inherently more interactive, since it's a p2p
protocol, and as a result it seems to make for a more natural proxy
for physical computing.

Con

unread,
Jan 25, 2012, 9:02:00 AM1/25/12
to Beagle Board
Hi Jake,
I've taken a slightly different approach - I expose functions on the
BB (written in Node.js) as Web Services. Have a look at
http://mobile.rdacorp.com/2011/10/creating-nodejs-web-service.html for
some sample code. Then I call the web services from Javascript on the
client side. You use a thing called XMLHTTPRequest.... google for that
and you will get plenty of examples.

HTH.

Keep at it!

Cheers,
Con

Jake

unread,
Jan 25, 2012, 6:16:47 PM1/25/12
to beagl...@googlegroups.com
Thanks so much for the advice. I will look into those.

Thanks again,
Jake

Jesse

unread,
Jan 26, 2012, 7:50:55 PM1/26/12
to Beagle Board
I too have been interested in using the BeagleBone for home automation
use. I recently released a simple project named webLightSwitch which
implements a web server in node.js and runs on the BeagleBone to serve
up a jQuery Mobile web interface. The interface provides a means to
turn the registered lights on or off. The lights have INSTEON lighting
controllers attached. The web server code communicates through a
serial interface, using node-serialport, to a USB INSTEON PowerLinc
Modem to control the lights. You can more information at the project
page here: http://beagleboard.org/project/webLightSwitch/

- Jesse

Jake

unread,
Jan 29, 2012, 6:09:09 PM1/29/12
to beagl...@googlegroups.com
Thanks for all the links, advice and pointers.  They we crucial.  

I was able to implement two way communication with nodejs and socket.io

bbx10node

unread,
Jan 31, 2012, 12:24:46 AM1/31/12
to Beagle Board
I wrote node.js code for a Beaglebone and socket.io to send
commands to an X10 CM15A controller with USB interface. All clients
see the same control panel with on/off status indicators. The
indicators change in real-time as lights are turned on and off.
https://github.com/bbx10/bbx10node

The hard work of talking to the CM15A controller is done by another
program named mochad from http://sourceforge.net/projects/mochad.
mochad builds without problems using gcc pre-installed on the
Beaglebone. See the following for details.
http://sf.net/apps/mediawiki/mochad/index.php?title=BeagleBone_running_Angstrom_Linux
Reply all
Reply to author
Forward
0 new messages