• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2 3 ... 5
Author Topic: KNX/EIB Home Automation Centre  (Read 58507 times)
erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« on: October 13, 2009, 04:26:59 AM »

Even though there is little 'porting' to do due to the excellent quality of the upstream projects; I've been using


to automate tasks like controlling heating, lighting and closing/opening shutters from a SheevaPlug (used to be a NSLU2). I am currently working on getting the packages in Debian. The tools work with EIB (European Installation Bus) aka KNX.

The interfacing towards the bus is done by eibd-server and linknx is a small daemon that keeps track of simple tasks and states. knxweb provides a AJAX interface on your installation that shows the current state of the system (lights on/off, shutters, heating, temperature, ...). The linknx configuration is done with a XML representation and tasks can be specified (amongst others) on a time base; or even at sunrise/sunset; calculated based on your coordiates.

Installling the packages on a system that ships is peanuts.


* screen.top.png (120.13 KB, 847x588 - viewed 13663 times.)

* Screenshot-Iceweasel.png (373.64 KB, 1002x803 - viewed 10920 times.)
« Last Edit: June 06, 2010, 02:20:38 AM by erpel » Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #1 on: October 13, 2009, 07:24:59 AM »

In order to use knxweb; install the following from a normal Debian repos

Code:
[marc@ahkna ~]$ sudo apt-get install php5-cgi lighttpd


The repos is in my case:

Code:
[marc@ahkna ~]$ cat /etc/apt/sources.list
deb ftp://ftp.nl.debian.org/debian lenny main contrib non-free

enable fastcgi

Code:
[marc@ahkna ~]$ sudo lighttpd-enable-mod fastcgi

Install the backend packages:

Code:
[marc@ahkna ~]$ sudo dpkg -i eibd-clients_0.0.4-2_armel.deb eibd-server_0.0.4-2_armel.deb linknx_0.0.1.26-3_armel.deb pthsem_2.0.7_armel.deb

modify /etc/default/eibd-server and /etc/default/linknx to enable the daemons and to connect to your interface of choice and restart the daemons.

Code:
[marc@ahkna ~]$ sudo /etc/init.d/eibd-server start
[marc@ahkna ~]$ sudo /etc/init.d/linknx start

You should have a basic system. Note that it will only be useful if you modify the /etc/linknx/house.xml configuration to match your addresses and rules.

In order to get the webinterface, download knxweb from sf.net and extract in /var/www/. You will then need to modify the background images and design your layout with the built-in editor (the images will need to be overwritten on your plug, there is no editor support for that as of yet).

Since knxweb generates a lot of http accesses, you might want to disable in /etc/lighttpd/lighttpd.conf the access logging module (mod_accesslog).

Sweet Home 3D (www.sweethome3d.eu/download.js) is a nice cross platform and easy to use 3D modeling tool I used for the att.d screenshot.

I added a repository that contains the relevant debian packages:
Code:
deb http://scorpius.homelinux.org/~marc/debian lenny main contrib non-free
deb-src http://scorpius.homelinux.org/~marc/debian lenny main contrib non-free

A more in detail description/HOWTO of the setup and configuration  can be found on
http://chiana.homelinux.org/~marc/eib_sheeva.html
« Last Edit: May 25, 2010, 08:46:40 AM by erpel » Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #2 on: October 13, 2009, 07:33:37 AM »

FYI: I haven't yet tried moving my HEYU/X-10 setup across from my x86 Linux to the plug, but I see no reason why it wouldn't work and would achieve a similar end...

Rgds

Damon
Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #3 on: October 16, 2009, 02:57:43 AM »

- added support for mysql
- some patch backports
Logged

OmahaVike
Newbie
*

Karma: 0
Posts: 8


View Profile
« Reply #4 on: October 21, 2009, 12:10:02 PM »

FYI: I haven't yet tried moving my HEYU/X-10 setup across from my x86 Linux to the plug, but I see no reason why it wouldn't work and would achieve a similar end...

Rgds

Damon

it's as easy as you think if you're using the serial device.  but..  be careful, some usb2serial adapters don't work.  i have read that the usb x-10 transmitter doesn't work either.
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #5 on: October 21, 2009, 12:36:48 PM »

I was using a (crappy old) USB-to-serial cable before, so no particular reason to believe that it would be worse on a slightly newer Ubuntu.

And I've bought a newer alternative since the old one used to generate errors periodically...

Rgds

Damon
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #6 on: October 21, 2009, 12:45:03 PM »

FYI: I haven't yet tried moving my HEYU/X-10 setup across from my x86 Linux to the plug, but I see no reason why it wouldn't work and would achieve a similar end...
it's as easy as you think if you're using the serial device.  but..  be careful, some usb2serial adapters don't work.  i have read that the usb x-10 transmitter doesn't work either.
FWIW, I use the Serial-to-USB adapters described here on my Plug.  They seem to interoperate fine with the CM11A, as well as with modems and other assorted serial devices, and Ubuntu recognizes them and handles them seamlessly.  I do use a different program (x10d) rather than Hey-U to control the CM11A.  YMMV.
Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #7 on: October 23, 2009, 08:06:22 AM »

linknx 0.0.1.26-5 and eibd-server 0.0.4-4:

- fixed initscripts (update-rc.d was not running)
- fixed dependencies between scripts
- more testing on /var/log/knx and /var/run/knx

Packages are available for Lenny and later on armel and amd64, if someone is interested for other arch, I'll add them to the repos.
Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #8 on: November 01, 2009, 03:29:43 AM »


The previous two points are merely a collection of other available work; hopefully in an easy to use fashion.
Logged

knireis
Jr. Member
**

Karma: 2
Posts: 88


View Profile
« Reply #9 on: November 11, 2009, 05:12:55 AM »


The previous two points are merely a collection of other available work; hopefully in an easy to use fashion.

I followed your instructions and installed your base system on the nand. I also run Debian from SD-card. To make a mulitiboot system i tried to combine following set of bootcommands to a working combination, but it fails to start from nand when the SD-card is not present.

This the set for booting from SD-card:
Code:
setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x400000 0x0800000'

and these from nand:
Code:
setenv mainlineLinux yes
setenv arcNumber 2097
setenv bootargs 'console=ttyS0,115200 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'
setenv boot_nand 'nand read.e 0x2000000 0x100000 0x400000'
setenv bootcmd 'run boot_nand; bootm 0x2000000'

To make multiboot possible i created:
Code:
setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv boot_nand 'nand read.e 0x2000000 0x100000 0x400000 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x400000 0x0800000; run boot_nand; bootm 0x2000000'

What do i have to change to make it work?


Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #10 on: November 11, 2009, 08:21:35 AM »

To make multiboot possible i created:
Code:
setenv bootargs_console console=ttyS0,115200
setenv bootcmd_mmc 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv boot_nand 'nand read.e 0x2000000 0x100000 0x400000 ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd 'setenv bootargs $(bootargs_console); run bootcmd_mmc; bootm 0x400000 0x0800000; run boot_nand; bootm 0x2000000'

What do i have to change to make it work?

From what you describe, your bootloader is stuck in the mmc commands and never gets further due to this. I would need to test this, but unfortuntately; I'm waiting for more than 4 weeks for my next plugs to do more experimenting on.

However, I would expect you'll need to use an or operator, this is e.g. the default boot command I'm using for an PowerPC based CPU; where I clear the system if the system fails to boot with the bootloader settings:

Code:
#define CONFIG_BOOTCOMMAND      "setcy22150; run runsystem"             \
        " || protect off f8060000 f809ffff"                             \
        " && era f8060000 f809ffff"                                     \
        " && era f9820000 f9fbffff"                                     \
        " && reset"

So if runsystem (a script) blocks the system, I clear the flash. You'll probably need something along those lines for your MMC/NAND setup. It'd be interesting to test it; but you'll probably have to wait a couple of more weeks since I haven't received a shipment notice from GlobalScale yet.
Logged

davall
Newbie
*

Karma: 0
Posts: 26


View Profile
« Reply #11 on: November 11, 2009, 08:41:29 AM »

What do i have to change to make it work?
I'm using multiboot, too.
On sdhc resides a running debian lenny. On nand (ubifs) is a debian squeeze.
My config:
bootargs_nand=console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs
bootcmd_nand=setenv bootargs $(bootargs_nand) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000
bootargs_sd=console=ttyS0,115200 ro root=/dev/mmcblk0p1 rootdelay=5
bootcmd_sd=mmcinit; ext2load mmc 0 0x0800000 /boot/uInitrd; ext2load mmc 0 0x400000 /boot/uImage
bootargs=console=ttyS0,115200 ro root=/dev/mmcblk0p1 rootdelay=5
bootargs_root=root=/dev/mmcblk0p1
bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); run bootcmd_sd; bootm 0x400000 0x0800000; run bootcmd_nand
-----

Hope this works for you too :-)
Logged

knireis
Jr. Member
**

Karma: 2
Posts: 88


View Profile
« Reply #12 on: November 11, 2009, 11:56:33 AM »


Hope this works for you too :-)

It did not rightaway but it gave me enough help to fix the issue, mine now looks like:
Code:
setenv bootargs_nand 'console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd_nand 'setenv bootargs $(bootargs_nand) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_sd console=ttyS0,115200
setenv bootcmd_sd 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv bootcmd 'setenv bootargs $(bootargs_sd); run bootcmd_sd; bootm 0x400000 0x0800000; run bootcmd_nand'

thanks
Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #13 on: November 20, 2009, 02:43:52 AM »

It did not rightaway but it gave me enough help to fix the issue, mine now looks like:

Well, if you want, you can also expand it to make it simply conditional:

Code:
setenv bootargs_nand 'console=ttyS0,115200 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs'
setenv bootcmd_nand 'setenv bootargs $(bootargs_nand) $(mtdpartitions); nand read.e 0x00800000 0x00100000 0x00400000; bootm 0x00800000'
setenv bootargs_sd console=ttyS0,115200
setenv bootcmd_sd 'mmcinit; ext2load mmc 0 0x0800000 /uInitrd; ext2load mmc 0 0x400000 /uImage'
setenv mmcbootcmd 'setenv bootargs $(bootargs_sd); run bootcmd_sd; bootm 0x400000 0x0800000'
setenv runsystem 'if itest $kernel -eq 1 then run mmcbootcmd || run bootcmd_nand; else run bootcmd_nand || mmcbootcmd; fi'
setenv kernel 1
setenv bootcmd 'run runsystem || echo boot failed'

This way, you have a variable to select what you want to boot. Boots from mmc if kernel is set to 1, otherwise from NAND. It should post a message on serial if neither of them worked. Note that it will try the other boot if the other one failed. You're setting a preference with the kernel value.

I hope I got it correct; I quickly adapted my embedded boot logic to your examples. The or in the bootcmd is typically disaster recover; I go about erasing the u-boot variables and reset (was previously mentioned). In that case, it will default back to the hardcoded values.

In our development environment, this is further expanded with a NFS version that will fetch the kernel over TFTP with DHCP (DHCP filename entry) , boot the kernel and then mount a NFS system with that particular version (kernel value 0).

This way, you can maintain lots of development systems with several NFS filesystems and kernel files without much customisation of the U-Boot variables and offloading the customisation to a central DHCP server config file.

Got a note that my Sheevas got shipped beginning of this week, so I'll be trying this out next week or so; need to port it fully. If there is interest, I could add more info about that later on.
Logged

erpel
Newbie
*

Karma: 2
Posts: 41


View Profile
« Reply #14 on: January 15, 2010, 09:06:25 AM »

Just wondering,

Did anyone use this setup or do you have any feedback?

My setup is running at home for quite some time (the always up is much better than the NSLU2) and the plug nature makes it perfect for this. The only improvement I could do, is to add a outlet in my electricity cabinet and connect it there to my switch instead of plugging it into socket in a room.

If you don't have an iron electricity cabinet; combining with a wireless stick could also be a nice touch; then you would not be bound by the proximity of network connection sockets. The 3.0 release claims that this would be included in the plug.
Logged

Pages: [1] 2 3 ... 5
Print
Jump to: