New Roomware server coming up

Posted on May 5, 2011


Yesterday I have been cooking up the new infrastructure for the new “Roomware Socket Server”.

Where the old setup was “cloud based” meaning it could be anywhere on any IP address on the web, I found that had a lot of issues regarding ease of setup.

What was wrong with the old approach?

When I made my first Socket Server in 2009 the things below made some kind of sense with what I knew then. Right now, they just feel wrong.

  1. You needed a Web Server in the cloud to run it – This might be conceived to be a non-issue when you run your own dedicated server like me, but:
  2. You Web Server has to be accessible from another port than port 80 – Which can pose an issue when your provider closes everything not SMTP, FTP or HTTP.
  3. You needed some kind of discovery and re-direct to find and access a local Roomware Spot – For which I used Bluetooth Beacons and an online database in 2009.
  4. You needed to register your Roomware hotspot online – To be accessible at all. Which is just meh..
  5. You connect to a roomware application via your Data Plan – Which is not for everybody to have and not always fast or stable (latency and connection drops)
  6. It drains your phone battery like a crazy – Using Sockets and 3G is like 30 minutes online and: off switches your phone

What is the new approach?

  1. Local – Using a local WiFi, local machines, local “servers”, which simplifies building stuff, saves batter life of your phone and allows you to use WiFi tablets as well
  2. More concrete – Building the infrastructure myself, using low budget stuff you can buy around the corner
  3. Simplified – By cutting away as much as possible of what is in the way of your first Smart Spaces setup (setting up hardware, software, removing dependencies)

What happened in early 2010 and 2011

I saw a demo of Brass Monkey in Februari 2009. Which runs purely on the local network via WiFi and your phone. Which is clever, nay, brilliant.

In 2011, Connectify and IOIO for Android came out. Both are major game changers for Do It Yourself low budget Smart Spaces Hacking.

What Connectify does is turning your Windows 7 laptop with WiFi into a WiFi hotspot. IOIO for Android makes is possible to connect devices and sensors to your Android phone. It is like Arduino, but using your Android device (phone or tablet) as the processor and extending the phone with input- and output options for hardware.

IKEA, Android and Media World

IKEA, Android and Media World are all three providers of low budget cute stuff to hack things in your house or elsewhere. Archos as one of the providers  releases Android tablets priced from 99 euro (the Archos 28) to 200 euro (the Arnova 101, 10 inch Android tablet).

IKEA and Media World sell sensors and lighting solutions you can hack and use for your own device.

I bought some Android devices (Archos tablets and 200 euro Android phones) and started re-thinking the whole concept of the Roomware Socket Server. Instead of having a Client / Server setup, where clients are not Servers, I decided that each Socket Client should also have the Socket Server software.

1+1+1 = HotForestGreen: enter the new Roomware Socket Server

Basic overview of the hardware components in a HotforestGreen Smart Space

The new “Roomware” Socket Server environment is currently codenamed HotForestGreen. It runs completely on a local WiFi network which makes it easier to connect to with any device and saves battery life of your phone.

I am not sure whether the: “HotForestGreen” name will stay. It is cute but too long.

Roomware and Smart Spaces

“Roomware” started as “Roomware”. However: “Roomware” is not limited to a room, but could also be a garden, a park or a public square in a city. Hence the addition of: “Smart Spaces”.

Smart Spaces and HotForestGreen

When talking about Smart Spaces, you can run different servers. One is the HotForestGreen Smart Spaces Socket Server. I will come up with a shorter name for everything later.

Multiple Client / Server setup - messages from Client 1 are routed to Clients 2 and 3 via other Servers

The HotForestGreen Socket Server design principles

  1. We have Applications, Events, Socket Clients, Socket Servers and Application SandBoxes – To elaborate:
    1. Applications can be smart houses, smart tables or smart lighting.
    2. Events: Within each Application there are one or more “devices” that can fire and receive Events.
    3. Clients connect to Servers and can subscribe to specific sandboxes and events within those sandboxes
    4. Servers operate as message hubs to push messages (events) from one device (Client) to another.
    5. Application SandBoxes are like walled gardens in which Applications can run. Their main purpose is to avoid Event Leakage when: “House 1” or “Table 1” fires events which are exactly equal to: “House 2” or: “Table 5”.
  2. A Socket Client can also be a Socket Server – Meaning that devices can become hubs, specific providers (like smart tables or walls) can offer their services independently form other devices or servers and the structure has no specific center anymore
  3. A Socket Client can connect to multiple Socket Servers – Meaning that the network of Servers themselves can define and decide which Client will be served by which Server.
  4. Socket Servers will update each other – Using Manifests, each Socket Server will broadcast its new state (client added, new Application Sandbox accepted)
  5. Socket Servers can route messages and events to each other – When multiple clients are connected to multiple Socket Servers, the Socket Servers will assure that all Clients connects to Application SandBox: “A” will receive the messages and events from all other devices and applications in that Sandbox, even when they are dispatched from other Socket Servers than the Clients are connected to.
  6. Clients can re-wire their Socket Server connections – In case of a disconnect of one ore more Sockets, the Client will automatically start scanning for available Socket Servers. Once an available Socket Server is found, the connection is created and messages will be routed to that Client again. Cases in which this can happen are:
    1. The Socket Server application crashed – For some reason the Socket Server died while running.
    2. The machine on which the Socket Server runs crashed – So we have no server at all
    3. The Socket Server ejected the Client – This should not happen, but might be part of a future implementation
    4. The connection was broken – For whatever reason including a hick up in the WiFi network
  7. You run it on a local WiFi network – Looking at everything that was wrong on the first 2009 design, the local WiFi is – I think – the key element for localized Roomware services.
    1. You can host your WiFi network from a Netbook – Using Connectify and a 200 euro Windows 7 Netbook is enough to create a local Roomware host and WiFi hotspot running a Socket Server. Naturally you can use any type of laptop or portable as long as it has WiFi and Windows 7 installed.

First steps on usable proofs of concept

  1. The HFG (HotForestGreen) Application Browser – You want something that is easy to use, easy to expand and packaged in one application you can start and use for all Smart Space based applications. The basis is a Web Browser with a HotForestGreen shell around it. It will cover:
    1. A simple way to expose Smart Space Applications on a screen in the Smart Space – Using the HotForestGreen framework you can set hyperlinks from any other devices (tablets, phones) connected to the network
    2. A simple way to receive an overview of services exposed by the Smart Space – When a Client connects to a Socket Server, it will receive manifests of available services. Depending on the content, these services can be websites or simple remote controls allowing you to manipulate specific aspects of the Smart Space (lighting, doors, houses) or what is presented on screens (web sites, content, specific status reports).
  2. The HFG  Remote Control – Offering a simple to use framework to expose your Smart Space Services with. It will offer:
    1. A simple Smart Spaces Remote Control Framework – To convert (XML or JSON based) Smart Space Manifestos into:
      1. Navigable menus – For each Application Sandbox and all Services within those sandboxes
      2. Remote controls – To take control over a specific Service or device.
  3. HFG Android IOIO Mediators – Allowing you to build IOIO (Arduino for Android devices) applications to manipulate lighting, read sensors and do other nifty things.

What I have been doing the past days

I bought for about 400 euro of hardware to make proof of concepts according to the above lists. This hardware includes:

  1. A 179 euro eMachines netbook – To operate as an ad-hoc WiFi hotspot and low cost HotForestGreen Socket Server.
  2. Three different lighting-concepts sold by IKEA – Including two items from the DIODER series: the lights (39,95 euro) and light strips (29,95 euro); and the SPOKA night lamp (12,99 euro) which looks vaguely like the Nazbataz rabbit.
  3. A smoke alarm – For future use
  4. A night lamp which switches on when it gets dark – (9,99 euro)

On my list are movement sensors used for alarm systems.