The Eclipse M2M (Machine-to-Machine) open source initiative delivers a stack of open source building blocks that accelerate the development of connected solutions.
In this session, you’ll be briefly introduced to the Eclipse M2M projects and discover cool end-to-end examples (Augmented Reality anyone?) combining the use of Android API with Open Hardware platforms (Arduino, Raspberry Pi…) for doing fleet tracking, remote monitoring, home automation, and much more.
31. Show me the code!
var mqtt = require('mqtt');
var c = mqtt.createClient(1883,
'm2m.eclipse.org');
client.on('message’, cb);
client.subscribe('/kettle232/switch');
client.publish('/kettle232/temp’, '72.2');
var cb = function(topic, message) {
// turn the kettle on/off
}
32. Show me the code!
var mqtt = require('mqtt');
var c = mqtt.createClient(1883,
'm2m.eclipse.org');
client.on('message’, cb);
client.subscribe('/kettle232/switch');
client.publish('/kettle232/temp’, '72.2');
var cb = function(topic, message) {
// turn the kettle on/off
}
33. Show me the code!
var mqtt = require('mqtt');
var c = mqtt.createClient(1883,
'm2m.eclipse.org');
client.on('message’, cb);
client.subscribe('/kettle232/switch');
client.publish('/kettle232/temp’, '72.2');
var cb = function(topic, message) {
// turn the kettle on/off
}
34. Show me the code!
var mqtt = require('mqtt');
var c = mqtt.createClient(1883,
'm2m.eclipse.org');
client.on('message’, cb);
client.subscribe('/kettle232/switch');
client.publish('/kettle232/temp’, '72.2');
var cb = function(topic, message) {
// turn the kettle on/off
}
36. Show me the code!
MqttClient c = new MqttClient
(
"tcp://m2m.eclipse.org:1883",
MqttClient.generateClientId()
);
mqttClient.setCallback(…);
mqttClient.connect();
mqttClient.subscribe("/teapot24232/#");
// the rest of your app
37. Show me the code!
MqttClient c = new MqttClient
(
"tcp://m2m.eclipse.org:1883",
MqttClient.generateClientId()
);
mqttClient.setCallback(…);
mqttClient.connect();
mqttClient.subscribe("/teapot24232/#");
// the rest of your app
38. Show me the code!
MqttClient c = new MqttClient
(
"tcp://m2m.eclipse.org:1883",
MqttClient.generateClientId()
);
mqttClient.setCallback(…);
mqttClient.connect();
mqttClient.subscribe("/teapot24232/#");
// the rest of your app
39. Show me the code!
MqttClient c = new MqttClient
(
"tcp://m2m.eclipse.org:1883",
MqttClient.generateClientId()
);
mqttClient.setCallback(…);
mqttClient.connect();
mqttClient.subscribe("/teapot24232/#");
// the rest of your app
40. Show me the code!
Callback code:
mqttClient.setCallback(new MqttCallback() {
@Override
public void messageArrived(String topic,
MqttMessage message)
throws Exception {
// process received message
// e.g. display temperature value
}
// ...
});
41. Show me the code!
Callback code:
mqttClient.setCallback(new MqttCallback() {
@Override
public void messageArrived(String topic,
MqttMessage message)
throws Exception {
// process received message
// e.g. display temperature value
}
// ...
});
42. Simple but not Stupid
• QoS
– at most once, at least once, exactly once, …
• “Last will & Testament”
– automatically publish a message when a client
goes offline
60. Eclipse Smart Home
• A flexible framework for smart home
and ambient assisted living (AAL)
solutions.
• Easy to extend (based on OSGi)
• Smooth Android integration