[maemo-developers] N800 as a home automation/monitoring remote
From: David Greaves david at dgreaves.comDate: Wed Jun 18 16:33:14 EEST 2008
- Previous message: N800 as a home automation/monitoring remote
- Next message: N800 as a home automation/monitoring remote
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Some personal ramblings based on skim reading the glib/gtk docs for only a few days :) Mike Ferguson wrote: > Hi all. > > I think I'd like to try to use my N800 as a remote terminal for home > automation/monitoring and would like some advice about whether I'm > thinking along the right lines. You better know up front I'm not an > experienced C programmer, but know other languages, and have done some > basic C things, they just take me a while and some research. I it were me then I'd look to Python. Then you don't have to focus on the C memory management/non-oo/data-structuring crap. I'm writing one gui app in C/gtk to atone for my hubris in thinking I could "knock one up tonight" and then I'll run screaming to C++/python <grin> FWIW I'm using snippets of: * gtk+ * glib * hildon * dbus * gconf all of which look massively easier in python! > My current thoughts are: > > *** Client *** > N800 (and therefore other PCs etc) used a GIOchannel to connect to > server asynchronously, so either server or client can push data or > requests to each other. Having just read up on gconf I'd look at that. It can use corba behind the scenes. It also has support for notification changes - so if a configuration value changes then all subscribed clients see it. It also may solve 90% of your other problems. http://www.gnome.org/projects/gconf/ kinda depends on the corba implementation on maemo - is that still there? a ps tells me that messagebus is running /usr/lib/gconf2/gconfd-2 so that looks good... > A GTK notebook layout approach for different automation functions etc. pygtk should make this straightforward > Server can push status/change notifications to client which will > update button state/image (e.g. light has gone on, alarm etc) Handled by gconf - no need to write a client/server. > A really smart client would be able to request from the server what to > display, but at least from now I'm more than happy to start with a > hard coded client. Possibly use the buildable (?) type infrastructure which allows the specification of a GUI via xml. > Eventually the clients and server should connect over an SSL stream, > but that can be a further stage of development. I guess what you mean is that you want a secure mechanism to change/view HA values. SSL may come into it but look to see how gconf security works first. > *** Server *** > Again written using GLib and GIOChannel. or gconf. > Possibly use D-Bus to connect to different modules/programmes for > connection to, say, a serial port controlled microcontroller, usb > controlled uC, etc. which do the actual work/monitoring. I've got a > lot of the microcontroller side almost sorted already. That sounds good - but that would presumably be connected to a server? see below > As above in client section - push changes to client. gconf > Can handle multiple clients. gconf > My initial questions are: > > First off, does this whole idea seem OK? Any general thoughts or advice? You're nuts. Sounds fun. Can I play? > Are GIOChannels the best way to go for this on maemo, or straight unix > sockets? Any good examples around of asynchronous GIOChannel > client/server usage I should look at? (I've found a couple of > examples, but not many...) or gconf... > Will keeping the client connected constantly to the server (assuming > no data is being passed back and forward) have any significant effect > on battery life? I.e. Is there a way to minimise battery usage, or do > I just not need to worry? There's an offline mode but my N800 seems to be happy to stay up all night connected to wifi without losing battery. It seems to be down to good event driven coding. > Is the use of a D-Bus approach on the server a good idea, or are there > better ways? I'd say you write a server app that talks direct to the hardware in a modular fashion and then exposes the h/w via a structured data view via .... gconf. This at least is good for state data - how you do streaming data from the front-door webcam whilst you're out on your wi-max connection... > Is anyone aware of a similar project that I can borrow ideas from? ... > And lastly, is anyone willing to act as a mentor to review (bad) code > or point me in the right direction for things? I'm not wanting anyone > to write the code for me, but just to be able to say things like > "check out foo function for an easier way to do bah", "you probably > need to handle X signal" etc. Setup a VC repository (git?) I'm interested in HA too - just never got round to it... > But I guess if anyone else wants to contribute and use the code, I'd > be more than happy to share or set this up as a garage project at some > point, once I know the meager starting code won't be used as an > example of what not to do! I want to setup a home security system and I've thought about other HA things... > > I'm not in a hurry for any of this to happen. It's all a spare time > jobbie over the next year/2 years. > > Any help or thoughts appreciated. Thanks. HTH David
- Previous message: N800 as a home automation/monitoring remote
- Next message: N800 as a home automation/monitoring remote
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]