Up and coming changes
I've been working on some changes over the xmas break for the next HAH firmware release.
One of the items is the refactoring of the /etc/xap-livebox.ini file into separate files which will be contained in the new directory /etc/xap.d/
I've completed my first pass at modifying all the code, and there was a lot, and my livebox is up and running using this new location. Everything looks ok but I want to check that I caught everything before I release a beta. The upgrade will be complete automated and there will be nothing for you to do except verify that the migration process worked and then do some remedial delete's which I wanted to leave as manual processes.
I'm not sure how this will address the corruptions have been occuring but is has to help somewhat having many files instead of the one single file.
The other change, which is more subtle, is that the "hostname" of the unit will be used to identify the deviceID.
Recall the source/target strings are formed like this: VendorID.DeviceID.Instance
By default the DeviceID is hardcoded to "livebox" this makes moving the software to other platforms, or indeed standing up another livebox, difficult as you get namespace collisions. To resolve this I've done a couple of things.
The DeviceID defaults to being the "hostname", which by default for your livebox is "livebox" unless you have changed it. It is also possible to override this by using a configuration setting which is also exposed on the web gui.
/etc/xap.d/system.ini
[xap]
instance='deviceid'
This has always been in the system but its interpretation has been slightly adjusted. Previously this "instance" setting would do this to your target/source.
dbzoo.livebox.2.Controller - where the number 2 is an injected value from the instance= setting. This is not strictly xAP compliant so I have removed this interpretation.
If you have multiple liveboxes and have used this encoding all is not lost as after the upgrade instead of having this
instance=2
You would need to change it (below) to keep this 'old' interpretation and reduce the impact of the upgrade.
instance=livebox.2
Until such time as you can correct your addressing and set a new hostname for your livebox.
All these changes are quite under the covers and from a usage point of view there will not be any impact, however what it does do is set the system up for being able to be easily migrated and compiled to different platforms as such the PI or Linux without having "livebox" encoded anywhere. Its all part of a larger push I want to do in 2014.
Brett
Brett,
Thanks for your work on this, especially over Xmas.
It looks like a substantial update that will enable the project "move on" in the future. Whilst I personally am in no rush to ditch the livebox and onboard rf/input/1wire, the jeenodes (which have been a new addition to my system this year) allowing remote relay control of my heating without wires and ir tx/rx along with the more recent bluetooth stuff has highlighted to me the benefit of "non central" hardware. As always you seem to be one step ahead allowing the rest of us to simply use the things you code for us!
The time both you and Derek put into this project is much appreciated. I hope you both had a good christmas and wishing you all the best for the new year. Let's see what 2014 brings for the HAH :)
Garry
Hear Hear!
Your work is very much appreciated. I look forward to trying this beta and I know your plans for 2014 will be good for us all.
The BeagleBone looks to be out of stock pretty much everywhere. Looks like most suppliers have them on backorder for February so you have some time to play :)
I have a few alerts set up for when they restock.
The BeagleBone has landed.
Time to play :)
Open for alpha testing too...
Brett
I have tried the beta. Check your email. All up and running here again.
I'll try the beta again...
As for the BeagleBone...just give me a little while to get to grips with it then I'll see how the distro goes
cheers
Mark
From an installed base point of view - and for getting maximum exposure for HAH the Raspberry Pi is obviously the important platform so if anyone has any progress reports on that then do post. I'm hoping Bretts Pi might leap into life or that he might have access to another board.
K
Hi, I have some experience with HAH on Pi for about a year, see if this is type of info you are looking for .. :)
Got into it because was unable to keep Livebox running stable with all wanted applets on it, occasionally found it hanging despite efforts.
I have only complied xaplib, hub, serial + ini and plugboard as this was my main interest. Lua/pl are via Raspbian.
First binaries were from revision 436 source, later "upgraded" to 466 and lately to 519 just of interest, do not recall stability or other issues.
For now then running xap-hub, xap-serial and applets/plugboard on "hahpi". To hahpi is also connected Jeelink/basenode, CurrentCost++ still "normally" to Livebox/HAH.
Regards,
Aivo
Thanks to aivo's news on the Pi, I have had a play with this myself over the last day or so.
I have never done any compiling before so it's real trial by fire but so far, as Aivo has already, I have the main HAH components running nicely on the Pi. (hub, serial, twitter, plugboard)
For interest, I installed subversion and did the source checkout directly to the pi.
I then compiled each component separately using their individual make files, modding them to use the pi complier (gcc) not a cross compiler. Few hiccups along the way but pleased with progress so far.
once I know a little more of what I'm doing I'll write up and maybe try to modify the overall makefile to make this simpler. I see that Brett has already got one for the beagle bone that would be a great starting point. Although it's still beyond me at the moment.
post more info/instructions soon!
Garry
(did I say in another post a few weeks back I was in no rush to move from the livebox? Funny what the temptation to try something new can do! :)
LOL Garry
I know just what you mean. I've got a beaglebone and I have tried to get the code on it but stumbling along so far.
I'm almost tempted to send my BB to Brett to hurry things along :)
No rush Brett, honestly, I really do need a while to play with this board first :)
A port of HAH to RPi would be very useful.
I am just starting on the home monitoring journey and have got my feet wet using emonCMS from openenergymonitor.org.
It looks like oem and HAH might be getting closer in your goals as oem are looking at linking their monitoring software into home control which HAH already seems to be doing. The HUH work on grabbing data from lots of different products would have a lot to offer to this.
One thing to watch out for on RPi and other SD card based boards is failures. Oem are now advising a hybrid SD card boot and HDD main drive as SD cards seems to be flaking out after 3 months or so of writing.
The emonCMS route might also offer HAH some cloud connectivity as well as they are currently doing free hosting of your emonCMS data as well as you being able to have a local install of this.
Looking forward to seeing where the port gets to
Gary P
Thanks Brett, I did try to have a hash at the makefile for the bone myself but got errors on iserver and curl.
I have backed out my alterations and gave your modified makefile a go (after commenting out the 3 lines) but still get the same errors.
Curl error is:
/usr/bin/install -c -m 644 './curl-config.1' '/usr/trunk/targets/bb.src/share/m an/man1/curl-config.1'
make[8]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7/docs'
make[7]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7/docs'
make[6]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7/docs'
make[5]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7'
make[4]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7'
make[3]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7'
make[1]: *** [install-strip] Error 2
make[1]: Leaving directory `/usr/trunk/userapps/opensource/curl-7.19.7'
make: *** [libcurl] Error 2
I have managed to install curl ok via the apt-get install commend though.
Iserver error is:
make[1]: Entering directory `/usr/trunk/userapps/hah/iServer'
lex -t tokenize.l > tokenize.c
/bin/sh: 1: lex: not found
make[1]: *** [tokenize.c] Error 127
make[1]: Leaving directory `/usr/trunk/userapps/hah/iServer'
make: *** [iServer] Error 2
I am yet to get around this one.
On the plus side, I now have xively, currentcost, twitter, hub, serial (with jeenodes) and plugboard up and running.
I plan to put the HAH hardware onto the GPIO port tonight and attempt the xap-livebox install.
Fingers crossed!!!
Garry
Thanks Brett,
as you thought, I did not make clean!. However, I have now and unfortunately the curl error persists.
I might get a virgin SD card imaged and try again in case it's something I've done with my playing around.
The flex did fix iserver issue though, cheers. I have now officially powered off my livebox and the Pi is in control!. It better behave itself, the wife is very sceptical?!
Garry.
running "apt-get libcurl4-openssl-dev" installs a curl library that allows xap-twitter to be compiled, but googlecal still seems to get an error :-
rm -f -rf /home/pi/livebox-hah-read-only/targets/bb.src/share
make -C /home/pi/livebox-hah-read-only/userapps/opensource/libgcal install-strip
make[1]: Entering directory `/home/pi/livebox-hah-read-only/userapps/opensource/libgcal-0.9.6'
make[1]: *** No rule to make target `install-strip'. Stop.
make[1]: Leaving directory `/home/pi/livebox-hah-read-only/userapps/opensource/libgcal-0.9.6'
make: *** [libgcal] Error 2
Once compiled an appropriate directory structure seems to need creating to get the "xap-?" to run.
./xap-livebox: error while loading shared libraries: libxap2.so: cannot open shared object file: No such file or directory
pi@raspberrypi ~/livebox-hah-read-only/targets/bb.src/usr/bin $ ./xap-sms
./xap-sms: error while loading shared libraries: libxap2.so: cannot open shared object file: No such file or directory
Hi,
try moving the .so file to /usr/lib and the .h files to /usr/include.
this worked for me and it's been running great for a few days now.
still struggling to get a complete compile though as Brett would like, I am gonna try again later and push the errors into a file for the master to look at ;)
Garry
Brett do you have available the toolchain for the armV7 build?
/opt/bb/toolchain/bin/arm-linux-gcc
I'll take a look
Looks like solid progress on the beaglebone!, good news, can only be good for the future of the HAH project.
As for the pi, I have attempted to compile as one again using the makefile.bone with the three comments for local compiling. I redirected stderr and stdout to a log for investigation.
Brett, you were right, there are earlier errors, I cannot fathom what they are trying to say though :( any ideas?
as for running the HAH system (compiled seperately) on the pi though, its been a week now and all good except for xively. This needs to be restarted a number of times before it becomes stable. once running though it will stay running for days.
when it goes down it complains of "glibc detected" realloc() invalid next size. obviously relating to the memory reallocation in he xively code but I cannot find any indication as to what part of the code its unhappy about.
Is this likely to be due to my compiling? any thoughts?
like I say its intermittent and when xively is working, it works great for days?
Garry
Attachment | Size |
---|---|
log.txt | 309.33 KB |
I'm running Angstrom here too as I have no wish to replace that at the moment.
Angstrom v2012.12 (Core edition)
Running Ubuntu on the Mac in a VM for the cross compiler, so I NEED to get that running.
The package install ran well. I now have the web gui up on the BB and on my Mac :)
Attachment | Size |
---|---|
Screen Shot 2014-01-25 at 01.50.41.png | 108.03 KB |
I've had an issue where the ip address, subnet mask etc reversed in the gui. They were also reversed in the system.ini file when I viewed that in the terminal. However the ini files downloaded using the backup option were the right way.
Shortly after I noticed that the BB stopped.
I also noticed a file named 533745ni in the etc/xap.d folder
Now back up and running after reflashing the eMMC from a backup image.
Just got to redo the wifi drivers and reload HAH
Brett
The HAH on BB seems solid enough now. I took the BB back to a clean install and reloaded all from scratch. It's possible that the erroneous files got there during my meddling.
I've now got the WH node connected and getting xAP messages from that. I'm wondering what route to go down for the RF transmission. Is your plan to release the ethernet RF nodes?
I'm going to hook up the HAH baseboard to the BB and see what comes of that.
I was thinking for now to use a jeenode board connected to the serial monitor port on the BB and fit a 433Mhz tx to it, as I have no need for the relays (LCD and I2C would be nice though)
Cheers
Mark
Cheers for looking Brett. I'm all up and running now so no rush for me. I am happy to test further makefiles, etc to get the porting neater for others to follow.
Mark,
I managed to get my hah board running nicely off the pi gpio ports, it's been great, I just needed a gpio breakout board to wire the hah board into.
It's worth doing if you have the hardware. Like you say, rf, 1wire and lcd are useful. I do also use inputs for alarm monitoring.
Think in the future though rf nodes will be the easier option
Didn't have these issues on the pi compile. Had to install flex but no issues with links or m4.
Valgrind is now running xively but as you might expect, I cannot get xively to break. How annoying!.
will leave it running overnight and if no joy will start doing a few reboots. Guaranteed it will break as soon as I take valgrind off.
keep you posted.
I've had valgrind running xively as part of the init script for days now and no issues (plus numerous reboots!) It's almost as though running valgrind has stabilised it?! Is this even possible?
i will remove and see if it breaks again :(
problems I can deal with but pesky intermittent ones with no indication of the issue test my patience!
G.
Sorry Garry but that made me chuckle :)
I've been running various bits of your xap code for some time now, mainly on kirkwood devices (sheevaplug, pogoplug) and see the same xap-xively crashing as Gary above.
I compiled the code on an x64 debian box and ran it there to rule out anything platform specific but got the same issue. So I ran it under valgrind (with xap-xively compiled with the -g flag).
Does the attached shed any light on why it's crashing?
Actually it crashes pretty consistently for me, so if you want me to try any valgrind options etc let me know!
(attached another valgrind crash log)
M
Ok cool, let me know if you need anything else - I removed the log files from my 2 posts as I realised I hadn't sanitised the API keys :-(
M
Working well so far, been running for about an hour now with no crashing - previously it only ran for a few minutes or so.
I'd say it's fixed :-)
Thanks,
M
Ha! Here's me waiting patiently for valgrind to tell me what's up!
When stopped, the logs did indeed appear, but looks like you've already nailed it!
Thanks all for the efforts, I do have a large number of feeds so prob why it affected me, only when I went to the pi though?!
Anyhow, cheers to all involved, I'll update tonight!
Garry
Beta 311.1 posted - this contains quite a number of changes.
I've updated the wiki to already reflect the new API: plugboard and jeenode wiki pages.
After you update to this beta you can delete /etc/xap-livebox.ini and /etc/ini.conf as these are not required - do make sure that /etc/xap.d was populated with files before you do this. You might want to just rename those out of the way into say /root for safe keeping.
If the automatic upgrade fails, that is there are no files in /etc/xap.d you can run from the command line.
# ini-migrate
and it will tell you what the issue is. All is not lost if you get to this point as there is provision to use an external mapping configuration file if there are sections that it can't figure out how to convert. I'll then include those into the code base before this becomes the next production release.
A quick summary of some of the LUA framework changes that might affect you.
Some changes by example
xap.init("dbzoo.livebox.hithere","FFDEAD00")
This now becomes
xap.init{instance="hithere", uid="FFDEAD00"}
You don't need to, and its best you don't, specify the VENDOR or DEVICE components as part of the initialization. These will be figure out automatically based on some defaults.
Creating BSC endpoints
bsc.Endpoint{base="dbzoo.livebox.my:relay.3", ...}
This now becomes
bsc.Endpoint{instance="my:relay.3", ...}
Again to maintain vendor, device portability you don't specify these parts. The wiki write-up for the BSC API has more examples.
All the examples in /etc_ro_fs/plugboad have been amended to fit into the new way of doing business.
NOTE: Full backward compatibility for previous API calls has been maintained so nothing should break on upgrading. *should* but you never know.
This time when I say BETA I really mean it due to the amount of code that has been reworked.
Brett