Raspberry Pi

Raspberry Pi has gone to manufacture.  This would make a COOL nextgen HAH platform.

Read about it http://www.raspberrypi.org/archives/509

Then considering signing this petition that discorages British Manufacturing for electronics.

http://epetitions.direct.gov.uk/petitions/27158

Brett

Member for

15 years 11 months

davidnewton

14 years 8 months ago

I'm waiting for expected delivery around mid may - well that was before they discovered the wrong network socket had been fitted.

davviss (not verified)

14 years 8 months ago

I'll definitely join your "fan club" , I was waiting for this news for a long time. I got my first Raspberry from a local San Diego classifieds source and it was all I needed to become hooked. Now I am eagerly waiting for the next generation of mini-computers, I find them revolutionary.

Member for

16 years 6 months

kevin

14 years 7 months ago

Just been told mine has shipped - so if you got in there early they're on their way :-)

Member for

14 years 7 months

DoubleSpeed

14 years 7 months ago

I’ve literally only just got my HAH LiveBox and I am in no rush to change and I'm probably stating the obvious however as there is only a finite number of LiveBoxes out there and for the project to live and grow alternative hardware will be needed and the low cost Linux based Raspberry Pi seems the obvious solution???

Member for

16 years 10 months

brett

14 years 6 months ago

Was thinking about the PI project and reflecting on some of the HAH decisions I made.

  • xAP Protocol (GOOD)
  • xap-livebox.ini (seems GOOD, but constricting see below)
  • kloned (GOOD - for its usage on livebox, would not reuse if had large memory/flash space)
  • turnkey flashable upgrades (GOOD) - YUM/RPM packages would be better with a larger distro available on the PI.
  • Lua (GOOD) - xap-plugboard is key to customizations.

What are we missing?

  • Pachube is fine for off site data feeding but local mysql database logging for all values would be nice. Careful not to reinvent the wheel here with yet another data logging, charting solution. Ie is integrating with Cacti for example better?
  • User plug-able web interface controls. Lua provides a scripting framework but provides no way to expose a user interface for command and control. Think about how the Squeezeplayer provide an Applet interface and a GUI like control language to build an X based GUI. Presenting values from HAHnodes on a UI would be a great feature.
  • Applet repository for publishing user supplied scripts, and having this searchable. Again squeezeplayer model
  • GUI - xAPFlash works for the Joggler but its screen size is HARDCODED for these dimensions so it's not surface aware.
  • XBMC - is already being ported to the PI - if its easy to surface objects into this perhaps this could be a nice gui, I mean you have video, music, etc.. + xAP. There many XBMC integration with various products, your get glam which is missing for the HAH.
  • RESTful services - aid integrations. CachingWebServerApplet.lua is small step in that direction.

xAP was a good choice. Need to overhaul the components to use the v13 specification.

Nomenclature should have been this - Can retro fit that to the livebox too.

  • <vendor>.<device>.<instance> - dbzoo.<hostname>.<instance>

I hardcode the hostname to be "livebox" I should pick up the livebox hostname and default this to "livebox" to remain compatible with this replacement naming.   This would remove a level of source addressing and make the system more flexible for multiple boxes and for porting the sofware onto another device.

A lot of effort has gone into producing the xAP framework and debugging the components, I see no reason to throw these away.

  • xap-hub, xap-serial, xap-twitter, xap-pachube, xap-currentcost, iServer, xap-sms and xaplib2 minor changes needed keep them.
  • xap-livebox - rework may not even fit into the new raspberry pi framework - possibly ditch.

Err on not putting ANY additional hardware on the raspberry PI, bar say USB pluggable devices. Here is my logic - xAP is a distributed protocol so use things like NetDuinos/JeeNodes for offloading, 1wire, URF, I2C, SPI etc.. Once the xAP message is on the wire its easy enough to just consume it from anywhere.

Once I had 1wire working on the JeeNode I found there was minimal need for 1wire directly tethered to the base livebox.

URF - this is a tricky one as the RF transmitter should be driven with 12v for maximum range. Consider building a standalone board simply for 433Mhz transmission. Arduino/JeeNode/NetDuino etc. A dedicated board would not be expensive to fab. Really just needs a cheap micro (like a 328 is overkill) the RF module itself and a little 12V reg. Add a cheap 433MHz magmount antenna and you have a workable unit.

Windows INI file format and single file - this seemed like a good idea but in hindsight with many programs accessing a single database I should have implemented locking and mutex to prevent collisions which result in random corruption of the xap-livebox.ini file.  Program to config file should be 1:1 Use something like UCI from Openwrt which has SHELL/C/LUA interfaces. This is something that should be ported onto the livebox HAH as well to get it into a better shape.

Kloned webserver. This was chosen on the livebox due to memory and flash space budgets. This decision of using C would not be the right one for the PI. Something like PHP, Python or Java (Lua maybe) would be better as there are more frameworks and libraries about. Cough Ruby even?

If anybody is thinking about the bigger picture here and has some thought I'd love to here them.

Brett

Member for

15 years 10 months

g7pkf

14 years 4 months ago

WOW its small.

 

just had delivered a model b small form factor twin usb hdmi, ethernet, audio out and composite.

 

in 20 minutes i had it hooked up and was browsing the internet.

 

now hows the hah integration going, i think priority one is RF 2,3 and 4 using the i/o to get relays and inputs working.

what do others think?

 

does anyone else have one?

Member for

16 years 6 months

kevin

14 years 4 months ago

Brett said : "GUI - xAPFlash works for the Joggler but its screen size is HARDCODED for these dimensions so it's not surface aware."

Yes - very true and also there's also the aspect that the Joggler doesn't implement the Flash stage in the normal way.  I could spend some time removing the hardcoded screen sizing but TBH Flash seems to be on it's way out - with latest 'Jelly Bean' Android not supporting it in Chrome.   The XML that configures xAPFlash is also badly structured as it just evolved rather than being well thought through.  Configuration isn't easy and there should be a graphical layout editor.   However whilst I've seen lots of recommendations for HTML5 / websockets I haven't seen much practically that really compares to Flash as it's used here .. and I'm not familiar enough to know how XBMC might serve the client / device base.

  I think looking at alternatives is a good plan but should you end up back at xAPFlash I'll take a look into this.

 

K

Member for

14 years 11 months

AlexS

14 years 4 months ago

Hi Brett 

Would like to see an opkg or similar, I think HaHub should go platform agnostic, there are plenty of NAS, plug computers etc that could easily run it. If we move to pure fat linux you have reduced the target market.

In that vein I agree seperating the electronics from the server makes sense. An Arduino shield with RF & relays may be a way to keep the core hardware without too much redesign. Communicate with XAP and usb serial. 

I believe making the web RF device screen into general devices so you can select either inbuilt (e.g. RF,Relay,LED,UDP), custom written plugins or LUA script based plugins. You can then roll these into source XML for xapflash.

So

device.1.type= RF, Tx.On=110FF00, Tx.Off=110FF01, RF=N/A, XAP_monitor=liveduino.RF.3,Page=Lounge,X=100,Y=200,image=Projector.state

device.2.type= Relay, TX.on=LUArelay On Latch, Tx.off=LUArelay 6 Off Latch, RX.on=Plugboard.Relay6.closed, XAP_Monitor=N/A Page=Lounge,X=100,Y=200,image=Aircon.state

you can then use the device settings to create a standard xapflash config.xml from the web interface. Makes it much more approachable, you configure the devices once and the fancy interface works.

If that is where you are going with the plugins I'm ll for it.

Agree local storage, maybe in eeml format? on a low resource DB.

Glam for the control (SWMBO) interface is important, for set up its not so necessary IMHO.

How about an interface to openremote? HAHhub does the clever stuff (bit like the Vera) , Openremote does the Bling? 

You can keep XAPflash in case Openremote goes the wrong way.

Maybe an iServer / openremote gateway?

Member for

16 years 10 months

brett

14 years 4 months ago

I had a brief, and I mean very brief, look at openremote - the UI pretty nice for designing the controller panels.  No point in reinventing the wheel here especially as they have a plug in model for protocols.  I think contributing xapBSC as a protocol would get us 90% of the way and a generic xAP for the remaining 10% - as openremote is java based this shouldn't be to hard.  I know java use to have issues sending UDP broadcast datagrams but that been fixed since jdk 1.6 so we are good now.  Openremote has a UDPListener protocol not sure if these are broadcast or unicast packets, I suspect unicast, in anycase its would be a minor tweak to take this protcol plug in and hack it up to be an xAPBSC.event listener.  This would give 90% of all feedback events that would need monitoring.

Openremote is designed to run on hardware well in excess of the tiny router which the HAH uses but something like the Pi should be able to handle it without too much bother and would definately be an ideal candidate for porting to if it doesn't.

If nothing else adding a few protocols to openremote and getting it working would allow others to play and see what else it can do.  So for a small investment of my time we'd open up a new avenue for exploration and integration.  I'll start looking into this - in my (cough) free time.  4 weeks after moving countries I'm not really back up to speed with HAH stuff just yet - but I'll allocate what spare time I can afford.

I agree that packaging each component as a opkg/ipkg installable is the way forward and its certainly where I/we should head.  As you say there are a ton of NAS devices out there that are all capable of running a simple set of xAP services.  So why not open up for this market. 

Moving into that market involves decoupling the software from the hardware so its more independent and using some sort of plug-in web UI model for its setup and configuration.  The nice thing about XAP is that its already a distributed protocol that doesn't care about IP address which makes separating hardware/software rather easy.

The world will slowly moving away from flash buts its going to a very long time before it dies, so there is a lot of life left in xAPFlash yet.

Brett

Member for

14 years 11 months

AlexS

14 years 4 months ago

Android may be another platform. Plenty of TV set top boxes being sold, soon they will have DVR so will be allways on.

XBMC is now ported in Alpha.

I think we need to see HAH hub as the engine and let other people provide the bodywork.

Have you seen this, looks lik a COSM competitor with cooler Graphs?

http://open.sen.se/

Member for

15 years 3 months

EJ-Ambient

14 years 4 months ago

Well spotted - I've got 4 invites if anyone wants one...... the graphs look cool and they are in 'real-time'!!!

EJ

Member for

13 years 10 months

g8kmh

13 years 10 months ago

I thought I'd have a go at moving Brett's xap-hub to the ARM platform and it went without too much difficulty, other than static library linking, with a few extensions to base UID on IP address to allow multiple Pi's without needing config. I'm using it on openelec (xbmc) as I'm part way through creating a xAP plugin for xbmc and wrestling with Python(!). I'd previously used a hub based on an assortment of code but this one should be able to track any changes.

Attached is the binary for anyone interested, together with the startup script for openelec.

Regards,

Lehane

Attachments
xaphub2.zip (16.58 KB)

Member for

16 years 10 months

brett

13 years 10 months ago

It should compile without any problem - I run the xap-hub my joggler.

I've been thinking about doing a rasp-pi port of all this code - however I found my pi boots up fine but once X is running its beyond usable. I installed openelec and it can take up to 30sec for the damn pointer to move !?

I've been looking around for a distribution that boots up into text mode.   F*cking graphics since when did a linux distriubution default to a GUI interface?  And why is my PI so SLOW?  Could the class 4, 4Gb SD card really be the cause?  Do I really need a class 6 or higher - does it make THAT much difference?

Brett

Member for

15 years 1 month

allanayr

13 years 10 months ago

Arch Linux boots to a cli and seems quite compact. Maybe that would do the trick

Member for

16 years 5 months

BoxingOrange

13 years 10 months ago

Rasbian boots to CLI by default in about 30 seconds.  The card class does make a difference, espically to XBMC.  There are also a few tuning things you can do to make it a little quicker.

I've also had mine reading the data received by the JeeNode basenode.   I think it would also connect easily enough to the HAH PCB using the serial connection, this is something else that's on my list, it's a long list.

Member for

16 years 10 months

brett

13 years 10 months ago

I've downloaded and flashed ARCHLINUX when I get a chance I'll boot this up and see how it goes.  I think the class of the SD card as Karl rightly points out does make a difference too.  I'll have to get something faster.

I wonder if the new UHC specification is supportted?  Those suckers are muy rapido.

Brett

Member for

13 years 10 months

g8kmh

13 years 10 months ago

I've moved openelec to a 512Mb RAM version which is noticeably better (no surprise!) and using an Kingston 8Gb SDHC Class 10.

Lehane

Member for

13 years 11 months

AndrewJ

13 years 10 months ago

Have to agree with the above, 512MB version of the Pi really is an improvement

Member for

16 years 10 months

brett

13 years 10 months ago

Thanks for the updates - I do have a 256Mb version and Archlinux boots pretty quickly on this.  It must be that due to limit RAM and with a slow SD card swapping just kills the poor thing with I/O.

Brett

Member for

13 years 11 months

AndrewJ

13 years 10 months ago

Not sure it the same applies where you are based Brett, but i mananged to sell my 256mb version 2nd hand on ebay for the same price it cost me to order the 512 from cpc / rs the same day.

also i use a UHS spec SD card, i was worried a low class would impact performance

Member for

17 years

derek

13 years 10 months ago

The Rasp Pi et al are all fine. That nice TP Link box looks good too.

However, (in the UK) I can still buy a Livebox on eBay for around GBP10 delivered (as I type, one is closing with 9mins to go at £11 delivered and no bids). Don't forget that this includes a switched mode PSU and a case. 

The HAH firmware has been running on this platform for a fair while. It's generally stable - and where there are any issues, there are folks to help out. 

New ports are fine ... but in the fashion industry of HA, IMHO it's sometimes better to pick a nicely architected platform and to go from there.

Cheers,
Derek

Member for

14 years 5 months

mark_baldwin

13 years 10 months ago

I've bought a couple of those recently. Seems there are at least 2 a week on there. The last one I got actually cost more in postage alone than I paid for it.

Member for

14 years 6 months

magill

12 years 9 months ago

Anyone help please.

I have been following the PI install on the wiki, but I have very little linux knowledge and am at a loss. What does this mean?

pi@raspberrypi ~ $ sudo update-rc.d -f apache2 remove
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'mathkernel' missing LSB tags and overrides
pi@raspberrypi ~ $ sudo make arm-deb
make: *** No rule to make target `arm-deb'.  Stop.
pi@raspberrypi ~ $ sudo dpkg -i build/*.deb
dpkg: error processing build/*.deb (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 build/*.deb
pi@raspberrypi ~ $ sudo INSTALL_DIR=/ make install
make: *** No rule to make target `install'.  Stop.

thanks

John

Member for

15 years 7 months

garrydwilms

12 years 9 months ago

John,

first error is cos apache isn't a default install on Pi so you don't need to remove it.

second is probably cos your in wrong directory. Make sure your in the /portable. Directory where you checked out the code to.

other errors are cos .deb didn't build due to above!

 

at least I think this is the case!

Member for

15 years 1 month

allanayr

12 years 8 months ago

Had a go but it ended like this:

 

/target/klone-core-2.3.0/libu/include -c utils.c -o utils.o
gcc -pipe -I../include -I/home/pi/portable/userapps/hah/klone/klone-2.3.0/build/target/klone-core-2.3.0 -I/home/pi/portable/userapps/hah/klone/klone-2.3.0/build/target/klone-core-2.3.0/libu/include -c tcurl.c -o tcurl.o
In file included from tcurl.c:16:0:
../include/tcurl.h:13:23: fatal error: curl/curl.h: No such file or directory
compilation terminated.
make[5]: *** [tcurl.o] Error 1
make[5]: Leaving directory `/home/pi/portable/userapps/hah/klone/liblivebox'
make[4]: *** [/home/pi/portable/userapps/hah/klone/liblivebox] Error 2
make[4]: Leaving directory `/home/pi/portable/userapps/hah/klone/klone-2.3.0'
make[3]: *** [.real-subdirs] Error 2
make[3]: Leaving directory `/home/pi/portable/userapps/hah/klone/klone-2.3.0'
make[2]: *** [target-options-default] Error 1
make[2]: Leaving directory `/home/pi/portable/userapps/hah/klone/klone-2.3.0'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/pi/portable/userapps/hah/klone'
make: *** [install] Error 2

Now I'm stuck :-(

Member for

15 years 7 months

garrydwilms

12 years 8 months ago

Sounds like you have an issue with curl install.

what happens if you try 

sudo apt-get install libcurl4-openssl-dev
I assume you did do this step 
sudo apt-get install build-essential libxml2-dev libcurl4-openssl-dev flex
From the wiki?

Member for

15 years 1 month

allanayr

12 years 8 months ago

Thanks Garry, I failed to follow that vital instruction in the wiki. All sorted, compiled and running.