The Forum has been wired!
We have spread sensors and various sorts of devices (including an actual robot made of Lego Mindstorms NXT) all over the Forum, and invite you to unleash your creativity by designing an application that will use all the data. Mobile app, augmented reality, social interactivity… the only limit is your imagination.
The winner will get an Apple iPad 2!
If you don't feel like writing a whole application and would like to be part of the contest, just fill in a ticket and join our daily draw to try to win cool swag!
Come by the Sierra Wireless booth, answer the few questions about the sensors and M2M in general, and try to win cool swag brought to you by Sierra and the Eclipse Foundation! We will draw one lucky winner at the end of day 1 and day 2 of the conference. Deadlines to submit your ticket:
Rule #1
You do speak about the M2M contest with everyone at the conference.
Rule #2
You DO speak about the M2M contest with everyone at the conference!
The Best Application will be selected by a panel of judges. The judges will be evaluating the applications based on the following criteria:
It is possible to control the speed and direction of a fan that is inside the Cube, and it is actually very simple to do so. Just send an SMS to +33617026228, with the following form: "FAN1 {SPEED}" where speed is an integer between -100 and 100 (throttle in % and direction). Example: FAN1 -80.
If the SMS received has a different format, then it will simply be displayed on the LCD display as soon as it is received, and this is definitely something that we encourage you to use in your application!
A MongoDB database stores the data history for all the sensors, and you can access it using a very simple REST API.
The URL to which you should make GET requests is: http://m2mcontest.eclipsecon.org/rest_api/<databaseName>/<collectionName>?query_params
criteria=search_criteria
search_criteria is a JSON representation of the search filter.
{"sensor": "CUBE_TEMPERATURE"}{"value": {"$gt": 500}}. Other comparators are of course available: $lt, $lte, $gte, $ne.
sort=sort_fields
sort_fields is a JSON representation of the field you wants to sort the result by, with the associated order.
{"sensor":1,"value":-1} would sort the result by ascending 'sensor' key, and descending 'value' key.
limit=n
n is the maximum number of results you want to get.
sensors database
data collection contains the raw data. That means there are tons of data in this collection, but it can be useful if you want to access the last instant value of a given variable.
Returned values have the following format:
{
"id":0,
"ok":1,
"results":[
{
"_id":{
"$oid":"4e98b520e4b0331bc63552f8"
},
"sensor":"CUBE_ILLUMINANCE",
"value":250
},
{
"_id":{
"$oid":"4e98b520e4b0331bc63552f9"
},
"sensor":"CUBE_TEMPERATURE",
"value":19.010000000000002
}
]
}
You can use the $oid field to know the timestamp of the value: first 8 hexadecimal bytes are a Unix timestamp (and in other examples below, the same trick works wherever you encounter a $oid field..).
info collection contains metadata related to the sensors. You should use it to discover the available sensors, and grab their description.
Returned values have the following format:
{
"ok":1,
"results":[
{
"_id":{
"$oid":"4ea13ed7da0693209c524a25"
},
"sensor":"CUBE_TEMPERATURE",
"description":"Temperature at the cube",
"unit":"\u00b0C"
},
{
"_id":{
"$oid":"4ea13ed7da0693209c524a26"
},
"sensor":"CUBE_ILLUMINANCE",
"description":"Ambient light level at the cube",
"unit":"lux"
}
],
"id":79
}
consolidatedData_OneMinute, consolidatedData_FiveMinute and consolidatedData_OneHour collections contain the results of a map/reduce job applied to raw data, and allow you to access min/max/averages sensors values on given periods of time.
Returned values have the following format:
{
"id":7,
"ok":1,
"results":[
{
"_id":{
"sensorId":"CUBE_ILLUMINANCE",
"ts":{
"$date":1318630680000
}
},
"value":{
"average":275.0,
"maximum":300.0,
"minimum":250.0,
"nbSamples":2.0,
"sensorId":"CUBE_ILLUMINANCE"
}
},
{
"_id":{
"sensorId":"CUBE_TEMPERATURE",
"ts":{
"$date":1318630680000
}
},
"value":{
"average":19.02,
"maximum":19.02,
"minimum":19.010000000000002,
"nbSamples":2.0,
"sensorId":"CUBE_TEMPERATURE"
}
}
]
}
rfid database
history collection contains the history of the scans performed by the RFID scanner.
Returned values have the following format:
{
"ok":1,
"results":[
{
"_id":{
"$oid":"4eaaaa5dd3739934e100002e"
},
"tag":"B73C5F60"
},
{
"_id":{
"$oid":"4eaaacd9d3739934e100007f"
},
"tag":"B73C5F60"
}
],
"id":499
}
To know what physical object corresponds to which tag ID, you should look into the info collection. See below!
info collection contains the human-readable description of the physical objects that can be scanned.
The objects we brought for you to play with are Audio CDs and video games (and don't try stealing them, boxes are empty! ☺). So how about, for example, automatically starting to play the album you just scanned in iTunes?
Returned values have the following format:
{
"ok":1,
"results":[
{
"description":"Legend - The Best of Bob Marley and the Wailers",
"imageURL":"http://ecx.images-amazon.com/images/I/51Q6MoBtPQL._SS500_.jpg",
"barcode":"042284621021",
"_id":{
"$oid":"4eb06430da068e43423d616b"
},
"type":"CD",
"tag":"99878E2D"
},
{
"description":"Rayman contre les Lapins Cr\u00e9tins",
"imageURL":"http://ecx.images-amazon.com/images/I/51MoOCp87SL.jpg",
"barcode":"3307210230157",
"_id":{
"$oid":"4eb06430da068e43423d616e"
},
"type":"Wii Game",
"tag":"B73C5F60"
}
],
"id":1560
}
commands database
history collection contains the history of the command received and actually handled by the Cube. You may want to use it to get the latest command received, or compute statistics regarding the most executed commands.
Returned values have the following format:
{
"ok":1,
"results":[
{
"command":"FAN1 80",
"_id":{
"$oid":"4ea80530d37399153d0000cd"
},
"type":"SMS",
"from":"33619196101"
},
{
"command":"FAN1 30",
"_id":{
"$oid":"4ea814a6d37399274a00008d"
},
"type":"SMS",
"from":"33619196101"
}
],
"id":232
}
The only supported type at the moment is 'SMS'. In case of an SMS, the 'from' attribute is the phone number of the SMS sender.
We have put a very simple Javascript application on github to help you getting familiar with the API and the manipulation of consolidated data.
You can grab the source code at: https://github.com/kartben/eclipsecon-m2m-contest/tree/master/samples/
If you are building an OSGi-based application, then you probably want to use the following bundle. It publishes a service (IM2MServerAccessor) allowing you to easily get sensor data. You wil also automagically get notified when new data is available, by subscribing to the m2m/sensor EventAdmin topic.
The code of this bundle may not be 100% bug-free, but it should help you getting started!
The winner of the programming contest will be elected by a panel of Eclipse community members and M2M experts on Friday, 4th.
Members of the jury are: