Release 300

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

This embeds xAPFlash into the HAH and onto its web gui.

The configuration file, just like you have on your joggler is loaded from /etc/www

The flash default files are stored in /usr/share/flash and are accessible directly using the /flash alias on your browser.  So for example  http://a.b.c.d/flash/xAPFlash.swf will load the SWF application by-passing the HAH wrappers for direct access.

The URI /live maps to the filesystem location /etc/www this is where you can put your custom configuration and additional graphics assets.   This maps to the URI  http://a.b.c.d/live/

On the Admin/Webserver page you can default the startup page to HTML or FLASH.

This is very prelim but I hope you guys can figure it out.

Brett

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
more toys

 

Hey this looks great.

I get somewhere - put xAPFLASH.swf into /etc/www - pictures all load but no action.  Did change ip address to iserver location

Looking at iserver I have two entries - one from another browser tab, which is running 

The second entry shows "(null)" in the source, no TX and 1 RX.

So what am I missing I wonder.

Regards

 

Kim

p.s. both iserver entries run from the same pc - so I don't think it is that end.

 

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
more toys

oops forgot the password on the iserver - works great now AND on my phone using dyndns - so I guess I don't mind about

the other thread now.  Thanks brett

Kim 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Not sure why you did that

Kim,

You don't need to put xapflash.swf in /etc/www its already on the system?!  You are just wasting valuable and precious user flashable space.  Just your graphics and the xapconfig.xml file need to be there.  When you reference your graphics you must use /live/xxx.png  etc..  Or if you want something already in /usr/share/flash you can omit the file path as this is default lookup location.

Kloned aka TheWebserver has the following URL alias configurations:
dir_alias  /live /etc/www
dir_alias /flash /usr/share/flash

Yup a bad password would do it.  (from your other thread).

Brett

AlexS
Offline
United Kingdom
Joined: 5 Dec 2011
Sterling work again Brett, have a cold one.

Yep its working nicely. I have xAPFlash.swf both in the GUI & on its own link. /live/xAPFlash.swf

Looks quite Beautiful!  OK I need to customise the xml but its there.

Did have to bash pachube into submission again restart & reconfigure currentcost, pachube & iServer. That have may have been because I filled www directory or the upgrade. Either way a very small price to pay.

Now though you have opened a Pandoras box, I have /etc/www or /live as we call it here. I can pop html pages there so I can extend it with even my basic HTML skills. So if I mount an EXT3 usb flash disk with an /etc/www directory and as the hahhub boots check for that then link to that not the internal drive? That saves precious space

Can I have a link on the GUI to /live/index.html?

Now because it isn't compiled in Klone we can't use C, could we use lua or php in our own web pages?

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Problems encountered-and soloutions

UID on my system is different from default in config so in xapconfig added unit id to overwrite/overrule, also had some "extra button IMAGES" this caused xap to throw a right hissy fit until i put them on the hah (made them as small as possible)

 

Dean

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Re: Not sure why you would do that

Hi Brett

Yeah it's called sloppy typing - I meant xapconfig.xml not xapflash.swf.  Which is why I am rubbish as a programmer.

Just to show we play with your demos - when you go to the config page and keep clicking the second configure "button" the green comes

and goes in a strange pattern - sometimes with the ++ symbol and sometimes without. Totally minor point I know.

Reconfiguring the screen is fun - using xml notepad 2007 to help me keep the xml right

Kim

brett
Offline
Providence, United States
Joined: 9 Jan 2010
CGI for webserver

Alex,

You have jumped the gun with having lua CGI code in /etc/www this was something I was planning but I wanted to get release 300 out of the way with flash before I started then looking at how to have user generated scripting too.  Yes its very doable and coming....

I also need to make more streamlined the ability to add usb storage.

Brett

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
So what you are saying is......

With all the USB devices being added onto the HAH.

 

So far i have a current cost but nothing else, what i do have is a 7110 mobile with lead a jeenode usb and now a usb stick that could get added.

 

so may i suggest we all put on our Xmass lists a usb powered hub, with all the recent progress a 20port one may be an idea :)

AlexS
Offline
United Kingdom
Joined: 5 Dec 2011
Thanks Brett

Thats great, thanks. 

Will look forward to that. 300 though is a really nice release, I'm just being greedy.

I thought earlier in the week wouldn't to be nice if xAPflash were served off the HAH (I even played with Klone trying to figure out how) and you had already started on it.

Would be nice if we could get some error messages when we are struggling, maybe a button that shows the relevant message / pre requisites on the web interface for xAPflash, Pachube and Currentcost 

Say on Pachube show the last posted message to Pachube.

xAPflash last sent xap to /from the client. So we can see if the 

Currentcost last data received via serial?

--------

I'm guessing that this could all be ported to other platforms maybe the Raspberry pi or similar? Just for when the Liveboxes run out?

 

 

 

brett
Offline
Providence, United States
Joined: 9 Jan 2010
struggling

Anything xapFlash I'm not your man as I didn't write it you need to speak to Kevin about that, I just embedded it and made it available more seemlessly.  So errors from flash I can't do anything about.   Visit the xapflash forums for things about this application.

Pachube / Currentcost if you are stuggling then you need to enable debug mode from the command line and run them that way.    Debug levels range from 1-7  (7 being verbose, 1 being terse)  6 normally suffices.

When things are working you don't need all the overhead of being able to peek at what just happened, nor do I want the overhead of trying to figure how to get all this presented back into a web gui.  If something fails badly it will drop its lunch into /var/log/ so you can see how it died otherwise you can assume its working.   The code is damn stable I've not had a SEGV for the longest time I can remember.

On Porting: As the code all C/LUA its very easily ported to another platform, infact I have all this running on a x86 system where I do my development before porting to the livebox.  So I already run in this mode.  iServer has already been ported to run natively on the joggler for instance.

Brett

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
more questions

Hi Brett,

 

1) Is there any way to control the "polling" rate?  I have been watching xfx message viewer.  Using a cut down version of your demo with

just RF 1, 2, Relay 1,2, cc temp and power. Runnning two versions of iserver - one on the pc one on the phone

Sometimes either one of them seems to go into oscillation - constantly sending messages with the body "request {button = sensor1}"

and then "request {button = 0} - at a rate of about 200/min.  Other times the two messages are sent once a minute - in line

with a hearbeat message.  Or is this a "feature" to make buttons more responsive just after they have been pressed?

2) On another subject I am trying to get pachube to show a graph of when the xmas tree lights are on (sad I know).  I saw in a previous

message that you had arranged for the on/off to be translated to 1/0 but still can't get it to work.

I am copying entries for others that work fine so.

ID TAG            Tag XAP Source                       xAP Class        xAP Section    key

2  temp2         dbzoo.livebox.Controller:1wire.1  xAPBSC.event   input.state     text   which works

is copied as

5  xmas lights   dbzoo.livebox.Controller:rf.1       xAPBSC.event  output.state    text   which doesn't

have also tried input.state instead of output.stat

Any ideas?

 

Kim

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
Think we have the same issue

Think we have the same issue see http://www.homeautomationhub.com/content/not-sure-if-scripting-or-not

 

Hopefully one will answer the other so if you find answer please post:-

 

for info my feed is here:-

 

https://pachube.com/feeds/15114

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
oscillation

I also found a lot of requests went on if i had buttons on joggler that were not in existance (or configured ) on HAH so in effect it was querying a non existant button that it thought existed if that makes sense?

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Wrong entry in pachube settings

Kim You want the last box to be state not text. This works for me. Garry

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Re Wrong entry in pachube settings

Thanks Garry - it now works.  I have been playing with this on and off all day (!) - got into a right mess with the ini file - think my regular reboot came right in the middle of editing - then I was using wordpad which injected all sorts of other stuff. Luckily the new restore got me back to a stable clean position and all is now well.

my feeds are at https://pachube.com/feeds/13194 - not as impressive as your.  Power 2 is because I have only recently discovered the current cost bugs which gives false 144watt readings when the power on ch 1 goes above 3kw !! swmbo wasn't impressed at the idea of triggering a klaxon when ch 2 went high!

Kim

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Thanks G7PKF - that worked.

Thanks G7PKF - that worked.  I had already killed some of the buttons.  It seems that RF 5,6,7 Sensors 1-4 are the ones (an older version

of the chip?).  Getting rid of button 0 took longer - in the end I killed them off one at a time until I found the culprit - page 4 the 1wire1

slider.  So now no more spare messages - just heartbeat and proper messages.

Kim (G3YGA)

g7pkf
Offline
United Kingdom
Joined: 11 Jan 2011
sorry?????

Can you elaborate on the current cost bugs which gives false 144watt readings when the power on ch 1 goes above 3kw !

 

 

My SWMBO is now getting really annoyed as i have started using mote so i can now switch lights heating and anything else connected to HAH on/off remotely.

 

 

so when she leaves the outside lights on i switch them off!! and i am 100+ miles away!! i do have a dvr and 6 cameras around house so i can also see when shes not home, and i have set heating to switch off/into frost protect mode when alarm is set, and alarm and boiler are monitered by HAH....My SWMBO is really starting to hate me and moan A LOT!!!

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Yes do tell more on this.

I have seen Derek chew about 10kW of power when his power shower is used so I am confused by this issue too.

Brett

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
100+ miles away isn't far enough

Especially if you call home to complain about the '15 minute shower'. Trust me on this!

Derek.

kim
Offline
Throwleigh, United Kingdom
Joined: 1 Dec 2010
Current Cost 144 watts bug

Staring at the data flowing on xfx viewer - as you do - I could see 144 appearing on channel 2 and 3.  I thought it might be a low battery causing the channel indicator to be incorrect.  Googling "current cost 144 watts" gives the answer - though you have to look at the cache version on the right to see the main reply in the second heading.

To simulate it you can repeatedly turn the kettle on and off.

Also available on my feed https://pachube.com/feeds/13194 where you can see "power 2" triggering when 'power" goes above approx 3kw.

More detail, on why, is available from halfway down this aussie blog http://blog.digivation.com.au/category/tag/currentcost.  It may not apply to all devices I suppose.

Can I suggest a community project where we run around the house turning various appliances on and off to establish the exact power trigger point. SWMBO's will no doubt join in this worthy activity over the Xmas period!

Text of cached original article reproduced below:

---------------------------------------------------------------------------------------------------------------------------------------

This article applies to the following brands and models:

Current Cost : Classic and Envi

Watts Clever : STC-4002 \ Jaycar MS6155

This bug related to the above mentioned Current Cost and Watts Clever products, and relates to incorrect values being recorded and displayed by the device. We have termed this bug the "144 Bug", however it will result in an incorrect value of 144 being added to phases (channels) 2 and 3 which means the error is 288 watts over-stated, this applies to both single and three phase installations.

The errors occurs when the actual wattage used is over 3KWatts, when this condition is true then an incorrect value of 144 watts is shown on channels 1 and 2 of the data store and as a result on the classic model represented on the screen, on the ENVI the manufacturers have attempted to fix the bug by not adding the error into the LCD display. However on all brand and models the history will be incorrect for all occurrences where Energy Now is greater than (about) 3kw. This is an issue that is not resolved true software with any reasonable accuracy, we have sighted a claim by Watts Clever that a certain software product will resolve this issue in relation to the history data, however we dispute that the history can be accurately corrected)

While this is a serious issue in relation to the accuracy, and could be resolved by the manufacturer, it has existed over two model generations so the bug is unlikely to be resolved in the near future. I did attempt to get a response from Current Cost about 4 months ago however, emails have remained unanswered.

kevin
Offline
Huddersfield, United Kingdom
Joined: 17 May 2010
Embedded xAP Flash

Oooh .. nicely done Brett... I feel strangely elated that xAPFlash got embedded status... and because HAH is easily firmware updateable (even easier if there was an update me button on the firmware page ;-) then I don't have the typical worries about any updates.

Using the default generated  XML my relay control isn't actually working but I'll suss that soon - no doubt it's my instance, sub address or UID changes from defaults as I don't expect the xap config.Xml default file is rebuilt with such changes included.

Just re a couple of previous comments...

Error messages... XAP Flash does display some at startup should it finds something awry with the XML but I know it's not very thorough and can often just not launch when the config is not to it's taste. It's on the list but not a high priority.

If you have xAP devices configured that are not present at startup xAP Flash will try repeatedly to retrieve their status , it does back off over time though, reducing queries to about once every 10 mins IIRC.   The xAP button will show a count of how many devices are not found, which will reduce to 0 and then display 'xAP' once all are found. Clicking this button displays a list of any  missing devices.

K

brett
Offline
Providence, United States
Joined: 9 Jan 2010
xAPFlash embedded

Embedded status I think its the way to go.... its give your application exposure and it give this project a nice UI for things for which there is not web interface such as the coming JeeNode stuff.

I know the default/sample XML isn't perfect it was more of a sampler that people should customize than something that is perfect out of the box.  Yeah I could remove all the things are aren't supported to reduce the xap polling traffic but then its not much of a sample.  I was struggling with the decision of what to include.

Perhaps just a note somewhere that its just a default and it should be customized for each persons setup would suffice.

The startup issue with bad XML is annoying but hey what da ya want for free!  Worst case there is alwasy a "working" xml burnt into the flash you can fall back to if you mess things up to badly.

