Tag Archive: Domotiga


At long last I found the time to get Gambas2 compiled and running on Raspberry Pi with Raspbian Wheezy and DomotiGa (http://domotiga.nl).

Things were made extra hard by my determination to not expand the 2GB rootfs so I had to strip some stuff out- but it does mean you can restore to any SD card 2GB or larger.

SSH is enabled but I didn’t put vncserver on this time.

I didn’t document the process- but essentially kept trying to

./configure

gambas2 and each time an error came up I used http://www.debian.org/distrib/packages to try and determine what I needed to install. Because of the lack of free space I had to wget and

dpkg –I

to install many of the packages- I couldn’t use

apt-get

. I used

df –h

to check on free space as I went and

find / -type f -size +5000k

to find and remove large files (cache/docs etc).

Shell login: pi
Shell password: raspberry
Mysql root password: raspberry

Download

http://tickett.net/downloads/raspbian_gambas_domotiga.img.7z
http://tickett.net/downloads/raspbian_gambas_domotiga.img.7z.md5

Mirror

http://speedy.sh/J3MhY/raspbian-gambas-domotiga.img.7z
http://speedy.sh/srE7C/raspbian-gambas-domotiga.img.7z.md5

Please let me know how you get on!

L

Advertisements

*EDIT* This image has now been succeeded by a Raspbian / Wheezy based image: My raspbian SD image is now available: https://tickett.wordpress.com/2012/08/16/raspbian-wheezy-gambas2-domotiga/

After an earlier post https://tickett.wordpress.com/2012/06/05/domotiga-running-on-raspberry-pi/ I received a few requests for the sd card image. So here it is.

The following are all the login/passwords you may need:

login: pi/raspberry
msql: root/raspberry
vnc: raspberry

This is based on the official Raspberry Pi debian squeeze image, with the following additional items installed:

ssh enabled
mysql-server
tightvncserver
subversion
gambas2.24

It just fits on a 2 GB card:

pi@raspberrypi:~/domotiga$ df -H
Filesystem Size Used Avail Use% Mounted on
tmpfs 98M 0 98M 0% /lib/init/rw
udev 11M 148k 11M 2% /dev
tmpfs 98M 0 98M 0% /dev/shm
rootfs 1.7G 1.5G 60M 97% /
/dev/mmcblk0p1 79M 29M 50M 37% /boot
pi@raspberrypi:~/domotiga$

All packages have been upgraded to their latest stable version from the squeeze repository.

If you don’t know how to get into the guy, you can either login to the console then run:

startx

Or via ssh run:

vncserver :1 –geometry 1024x728 –depth 16

Then use any vnc client to connect to the desktop. Now execute gambas2 from the run menu:

I have already opened the DomotiGa project so just click on it:

Click "Run" from the toolbar, Debug menu or press F5:

Download links:

http://tickett.net/downloads/raspi_squeeze_gambas2_domotiga.img.7z

http://tickett.net/downloads/raspi_squeeze_gambas2_domotiga.img.7z.md5sum

Mirror:

http://speedy.sh/nAMsr/raspi-squeeze-gambas2-domotiga.img.7z
http://speedy.sh/v9ETB/raspi-squeeze-gambas2-domotiga.img.7z.md5sum

Let me know how you get on!

L

With some difficulty I have managed to get Gambas 3.1.1 running in Debian Wheezy Arm on Raspberry Pi:

I think DomotiGa has only just started to be ported to Gambas3- but it looks good:

Let’s get coding!

L

Thanks to ADH Heating Services I now have jeenodes counting pulses from my mains cold water supply:


Boiler hot water outlet:


And gas meter:


The pulses are being pulled into DomotiGa:

Which allows me to graph with RRDTool:

I also created my own module for DomotiGa to hook up to my custom 433Mhz RF receiving jeenode- I now have my window/door sensors (along with a bunch of rogue devices?) appearing:


I’m not best sure how to tackle the fact that the devices don’t issue an idle command when the alert has finished (i.e. when the door is closed or the fire is put out?). I’m considering trying out the built in DomotiGa feature to revert the values after 1minute or so (the smoke alarm should continue to send data whilst the alarm is being sounded so this shouldn’t be a problem).

I’m still troubleshooting a few problems- for example USB serial ports failing to open with error: "Cannot open serial port (#5)":

And some jeenodes going offline. Hopefully I will have more time to look into this later in the week.

L

I wrote another little shell script / python script to pull the status & current playing track name:

import xml.etree.cElementTree as XML import requests endpoint = '/MediaRenderer/AVTransport/Control' action = '"urn:schemas-upnp-org:service:AVTransport:1#GetTransportInfo"' body = '<u:GetTransportInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetTransportInfo>' headers = { 'Content-Type': 'text/xml', 'SOAPACTION': action } soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>' + body + '</s:Body></s:Envelope>' r = requests.post('http://192.168.0.218:1400' + endpoint, data=soap, headers=headers) dom = XML.fromstring(r.content) print dom.findtext('.//CurrentTransportState') action = '"urn:schemas-upnp-org:service:AVTransport:1#GetPositionInfo"' body = '<u:GetPositionInfo xmlns:u="urn:schemas-upnp-org:service:AVTransport:1"><InstanceID>0</InstanceID><Channel>Master</Channel></u:GetPositionInfo>' headers = { 'Content-Type': 'text/xml', 'SOAPACTION': action } soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>' + body + '</s:Body></s:Envelope>' r = requests.post('http://192.168.0.218:1400' + endpoint, data=soap, headers=headers) dom = XML.fromstring(r.content) track = {} import re print re.search('<dc:title>(.*)</dc:title>', dom.findtext('.//TrackMetaData'), re.IGNORECASE).group(1)

See:

I also got lighttpd & php5 up and running on my raspberry pi running domotiga so I can access the web interface:

Now I’m trying to get the 433Mhz door/window sensors connected but first I need to work out how to decode the rf packets. I tapped into my jeelabs 433Mhz ook plug and built a circuit similar to that described here: http://wiki.nethome.nu/doku.php/analyzer/hardware

I didn’t have all the right bits handy but it worked regardless!

After doing some captures in Protcol Analyzer I think I have determined the pulse width to be around 1500μs:

But I’m still at a bit of a loss how to then decode (I’m hoping I can somehow separate each "data packet" then compare packets origination from two different sensors) then work out which bit relates to the "house code" etc

Here’s a sample of the hex data:

Door Sensor #1

0000 0067 0000 0019 0017 003b 0040 0012 0040 0012 0040 0012 0017 003b 0040 0012 0017 003b 0016 003b 0017 003b 0040 0012 0040 0012 0040 0013 0016 003b 0040 0012 0017 003b 0040 0012 0016 003c 003f 0013 0016 003b 0040 0013 003f 0013 003f 0013 0016 003c 0016 003b 0016 0279

0000 0067 0000 0019 0016 003b 0040 0012 0040 0011 0040 0012 0017 003a 0040 0011 0018 003a 0016 003b 0018 003a 0040 0011 0040 0013 0040 0011 0018 003a 0040 0012 0016 003c 003f 0013 0016 003b 0040 0012 0016 003c 003f 0012 0040 0013 003f 0013 0016 003c 0016 003b 0016 0279

0000 0067 0000 0019 0018 0039 0041 0010 0040 0011 0040 0011 0018 003a 0040 0010 001a 0038 0019 0038 001a 0037 0042 000f 0040 0012 0040 0012 0017 003a 0040 0011 0017 003b 0040 0012 0017 003a 0040 0012 0017 003a 0040 0011 0040 0012 0040 0012 0017 003b 0016 003b 0017 0277

Door Sensor #2

0000 0067 0000 0019 0016 0038 003b 0010 0016 0039 0016 0038 0016 0038 003a 0011 0016 0039 0016 0038 0016 0038 003a 0011 003a 0011 003a 0011 0016 0038 003a 0011 0016 0039 0039 0011 0016 0039 0039 0012 0015 0039 0039 0012 0039 0012 0039 0012 0015 0039 0015 0039 0016 0265

0000 0067 0000 0019 0016 0038 003a 0011 0016 0038 0016 0038 0016 0039 003a 0010 0016 0039 0016 0038 0016 0038 003a 0011 003a 0011 003a 0011 0016 0038 003a 0011 0016 0038 003a 0011 0016 0039 0039 0012 0015 0039 0039 0012 0039 0012 0039 0011 0016 0039 0015 0039 0015 0266

0000 0067 0000 0019 0016 0038 003a 0011 0016 0038 0016 0038 0016 0039 003a 0011 0015 0039 0016 0038 0016 0039 0039 0011 003a 0011 003a 0011 0016 0039 0039 0011 0016 0039 0039 0012 0015 0039 0039 0012 0015 0039 0039 0012 0039 0012 0039 0012 0015 0039 0015 0039 0016 0265

L

Last post today, I promise!

After my breakthrough earlier getting gambas2 working in debian on one of my Raspberry Pis, then getting DomotiGa running I’ve managed to hook a jeenode up to the pi running the rf12demo sketch and it’s automatically picked up my jeenode running the roomnode.3 sketch:

So much to do, so little time!

The great thing is the data is now being stored in mysql hopefully in just the right way to allow the sort of querying & reporting I want to be able to do (and the main reason I ditched home automation hub).

L

I have been making a lot of changes the network recently so thought it was time to sketch it out:

The left hand stack is housed in the A/V rack/closet and the right stack is housed in the garage rack. To clarify a few points:

  • The two switches are linked using a 2 x 1 gigabit fibre trunk
  • The ESX servers and file servers are connected to the switch using 2 x 1 gigabit ethernet trunks
  • There ET9000, XBMC, Apple TV 2, HDMI Matrix and Sonos devices can all be controlled from smartphones, pcs etc
  • The ET9000 records to the file server
  • The Sonos Connect / ZonePlayer 90 is connected to the Onkyo Amp to allow Sonos to output to my home theatre
  • The Sonos Connect / ZonePlayer 90 is connected to the Apple TV to allow streaming from iTunes/iOS devices to all zones
  • I haven’t bothered to include my router, wireless access points, client pcs, smartphones, printers and various other devices in the diagram

The wireless sensor network provides:

  • Whole house power consumption currently using a CurrentCost EnviR
  • Individual appliance power consumption (currently monitoring 6 appliances using CurrentCost IAMs)
  • Environment information (temperature, light, humidity) using Jeelabs Jeenodes in multiple zones

This is a good reference point for where I’m headed (not much progress since I last listed but alas, still the way forward):

  • Further appliance monitoring and more importantly control (potentially through upcoming project/device: HexaBus – https://github.com/mysmartgrid/hexabus/wiki or plugwise – http://www.plugwise.com/idplugtype-g/)
  • Security cameras (and doorbell integration)
  • Environmental information (I have pulse counters for my gas meter and water/central heating system that need installing)
  • XBMC hardware replacement (once the Raspberry Pi – http://www.raspberrypi.org/ is available to buy I’d like to replace my Acer Revo)
  • Home Automation Hub replacement (once the Raspberry Pi is available to buy I’d like to try Domitiga – http://www.domotiga.nl/ or my own custom solution)
  • Web Interface (to bring all of the information together from the wireless sensor network, along with the state of all network devices (from bandwidth to free space etc) and most importantly allow central control- so instead of me having to use different methods to switch on the ET9000, change the channel on the HDMI matrix, power on the amp etc, I can do it all with one button)

As usual- I imagine I’ve missed a few bits out from the above but it hopefully provides a good overview of my network.

L

%d bloggers like this: