Sensor9k : A testbed for designing and experimenting with WSN-based ambient intelligence applications