Brett

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
config.xml

Hi Brett, Kevin

Finally got around to getting my xAPFlash config loaded, everything went pretty smoothly.

I'm about to buy a couple more and will therefor have about 3 around the house plus obviously a few more testing and PC based instances.

When I tried to change the config file and use it to override a remotely located config file, I couldn't.

It says "Read-Only file system".  Wouldn't it make more sense to have the config.xml file located somewhere where it was possible to change it?

I want to be able to change all jogglers through one xapconfig.xml and many config.xmls with overrides.

 

Is this possible?

Cheers

Gary

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Common xapconfig.xml

Hi Gary

You can set the location for a common xapconfig.xml, but each config.xml should be unique to a particular PC/Joggler/Phone/woteva !!!!

My problem is in setting up the common location - the scenario being.....

HAHHub on 192.168.1.nn acting as iServer (working fine.....), with a common xapconfig.xml in the /tmp folder

Joggler on 192.168.1.jj with its own config.xml pointing to a local xapconfig.xml......works fine!!!

If I try and change     <configfilelocation>local</configfilelocation>
to say                     <configfilelocation>192.168.1.nn/tmp/</configfilelocation>
it all goes wrong!!!

Any ideas?

EJ

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
External xAP sources

Hi Brett

Brilliant work...I'm begining to get a funtional Joggler/HAH combo and even SWMBO was impressed!!!

However... I've got a Weather Station (W1080) posting xAP temp and barro readings and I'd like to integrate them into the xapconfig.xml.....had a go, but I'm missing something....

I can post the temp (for eg) to Pachube using....

ID TAG            Tag XAP Source                       xAP Class         xAP Section      key

n  Outside        sanday.cumulus.ASROCK           weather.report  weather.report  TempC   WORKS FINE

But when I put it inti xapconfig.xml using.....

            <style>outside-temp-icon.png</style>           
            <xAP>                                                                           <!-- DOESN'T WORK........ -->
               
                <schema>weather-report</schema>
                <uid>FF437500</uid>
                <source>sanday.cumulus.ASROCK:TempC</source>


            </xAP>

Can you assist, please?

EJ

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Not that I don't want to help

Not that I don't want to help but also request on the xAPFlash forums

http://www.automatedhome.co.uk/vbulletin/forumdisplay.php?f=29

I have VERY limited resources now to do any sort of investigation or further development.

On the configuration issue - the problem is the xapflash.swf has to read the config.xml from where the .swf file is located. Which means it also reside needs to reside in the Read-only area, thus making it difficult to change.

The only way aroudn this would be if the LOCATION of the initial config.xml could be supplied via a parameter to the SWF file when its starts up.  I'm not familar enough with Flash, nor the specific application to know if this is possible.

For the Jogglers howwever this isnt' a problem but you must correctly construct the STRING.

This is invalid.

<configfilelocation>192.168.1.nn/tmp/</configfilelocation>

This needs to be a URL - as per the doc - http://www.dbzoo.com/livebox/xapflash#the_configfilelocation_element

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Thanks for that...

Hi Brett

I'll take your advice and post on the automatedhome forum for the weather Station stuff....

However, on the configfile location.....

Coming at this from a DOS/Windows standpoint - I've always been able to drop in the 4field ID as if it were an URL.... so how do I give my HAHHub an URL, so I can access it from the Joggler for the common configfile?  I've read the docs referenced, but its not there.  I've given the HAHHub an unique instance, is that it?

Sorry to be a pain - but I've got multiple Jogglers and I'd really like to be able to update them from my 'always on' HAHHub!

Cheers.....and your pint is still here, waiting!

EJ

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Many Thanks..

Hi Brett

Part 1 - That's solved the first part - I used the 'generic' xAP and it's all working fine...

Part 2 - no further...

NEW Part.... is source=dbzoo.livebox.CurrentCost:ch.total available as an xAP instance?...it appears to be giving the same data as ch.1 (should be sum of ch.1 + ch.2 + ch.3)!

Cheers...

EJ

EJ-Ambient
Offline
Ringwood, United Kingdom
Joined: 5 Aug 2011
Panic over - found it!!!

Sorry Brett...I'm an idiot...

The UID has to change as well.......so that's PART 3 solved as well....

Cheers

 

EJ

BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010
Brett,What about one of those

Brett,

What about one of those fancy links you can do in Linux?

Couldn't we have a linked file there in the read only bit pointing to the read/write location?

Hardware Info