livebox:hah

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
Last revisionBoth sides next revision
livebox:hah [2011/12/18 19:09] – [Try the HAH firmware] brettlivebox:hah [2013/10/20 14:15] minerva9
Line 13: 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) 
Line 39: Line 40:
 | {{:livebox:control-hah.png?400}} | | {{:livebox:control-hah.png?400}} |
  
 +Also, control from [[http://www.homeautomationhub.com/content/building-android-interfaces-using-corona|Andriod]] devices
  
 +^ Mobile App ^
 +| {{:livebox:xapuiv2_1.png?400}} |
 ====== Architecture ====== ====== Architecture ======
  
Line 53: 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. +{{tag>livebox xap andriod}}
- +
-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}}+
 ~~DISCUSSION:off~~ ~~DISCUSSION:off~~
  • livebox/hah.txt
  • Last modified: 2015/03/13 04:24
  • by brett