Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
livebox:hah [2011/12/18 19:07]
brett [Home Automation Hub (Overview)]
livebox:hah [2015/03/13 04:24] (current)
brett Git hub move
Line 1: Line 1:
 ====== Home Automation Hub (Overview) ====== ====== Home Automation Hub (Overview) ======
  
-<​note>​Navigate to the [[livebox#​home_automation_hub|top level page]] for more information about all the components of this system.</​note>​+Navigate to the [[livebox#​home_automation_hub|top level page]] for more information about all the components of this system.
  
 The Home Automation Hub (HAH) Project transforms the [[Livebox]] into one of the **most capable and affordable** Home Automation systems that you might imagine. The Home Automation Hub (HAH) Project transforms the [[Livebox]] into one of the **most capable and affordable** Home Automation systems that you might imagine.
  
-<​html>​ 
-<iframe src="​http://​www.facebook.com/​plugins/​like.php?​href=http%3A%2F%2Fwww.dbzoo.com%2Flivebox%2Fhah&​amp;​layout=standard&​amp;​show_faces=false&​amp;​width=450&​amp;​action=like&​amp;​colorscheme=light&​amp;​height=35"​ scrolling="​no"​ frameborder="​0"​ style="​border:​none;​ overflow:​hidden;​ width:​450px;​ height:​35px;"​ allowTransparency="​true"></​iframe>​ 
-</​html>​ 
 {{:​livebox:​block_diagram.png?​460}} {{:​livebox:​block_diagram.png?​460}}
-====== ​ 
  
 The following features were proven to make this project a winner: {{ hah-box.jpg?​200}} The following features were proven to make this project a winner: {{ hah-box.jpg?​200}}
Line 17: Line 13:
   * Data logging to [[pachube]]   * Data logging to [[pachube]]
   * Power use monitoring/​graphing from a [[http://​www.currentcost.com|Current Cost]] unit   * Power use monitoring/​graphing from a [[http://​www.currentcost.com|Current Cost]] unit
-  * Easy to control remote RF mains sockets ([[http://​www.byebyestandby.com/​|Bye Bye Standby]] & [[http://​www.homeeasy.eu/​home.php|HomeEasy]])+  * Easy to control remote RF mains sockets ([[http://​www.byebyestandby.com/​|Bye Bye Standby]] & [[http://​www.homeeasy.eu/​|HomeEasy]])
   * Seamlessly integrated with [[http://​www.jeelabs.org|JeeNodes]]   * Seamlessly integrated with [[http://​www.jeelabs.org|JeeNodes]]
 +  * Control via [[http://​www.homeautomationhub.com/​content/​building-android-interfaces-using-corona|Andriod]] devices
   * Open control protocol ([[http://​www.xapautomation.org|xAP]])   * Open control protocol ([[http://​www.xapautomation.org|xAP]])
   * Input sensing (upto 4 switch inputs) as well as output driving (upto 4 relays) ​   * Input sensing (upto 4 switch inputs) as well as output driving (upto 4 relays) ​
-  * Free, Open Sourced, [[http://code.google.com/p/livebox-hah/|HAH firmware]]+  * Free, Open Sourced, [[https://github.com/dbzoo/hah]]
   * User scripting language for customisation of operation   * User scripting language for customisation of operation
   * Cheap to run. Only uses 6 Watts of power   * Cheap to run. Only uses 6 Watts of power
Line 43: Line 40:
 | {{:​livebox:​control-hah.png?​400}} | | {{:​livebox:​control-hah.png?​400}} |
  
-====== Try the HAH firmware ====== +Alsocontrol from [[http://​www.homeautomationhub.com/content/building-android-interfaces-using-corona|Andriod]] devices
- +
-The HAH firmware is a completefree, replacement for the Livebox firmware. It is open-sourced,​ so if you want to, you can see exactly how it works. +
-\\ +
-\\ +
-To give it a try, start by downloading the file [[http://​hah.dbzoo.com/​upgrade/​hah-firmware.dwb]].\\ +
-To install this .dwb firmware onto your Livebox, you'll need to follow some detailed instructions. There are four main stages in the process.  +
- +
-1. [[firmware#​flashing_new_firmware_aka_livebox_recovery|Downgrade the Livebox]] +
-2. [[commandlineaccess|Gain command line access]] +
-3. [[buildingfirmware#​replacing_the_redboot_loader|Replace the Redboot loader]] +
-4. [[firmware|Flash the HAH firmware onto the Livebox]] +
- +
-This firmware replacement is fully functional; ​[[http://​www.pachube.com|Pachube]], [[http://www.currentcost.com/​|Currentcost]],​ [[http://​www.xapautomation.org|xAP]] data feeding, [[http://​www.dbzoo.com/​livebox/​hah#​wake_on_lan|Wake on LAN]] and [[http://​www.dbzoo.com/​livebox/​hah#​xap_sms|SMS]] will be OK, however without the [[http://​www2.dbzoo.com/​catalog/​1|additional hardware]] some functionality will not work. +
-This is also a great way to get yourself a new kernel with many more modules installed plus the full command set of BusyBox (v1.12.1) +
- +
-<​note>​ +
-If you find the idea of reflashing your Livebox too daunting, you can buy a pre-flashed HAH in the [[http://​www2.dbzoo.com/​catalog/​1|shop]] +
-</​note>​ +
-Useful information about the HAH firmware: +
-  * uses DHCP by default to obtain an IP address. ​ You will have to examine your DHCP server to find out what IP was assigned; with the additional hardware the IP address is shown on the LCD at boot up __OR__ install the [[http://​www.xapautomation.org/​index.php?​title=xFx_Viewer|xFx_Viewer]] and examine the Livebox LCD xAP event. +
-  * Default **root** password is **admin** +
-  * SSH enabled ([[http://​matt.ucc.asn.au/​dropbear/​dropbear.html|dropbear]] 0.51), TELNETD available, initially disabled. +
-  * Console login disabled as this is where the additional hardware attaches. +
-  * Webserver listens on port 80. +
-  * [[http://​www.pureftpd.org/​project/​pure-ftpd|pure ftpd]] v1.0.21 +
-  * No ADSL or WiFi support. Once you reflash with the HAH firmware, the Livebox is no longer an ADSL/WiFi router. +
-  * The two ethernet ports are bridged, the MAC address of the unit is that of the bridge, not the one on the label on the box.  +
-<note tip> +
-{{ :​livebox:​hah-vlcd.png}} The HAH hardware adds an LCD which displays the IP address that your HAH has fetched via DHCP. If you don't have the hardware, you can download this Windows .NET application that will show you the IP address of your HAH. As it's a virtual LCD anything shown on the HAH LCD will show here too! {{:​livebox:​hah-vlcd.zip|HAH Virtual LCD}} +
-</​note>​ +
-Then perhaps go for a Livebox gcc or python! see [[development#​a_native_mips_toolchain|Native MIPS toolchain]].  All the source code for this project is available for download; [[hah_software|building your own]] HAH firmware binary. +
  
 +^ Mobile App ^
 +| {{:​livebox:​xapuiv2_1.png?​400}} |
 ====== Architecture ====== ====== Architecture ======
  
Line 90: Line 57:
 {{block_diagram.png|}} {{block_diagram.png|}}
  
-  * [[hah#​xap_hub|xap-HUB]] - allows multiple xAP devices to be controled ​from a server. In this case the Livebox.+  * xap-HUB - allows multiple xAP devices to be controlled ​from a server. In this casethe Livebox.
   * [[xap_adapter|xap-adapter]] - convert the AVR menu interface into an xAP protocol and interfaces with the RS232 port.   * [[xap_adapter|xap-adapter]] - convert the AVR menu interface into an xAP protocol and interfaces with the RS232 port.
-  * [[xap_currentcost|xap-currentcost]] - USB/Serial interface to the [[http://​www.currentcost.com/​|CURRENTCOST]] electricity monitor+  * [[xap_currentcost|xap-currentcost]] - USB/Serial interface to the [[http://​www.currentcost.com/​|CURRENT COST]] electricity monitor.
   * [[sms|xap-sms]] - USB/Serial interface via a DLR-3 cable to a Nokia 7110 mobile phone.   * [[sms|xap-sms]] - USB/Serial interface via a DLR-3 cable to a Nokia 7110 mobile phone.
-  * [[pachube|xap-pachube]] - Feed xAP BSC data to the [[http://​www.pachube.com|PACHUBE]] data aggregation service +  * [[pachube|xap-pachube]] - Feed xAP BSC data to the [[http://​www.pachube.com|PACHUBE]] data aggregation service. 
-  * [[google_calendar|xap-googlecal]] - Trigger xAP event from Google calendar+  * [[google_calendar|xap-googlecal]] - Trigger xAP events ​from Google calendar.
   * [[twitter|xap-twitter]] - Remote control with Twitter.   * [[twitter|xap-twitter]] - Remote control with Twitter.
-  * [[hah_plugboard_v2|xap-plugboard]] - [[http://​www.lua.org/​|Lua]] based scripting engine +  * [[hah_plugboard_v2|xap-plugboard]] - [[http://​www.lua.org/​|Lua]] based scripting engine. 
-  * [[iserver]] - xAP/TCP gateway for running a wi-fi based touch screen for remote control.+  * [[iserver]] - xAP/TCP gateway for running a Wi-Fi based touch screen for remote control.
    
 All components use the file /​etc/​xap-livebox.ini as the universal registry for their settings. ​ This is in "​windows ini" file format using [[http://​code.google.com/​p/​minini|minini]] the INI file parser. All components use the file /​etc/​xap-livebox.ini as the universal registry for their settings. ​ This is in "​windows ini" file format using [[http://​code.google.com/​p/​minini|minini]] the INI file parser.
- 
-====== Background on xAP ====== 
- 
-The best way to start understanding xAP is to read the [[http://​www.xapautomation.org/​index.php?​title=Basic_Status_and_Control_Schema|Basic Status and Control message]] schema. 
- 
-A tool to help you view the endpoint control hierarchy - [[http://​www.xapautomation.org/​index.php?​title=xFx_Viewer|xAP Message Viewer]] 
- 
-Here you can see all the endpoints on the Livebox Controller that can be directly addressed using the xAP protocol. ​ There are many top level systems being hosted by the Livebox: [[#​xap_adapter|Controller]],​ [[xap_currentcost|CurrentCost]],​ [[#​xap_pachube|Pachube]],​ [[#​xap_sms|SMS]] 
- 
-{{:​livebox:​xfx-viewer.png|}} 
- 
-For more information about programming the Livebox with xAP and Python see [[:​livebox:​hah_xap_python]] 
- 
-===== xAPBSC.cmd ===== 
- 
-Using the xAPBSC.cmd class we can define actions. 
-Turn on RF relay 1. 
-<​code>​ 
-xAP-header 
-{ 
-v=12 
-hop=1 
-uid=FF123400 
-class=xAPBSC.cmd 
-source=acme.my.controller 
-target=dbzoo.livebox.controller:​rf.1 
-} 
-output.state.1 
-{ 
-id=* 
-state=on 
-} 
-</​code>​ 
- 
-Display the string "Hello World" on the LCD display 
-<​code>​ 
-xAP-header 
-{ 
-v=12 
-hop=1 
-uid=FF123400 
-class=xAPBSC.cmd 
-source=acme.my.controller 
-target=dbzoo.livebox.controller:​lcd 
-} 
-output.state.1 
-{ 
-id=* 
-text=Hello World 
-} 
-</​code>​ 
-===== xAPBSC.info / .event ===== 
- 
-Messages in xAPBSC.info and .event are sent to indicate the current state of an Input or Output. 
- 
-This sample message is telling us that Channel 1 of the CurrentCost device is using 576 watts of power.\\ 
-A **.event** will be triggered as soon as a data value changes. 
-<​code>​ 
-xAP-header 
-{ 
-v=12 
-hop=1 
-uid=FF00DC01 
-class=xAPBSC.event 
-source=dbzoo.livebox.CurrentCost:​ch1.0 
-} 
-input.state 
-{ 
-level=576 
-} 
-</​code>​ 
- 
-**.info** messages are sent every couple of minutes to show the current state of the system. ​ If we waited until events were sent, programs such as the [[http://​www.xapautomation.org/​index.php?​title=xFx_Viewer|xAP Viewer]] would not be able to automatically figure out what is out there. 
-<​code>​ 
-xAP-header 
-{ 
-v=12 
-hop=1 
-uid=FF00DB0E 
-class=xAPBSC.info 
-source=dbzoo.livebox.Controller:​rf.4 
-} 
-output.state 
-{ 
-state=off 
-} 
-</​code>​ 
-===== xAPBSC.query ===== 
- 
-To get an immediate .INFO response from an end point we can direct a .query message to an endpoint or set of endpoints. ​ For each target that matches, an .info response will be generated. 
- 
-<​code>​ 
-xap-header 
-{ 
-v=12 
-hop=1 
-uid=FF00DB00 
-class=xAPBSC.query 
-source= ACME.Controller.Central 
-target= dbzoo.livebox.controller:​relay 
-} 
-request 
-{ 
-} 
-</​code>​ 
- 
- 
-====== WebServer ====== 
- 
-The webserver is written in C using  
-  * embedded web server from [[http://​www.koanlogic.com|KloneLogic]] 
-  * [[http://​code.google.com/​p/​minini|minini]] the INI file parser 
- 
-The web server listens on PORT 80 from here you can control most of the Home Automation controller features. 
- 
-{{:​livebox:​info.png|}} 
- 
-To access any other page but **info** you will need to authenticate. ​ Login in as **admin** you can enter anything as the password and it will be accepted. ​ Not until the admin user password has been setup will it be validated. ​ 
- 
-{{:​livebox:​login.png|}} 
- 
-[[hah_webserver|More screenshots]] 
-  
- 
-===== Settings ===== 
- 
-There are several settings in the /​etc/​xap-livebox.ini file that directly affect the webserver or the Livebox itself. 
-==== Network / Services ==== 
- 
-The network section defines what additional services will be enabled and the ports used, whether DHCP or STATIC IP configuration is setup, if the two Ethernet ports should be bridged together into a Switch configuration or addressed individually,​ the domain name of the Livebox and the NTP time server to stay in sync with. 
- 
-{{setup1.PNG}} 
- 
-<​code>​ 
-[network] 
-lan_proto=dhcp 
-hostname=hahbox 
-config_bridge=1 
-ether_0=00:​07:​3A:​11:​22:​00 
-ether_1=00:​07:​3A:​11:​22:​01 
-domain= 
-ntp_host=uk.pool.ntp.org 
-</​code>​ 
- 
-The power LED indicator, although it appears on the SETUP page, has its own section. ​ This reduces the amount of ON time that this LED has, useful if you keep the Livebox in a room where this brightness would be annoying. 
-<​code>​ 
-[hardware] 
-power=0 
-</​code>​ 
- 
-These network entries allow in-built services such as SSH, TELNET and FTP to be enabled/​disabled. 
- 
-{{services.PNG}} 
- 
-<​code>​ 
-[network] 
-telnet_enable=0 
-telnet_port=23 
-ssh_enable=1 
-ssh_port=22 
-</​code>​ 
- 
-==== Access Security ==== 
- 
-Access to various pages in the HAH controller can be controlled in the [security] section. ​ For example: 
- 
-<​code>​ 
-[security] 
-user=demo 
-passwd=secret 
-demo=automation,​graph,​control 
-</​code>​ 
- 
-Will create a login user called "​demo"​ with a password of "​secret"​ that only has access to the automation, graph, and control pages. 
- 
-Up to 10 additional user accounts can be created. ​ Simply separate each with a comma. 
-<​code>​ 
-[security] 
-user=demo,​foo 
-passwd=secret,​bar 
-demo=automation,​graph,​control 
-foo=automation,​control 
-</​code>​ 
- 
-The page names are derived from the names of the pages as defined in the URL.  For example the page setup.kl1 will be "​setup"​. 
- 
-There are two other entries that appear in the security section that are update-able via the webserver\\ 
-{{admin.PNG}} 
- 
-<​code>​ 
-info_protect=0 
-admin_passwd=21232f297a57a5a743894a0e4a801fc3 
-</​code>​ 
- 
-Info protect controls whether the INFO page is displayed without needing to authenticate as a valid user.  The admin_password is an MD5 hash of the special user "​admin"​ who cannot be deleted from the system; it's a hardcoded username much like "​root"​ in a Linux system. 
- 
-If you forget the "​admin"​ user password simply delete the admin_passwd entry and whatever you enter in the login prompt will be accepted as valid. 
- 
-==== Wake on LAN ==== 
- 
-Wake on LAN is a great way to save power by keeping your PC on '​standby'​ until it is given a little 'wake up' message. This page allows you to specify the MAC address of a number of PCs. Pressing the 'Wake Up' button sends the command. 
-\\ 
-\\ 
-More details of regarding WOL can be found [[http://​en.wikipedia.org/​wiki/​Wake-on-LAN|here]]. 
- 
-\\ 
-{{wol.png}} 
  
  
-{{tag>​livebox xap}}+{{tag>​livebox xap andriod}}
 ~~DISCUSSION:​off~~ ~~DISCUSSION:​off~~