Release of build 253

18 replies [Last post]
brett
Offline
Providence, United States
Joined: 9 Jan 2010

 This release has been >2 months in the making since release 252. There are some major new capabilities that will support additional hardware add-ons.

Upgrading:

 

Make a backup of your /etc/xap-livebox.ini file, preferably not on the HAH itself.

Run /etc/init.d/update 

 The HAH platform has historically relied upon existing code that parsed xAP messages. Some of this wasn’t optimal. Release 253 has replaced almost ALL of this legacy code. The new infrastructure is known as ‘xaplib2’.

This new xaplib2 library, although invisible to users, greatly enhances the stability and maintenance of the HAH system.  Applications that use this library have a faster xAP parser and a smaller memory footprint than those using the original xaplib. They also take up less flash space due to higher shared library reuse.  Debug capability has also been greatly improved.
 
These programs were all rewritten to use xaplib2, in addition to the noted enhancements:

  • xap-snoop - Added message filtering support and new command line options.
  • xap-serial  (NEW) - Allows easy integration with any serial device.
  • xap-currentcost - Full xAPBSC support, Current Cost generation 1 support, external sensor support; IAM’s and standalone development boards.  Endpoint UID stabilisation.  Command line option for setting the model when ran manually.
  • xap-googlecal - Added “where=” to the schema to allow events to be scheduled that trigger other events.  Errors emitted as xAP messages. Sanity check the system clock on authentication error for SSL problem.   INI file password frob (note: this is not ‘encryption’).
  • xap-pachube - Support for logging non xAPBSC events.
  • xap-hub - Faster, smaller, a heartbeat,  host IP encoded into its endpoint name making the HAH easier to find.
  • xap-sms - Errors emitted as xAP messages.
  • xap-twitter - Now supports the new OAuth authentication model  
  • xap-livebox - Endpoint UID stabilisation.

Programs still using the old xaplib:

  • xap-plugboard - Modified to honour single HAH instance setting
  • xap-bridge - Modified to honour single HAH instance setting

These will be uplifted in the next release.

Web changes

  • new Automation>Assists tab to start xap-sms, xap-serial and xap-plugboard
  • new Admin>Instance tab to make multiple HAH systems easier to setup.
  • Option to disable the login page for networks that don’t require it.
  • Pachube GUI page changes to support non xAPBSC events.
  • Title change to Home Automation Hub


Numerous bug fixes and stability improvements.

Due to a change in the way in which the Ethernet bridge is setup, after flashing, your HAH will acquire a new IP address so don’t be alarmed if you can’t find it.  Use xFxViewer to see its IP is emitted by the xap-hub component.

To upgrade your .INI file to handle the new Pachube format perform the following.

/etc/init.d/xap stop

/etc_ro_fs/upgrade

/etc/init.d/xap start

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Successful Upgrade

Worked like a charm on both my boxes.  It's good to see so many of the suggestions put forward on the wiki included and so much other new stuff.

Keep up the good work,

 

Karl

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Well done guys

A big well done to you both, I know you've been working tirelessly on this and just so you know I have been working just as hard waiting for it! ;-)

I'll get busy updating all my HAHs or HALs as I call them and let you know how things go...

 

Sooooo excited!

G.

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
I got:-ash: h:: not foundwhen

I got:

-ash: h:: not found

when running xap stop and xap start.

The ini upgrade however seemed to go ok so I did a reboot.

Alanmh
Offline
Reading, United Kingdom
Joined: 7 Jul 2010
problem with Pachube

after upgrading then upgrading the ini file. On restarting XAP I get the following - there seems to be a pachube file missing and all  my feeds no longer work. Any ideas?


Welcome to LIVEBOX unchained


livebox login: root
Password:
# /etc/init.d/xap stop
# /etc_ro_fs/upgrade
Performing upgrade
        Pachube
Upgrading xap key dbzoo.livebox.Controller:1wire.1:xAPBSC.event:text
Saved key key0=text
Saved key class0=xAPBSC.event
Saved key section0=input.state
Saved key source0=dbzoo.livebox.currentcost:ch.1
Saved key xap0=
Key xap16 can now be deleted
Upgrading xap key dbzoo.livebox.CurrentCost:temp:xAPBSC.event:text
Saved key key1=text
Saved key class1=xAPBSC.event
Saved key section1=input.state
Saved key source1=dbzoo.livebox.currentcost:ch.1
Saved key xap1=
Key xap16 can now be deleted
Upgrading xap key dbzoo.livebox.CurrentCost:ch1:xAPBSC.event:text
Saved key key2=text
Saved key class2=xAPBSC.event
Saved key section2=input.state
Saved key source2=dbzoo.livebox.currentcost:ch.1
Saved key xap2=
Key xap16 can now be deleted
# /etc/init.d/xap start
xAP HUB
Copyright (C) DBzoo, 2008-2010


Pachube Connector for xAP v12
Copyright (C) DBzoo 2009-2010

[crt][main.c:114:getDynINI] INI file missing [pachube] id3=<value>
Livebox Connector for xAP
Copyright (C) DBzoo, 2008-2010


Current Cost Connector for xAP v12
Copyright (C) DBzoo, 2009-2010


Twitter Connector for xAP v12
Copyright (C) DBzoo 2009

[crt][twitter.c:141:setupXAPini] Twitter not authorized

Google Calendar Connector for xAP v12
Copyright (C) DBzoo 2009-2010

xAP Plugboard - for xAP v1.2
Copyright (C) DBzoo 2009

br0: address 192.168.1.20
br0: netmask 255.255.255.0
Autoconfig: xAP broadcasts on 192.168.1.255:3639
xAP uid=FF00D800, source=dbzoo.livebox.Plugboard
Broadcast socket port 3639 in use
Assuming a hub is active
Socket port 3640 in use
Socket port 3641 in use
Socket port 3642 in use
Discovered port 3643
Ready
#

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Hi Alan,Have a look at the

Hi Alan,

Have a look at the web interface and just check that the xAP Source fileds look ok, see here, http://www.dbzoo.com/livebox/hah#xap_pachube, for an example. 

It might also be worth taking another copy of the  /etc/xap-livebox.ini file, then having a look in it for the [pachube] section, locate the count= part, make sure the number, ie count=4, is equal to the number of feeds that you have.   You may then also need to delete any un-necessary id?, xap? and tag? lines.

You'll probably get the right answer from Brett or Derek, but the above might help.

 

Karl

Alanmh
Offline
Reading, United Kingdom
Joined: 7 Jul 2010
Looks good but still not working

Thanks Karl

I tried restoring the original ini file and running the upgrade on it again with same results.

I then looked at the ini file as you suggested. The ID count was wrong - 4 when I have only 3 feeds.

I have corrected as best I can - here is the pachube section (truncated key)

******************

[pachube]

enable=1

apikey=7feca598dc695a2bea043b0a39b7f9a980c87d8db2236e4d3370c4a5e4e1bec1

feedid=10591

count=3

id0=1

xap0=

tag0=Outside temp

id1=2

xap1=

tag1=current cost temp

id2=3

xap2=

tag2=watts

class0=xAPBSC.event

section0=input.state

source0=dbzoo.livebox.Controller:1wire.1

key1=text

class1=xAPBSC.event

section1=input.state

source1=dbzoo.livebox.currentcost:temp

key2=text

class2=xAPBSC.event

section2=input.state

source2=dbzoo.livebox.currentcost:ch.1

key0=text

**************************************

The web interface looks ok now but still not working I cant work out how to past  an image, but the fields look the same as in the wiki

 

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Can you check that the

Can you check that the xap-pachube service is running on the HAH.  Telnet into it, then use ps to get a list of the running processes and see if you can see xap-pachube.  If you can't, then you will need to start it manually in debug mode using this command I think, /usr/bin/xap-pachube -d 7 -i br0.  This should then give some more information as to what might be causing the problem.  You might need to change the debug level, the 7, to something higher or lower depending if you need more or less information respectively.

 

Alanmh
Offline
Reading, United Kingdom
Joined: 7 Jul 2010
much appreciated


Welcome to LIVEBOX unchained


livebox login: root
Password:
# ps
  PID USER       VSZ STAT COMMAND
    1 root      2260 S    init
    2 root         0 SW   [keventd]
    3 root         0 SWN  [ksoftirqd_CPU0]
    4 root         0 SW   [kswapd]
    5 root         0 SW   [bdflush]
    6 root         0 SW   [kupdated]
    7 root         0 SW   [mtdblockd]
    8 root         0 SW   [khubd]
   29 root         0 SWN  [jffs2_gcd_mtd2]
  107 root      1668 S    dropbear -p 22
  115 root      2244 S    telnetd -p 23
  125 root      1248 S    pure-ftpd (SERVER)
  132 root      2244 S    inetd
  138 root      1020 S    /usr/bin/xap-hub -i br0
  143 root      1048 S    /usr/bin/xap-livebox -s /dev/ttyS0 -i br0
  149 root      4956 S    /usr/bin/kloned
  156 root      2628 S    /usr/bin/xap-currentcost -s /dev/ttyUSB0 -i br0
  162 root      5776 S    /usr/bin/xap-googlecal -i br0
  169 root      3496 S    /usr/bin/xap-plugboard -i br0
  180 root      5000 S    /usr/bin/kloned
  183 root      4976 S    /usr/bin/kloned
  184 root      2272 S    -ash
  185 root      2248 R    ps
# /usr/bin/xap-pachube -d 7 i br0

Pachube Connector for xAP v12
Copyright (C) DBzoo 2009-2010

[crt][init.c:111:discoverBroadcastNetwork] errno 126 (Cannot assign requested ad
dress)
[crt][init.c:111:discoverBroadcastNetwork] Unable to query capabilities of inter
face eth0
#

any ideas?

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
You missed the -, minus, from

You missed the -, minus, from in-front of the i, cut and past this /usr/bin/xap-pachube -d 7 -i br0

 The good new is that the service isn't running, so running it manually should tell us why not.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Slightly strange

First off, thanks for taking the upgrade. A lot has changed, but be assured that any issues will be tracked down and sorted.

I'm not feeding Pachube right now (using the USB port to test other stuff). However, as you can probably guess, the general format of a pachube entry is now:

id<n>=<i>

then

xap<i>=
key<i>=
tag<i>=
class<i>=
section<i>=
source<i>=

So, e.g. for the CC power entry, I have ...

id1=1
xap1=
tag1=currentcost
key1=text
class1=xAPBSC.event
section1=input.state
source1=dbzoo.livebox.CurrentCost:ch.1

Not sure if case sensitivity in the strings might be an issue. I always make mine exactly as reported by xap-snoop.

Also, I've never tested a scenario where <n> is not equal to <i>

I'd be tempted to edit your .ini file to have a single entry (<n>=0, <i>=0) and get that working first.

Also, check the [currentcost] section on the .ini file and make sure that currentcost is enabled and that the model is correctly chosen ... this release added support for the very old CC units, so this section now has more options.

... one for Brett to comment upon, when I run the xap-currentcost in debug mode, i see this in the debug stream

[inf][currentcost.c:370:setupXap] Selecting CC128 model
[inf][currentcost.c:377:setupXap] Selecting CLASSIC model

my .ini has 'model=CC128'

http://code.google.com/p/livebox-hah/source/browse/trunk/userapps/hah/xa...

Derek.

Alanmh
Offline
Reading, United Kingdom
Joined: 7 Jul 2010
That got it going

Very verbose output, so missed anything at the start, but all feeds now working

So I would assume this points at the ini file?

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
I'm not convinced it's the

I'm not convinced it's the ini file.  The process is the same, you can reduce the verbosity by changing the debug level to something lower, I usually just reduce it by one each time until I get what I want.  It might also be worth issuing a reboot command and login again and then see if the process is running.  From experience I'd say that if you can start it manually, it should also start automatically.

It would be nice to get to the bottom of it, so if you can supply the debug info that would be really useful.

If you use something like putty, http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html, you can turn logging on and get all your output saved to a log file, select only printable characters as the logging option.

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Calendar

Hi Derek,

My pachube entries were defo corrupt...all higledypiggledy.  Have manualy ordered them as per your list and removed excess chaff.  All seems to be good now.

 

Problem I'm having is my calendar function no longer works.  It connects to the calendar, reads entries but seems to take no acton.

 

Brett mentioned about the plugboard using the old library, does that mean both are loaded?  Or that the plugboard not functioning at the mo?

Alanmh
Offline
Reading, United Kingdom
Joined: 7 Jul 2010
Its working!

Well, it was the ini file

The ids and tags were all jumbled, so I tried reordering it manually, but it didnt work. I then stripped out all but the first feed and started from id=0. This worked, and I then added the other 2 feeds on the web interface. I retested with soft restarts and full power off and on again.

To help others that might have a similar issue, I have pasted the working ini file pachube seciton here.

*******************************************

[pachube]

enable=1

apikey=7feca598dc695a2bea043b0a39b7f9a980c87d8db2236e4d3370c4a5e4e1bec1

feedid=10591

count=3

id0=0

xap0=

tag0=Outside temp

key0=text

class0=xAPBSC.event

section0=input.state

source0=dbzoo.livebox.Controller:1wire.1

id1=1

tag1=Current Cost temp

source1=dbzoo.livebox.CurrentCost:temp

class1=xAPBSC.event

section1=input.state

key1=text

id2=2

tag2=watts

source2=dbzoo.livebox.CurrentCost:ch.1

class2=xAPBSC.event

section2=input.state

key2=text

*************************************************** 

BoxingOrange
Offline
United Kingdom
Joined: 11 Jun 2010
Well Done

Well done, glad you got there.  I'm guessing you've added and deleted feeds in the past.

 Perhaps Brett can do something to normalise that section as part of the upgrade process so that the id's and numbering don't cause problems, that's if that's what it was.

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Plugboard unchanged

In 253 the Plugboard is absolutely there and functioning. It's just that it still uses the old xaplib. Work is in hand to upgrade the whole xAP/Lua/Plugboard piece. This is a BIG rework and it will take time to get there. However, the results WILL be worth waiting for.

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Calendar [Fixed]

Found the issue with my Cal entries, the ones I was testing with had "xAP" in the where field.

Set this back to "xap" and all good.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Gone well

Well it looks like from the reports that are coming in that build 253 has been a success.

Hopefully with all the architecture changes behind me I'll be able to concentrate on more NEW features.

Brett

Hardware Info