Wednesday 27 June 2012

Social area at JAX Conf - driven by the Liberty Profile and a Raspberry Punnet

This year, IBM will not only be the Gold sponsor at JAX, it will also be sponsoring and running the new Social Area at the conference which will be a place for people to chill, have breakouts, see and present demos, have interviews by the JAX enter and developer works teams and also get a bunch of info around the conference from a web front end which I'll be developing.


The web front end will be powered by a mac mini as the load distributor, and a cluster of raspberry pis, each running the Liberty Profile as the application server our webapps will run on. At this point I should mention that IBM do not own all these Raspberry Pis, it owns one, just like the vast majority.  We're borrowing two other personal Pis kindly on loan by Ross Pavitt and Kevin Turner, fellow IBMers - thanks guys!  If you're attending JAX Conf in San Francisco and want your Pi to be part of the biggest Pi-experiment to around 1000 people, let me know, via a tweet/comment or bring it along on the day and we'll connect it up and it can join the punnet and serve content to the whole conference.

The other reason the mac mini will be in place is to monitor load and performance, and step in where necessary to bail out the punnet during busy times :)  I want to take a photo of each device and make sure that when a user get's a webpage back, they see the physical device which served up the page, be it a Pi or a mac mini!  The aim to to get pages viewable on mobiles, tablets and laptops.

So, what will this social area web content provide?  Here are my ideas so far:
  • A tweet stream following the JAX Conf hash tag
  • A twitter word cloud, showing what's hot at the moment, one for the day and one for the last 30 mins
  • A mash up with Lanyrd for people to engage with feedback on sessions
  • Latest timetable info - what's on now and next
  • Breaking news/changes from the JAX Conf team
  • Info on Social area demos, interviews, breakouts, Q&As etc, as they happen
These are just some of my thoughts which I aim to implement over the next week and set up on the cluster.  The reason for this post though is to get your feedback - what do you want to see up on the Social Area site? What have you found useful info in the past at conferences that you'd love to see here?  Or do you think we've got a good set?

Please let me know at @sjmaple or comment on this post.  Thanks for your feedback and look forward to see you there!  Note: we may have some spare tickets to the event, which we'd look to reward feedback with! :o)

If you want to attend the event, here's a code which will give you a great discount on ticket price:

JAXIBM1 Get $50 off a 1 day pass
JAXIBM2 Get $100 off a 2 day pass
JAXIBM3 Get $200 off a 4 day pass


Sunday 3 June 2012

How can a Pi control a house from 50 miles away?

Easy!  Here's my Pi recipe:

My Ingredients:
1 Raspberry Pi
1 IBM J9 JVM
1 WebSphere Liberty Profile server
1 Really Small Message Broker (RSMB)
1 Eclipse Paho client library
1 Andy Stanford-Clark!

Architecture:

Andy has a very pervasive house with many devices set up to both tweet and publish messages based on events which occur to those devices.  Furthermore, some devices can be controlled by sending messages to topics which they are monitoring, such as a pond fountain, an outdoor light and even a heated towel rail!  The messaging design used was to bridge from the RSMB on the Pi to the existing message broker Andy has set up to monitor and controll his devices.  Any messages sent from or received by either broker will be mirrored by the other via the bridge.  This makes the remaining design on the Pi beyond the RSMB easy, as we can consider everything is local, to the RSMB. Neat!  The visual and interactive side will be taken care of by a web application on the Liberty Profile app server, which connects to the RSMB via an eclipse open source MQTT client project called Paho.

My Method:

I already had a Debian install with both the OpenJDK and IBM J9 JVM installed with my Liberty Profile application server, which I used to run the snoop servlet that I wrote about in a previous post, and also for a cool dynamic development demo for the new Liberty Profile I ran at the IBM Impact conference in May 2012.  My first step was to install, configure and run the RSMB.  It doesn't currently run on the ARM architecture, so I needed to build the source on the Pi and it then just worked out the box, easy.  Next I needed to create a broker.cfg file which had info to pointed to Andy's existing broker, such as IP address and port number, and also describe which topics I wanted to bridge.  This is simply a list of topics with my intended actions, such as 'in' to listen.  That's all I needed to do with the RSMB.

My web application itself is a jsp and servlet based webapp which automatically refreshes itself every 5 seconds to keep the dashboard up to date.  It bundles the Paho client library which it uses to connect to the RSMB and subscribe to a number of topics which passes messages of interest to the dashboard.  The webapp stores info it requires locally in memory for history graphs such as energy consumption.  This data is sent to the Google chart facility (why on earth are Google deprecating this cool graphing function?  Maybe someone can fill me in via comments). The application server config just has the one feature included, the jsp-2.2 feature, as that's all we need in this environment!  This keeps the application server runtime nimble and fast with a low memory footprint.

Results:



So what's next?

I've got a couple of things I want to play with next, I quite fancy connecting the Pi up to my current cost meter at home and to my TV as well and display a channel which shows my energy usage.  If you have any ideas of what you'd like to see, let me know :o)

For more info check out:

WebSphere Liberty Profile http://wasdev.net
Raspberry Pi - http://raspberrypi.org
Eclipse Paho - http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/
RSMB -  https://www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=d5bedadd-e46f-4c97-af89-22d65ffee070
MQTT - http://mqtt.org