SlideShare a Scribd company logo
1 of 19
IoT Hackathon : Tessel
Thomas Conté @tomconte
The Tessel is tiny
Its modules too
Modules
▪ Accelerometer
▪ Ambient Light + Sound
▪ Audio
▪ Bluetooth Low Energy
▪ Camera
▪ Climate
▪ GPS
▪ GPRS
▪ Infrared
▪ MicroSD Card
▪ nRF24 Module
▪ Relay
▪ RFID
▪ Servo
http://blog.technical.io/post/98257815497/how-tessel-works-the-basics
What can you do with a Tessel?
▪ Ambient monitoring: monitor temperature, noise… Detect variations
and take action / notify.
– Is the light on at home?Turn on Hue lights automatically at dark.
▪ Accelerometer: game controllers, activity trackers…
▪ Camera: take pictures on event, motion detection…
▪ Infrared: control yourTV
– Clap your hands to turn it on
▪ Lots of projects ideas: https://projects.tessel.io/projects
What can you do with Azure?
▪ In theory, anything you can do in Node.JS
– In practice, some complex modules or projects will cause translation problems
because not all Node constructs are fully supported
– Most notably, the Azure SDKs for Node.JS seem to be causing some problems
– It might be easier to revert to plain old REST APIs when possible
▪ Upload stuff to Azure: Blob Storage
▪ Send monitoring/telemetry to Azure: Service Bus, Event Hubs
– Experiment with different protocols: HTTPS, AMQP, MQTT…
▪ Interact with mobile devices through Mobile Services
– Send notifications
▪ Labs on https://github.com/dx-ted-emea/azure-tessel
Node for Tessel crash course
Node.JS for the Tessel
▪ Node.JS is usually used on the server-side; here we are going to use it
on the client side!
▪ Node.JS is well suited to real-time processing of events, thanks to its
asynchronous nature; this is well adapted to a device whose main job
is to monitor and process events (temperature / noise / light / etc.)
▪ Instead of listening to server-side events (GET, POST, etc.) you will be
listening to module-specific events
▪ Events are handled using callbacks, functions that you pass when
registering for the event
Hello World: tessel run blinky.js
// Import the interface to Tessel hardware
var tessel = require('tessel');
// Set the led pins as outputs with initial states
// Truthy initial state sets the pin high
// Falsy sets it low.
var led1 = tessel.led[0].output(1);
var led2 = tessel.led[1].output(0);
setInterval(function () {
console.log("I'm blinking! (Press CTRL + C to stop)");
// Toggle the led states
led1.toggle();
led2.toggle();
}, 100);
npm for the Tessel
▪ When you install theTessel library, you will use npm –g
▪ This will install the library and CLI “globally”, i.e. in a place where it
can be found by default from your shell
▪ When you installTessel Node.JS modules (corresponding to the
hardware “modules”) you will not use –g
▪ This will install the module locally in a directory called node_modules
▪ When you run your script with tessel run, all the dependent modules
in node_modules will automatically be packaged and sent to the
Tessel
Listen for Ambient module events
var tessel = require('tessel');
var ambientlib = require('ambient-attx4');
var ambient = ambientlib.use(tessel.port['A']);
ambient.on('ready', function () {
ambient.setLightTrigger(0.5);
ambient.on('light-trigger', function(data) {
console.log("Our light trigger was hit:", data);
});
});
JavaScript callback hell
var db = require('somedatabaseprovider');
http.get('/recentposts', function(req, res){
db.openConnection('host', creds, function(err, conn){
res.param['posts'].forEach(post) {
conn.query('select * from users where id=' + post['user'],function(err,results){
conn.close();
res.send(results[0]);
});
}
});
});
Don’t panic
var db = require('somedatabaseprovider');
http.get('/recentposts', afterRecentPosts);
function afterRecentPosts(req, res) {
db.openConnection('host', creds, function(err, conn) {
afterDBConnected(res, conn);
});
}
function afterDBConnected(err, conn) {
res.param['posts'].forEach(post) {
conn.query('select * from users where id=‘
+post['user'],afterQuery);
}
}
function afterQuery(err, results) {
conn.close();
res.send(results[0]);
}
▪ Avoid anonymous callbacks
▪ Give them names and move
them out of the “pyramid”
▪ This is good enough to
make the code reasonably
maintainable
▪ To go further, explore
JavaScript Promises and/or
the Q library
Let’s hack!
▪ Grab your hardware
▪ Pair up
–Might be best to have one person who knows
JS/Node per pair
▪ Get something done in 4 hours
▪ Present your results/learnings/findings
Getting Started
▪ First, install Node.JS!
–http://nodejs.org/
–Click on the big green INSTALL button
▪ Go to tessel.io/start
▪ Basically,
–npm install -g tessel
–tessel update
More getting started: Wi-Fi
▪ Pretty hard to connect to MSFT network, even MSFTOPEN isn’t
stable
▪ Revert to using phone hotspot
▪ tessel wifi -n “MyPhone" -p "Passxyz "
The End

More Related Content

What's hot

DevStack: Learn OpenStack by Running OpenStack
DevStack: Learn OpenStack by Running OpenStackDevStack: Learn OpenStack by Running OpenStack
DevStack: Learn OpenStack by Running OpenStackEverett Toews
 
DevStack: A developers cloud in a box.
DevStack: A developers cloud in a box.DevStack: A developers cloud in a box.
DevStack: A developers cloud in a box.openstackindia
 
5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterpnvluan
 
TryStack: A Sandbox for OpenStack Users and Admins
TryStack: A Sandbox for OpenStack Users and AdminsTryStack: A Sandbox for OpenStack Users and Admins
TryStack: A Sandbox for OpenStack Users and AdminsAnne Gentle
 
How Yelp uses Mesos to Power its SOA Infrastructure
How Yelp uses Mesos to Power its SOA InfrastructureHow Yelp uses Mesos to Power its SOA Infrastructure
How Yelp uses Mesos to Power its SOA InfrastructureEvanKrall
 
From nothing to Prometheus : one year after
From nothing to Prometheus : one year afterFrom nothing to Prometheus : one year after
From nothing to Prometheus : one year afterAntoine Leroyer
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hoursHow to master OpenStack in 2 hours
How to master OpenStack in 2 hoursOpenCity Community
 
Fluentd - CNCF Paris
Fluentd - CNCF ParisFluentd - CNCF Paris
Fluentd - CNCF ParisHorgix
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Matt Ray
 
OSMC 2011 | Distributed monitoring using NSClient++ by Michael Medin
OSMC 2011 | Distributed monitoring using NSClient++ by Michael MedinOSMC 2011 | Distributed monitoring using NSClient++ by Michael Medin
OSMC 2011 | Distributed monitoring using NSClient++ by Michael MedinNETWAYS
 
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013Viktor Sovietov
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with ChefMatt Ray
 
London open stack meet up - nov 2015
London open stack meet up - nov 2015London open stack meet up - nov 2015
London open stack meet up - nov 2015Darryl Weaver
 
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebula Project
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning TalkJan Gehring
 

What's hot (17)

DevStack: Learn OpenStack by Running OpenStack
DevStack: Learn OpenStack by Running OpenStackDevStack: Learn OpenStack by Running OpenStack
DevStack: Learn OpenStack by Running OpenStack
 
Linux performance
Linux performanceLinux performance
Linux performance
 
DevStack: A developers cloud in a box.
DevStack: A developers cloud in a box.DevStack: A developers cloud in a box.
DevStack: A developers cloud in a box.
 
5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp5.installing oracle grid_11g_r2_on_red_hat_enterp
5.installing oracle grid_11g_r2_on_red_hat_enterp
 
TryStack: A Sandbox for OpenStack Users and Admins
TryStack: A Sandbox for OpenStack Users and AdminsTryStack: A Sandbox for OpenStack Users and Admins
TryStack: A Sandbox for OpenStack Users and Admins
 
How Yelp uses Mesos to Power its SOA Infrastructure
How Yelp uses Mesos to Power its SOA InfrastructureHow Yelp uses Mesos to Power its SOA Infrastructure
How Yelp uses Mesos to Power its SOA Infrastructure
 
From nothing to Prometheus : one year after
From nothing to Prometheus : one year afterFrom nothing to Prometheus : one year after
From nothing to Prometheus : one year after
 
How to master OpenStack in 2 hours
How to master OpenStack in 2 hoursHow to master OpenStack in 2 hours
How to master OpenStack in 2 hours
 
Fluentd - CNCF Paris
Fluentd - CNCF ParisFluentd - CNCF Paris
Fluentd - CNCF Paris
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013
 
OSMC 2011 | Distributed monitoring using NSClient++ by Michael Medin
OSMC 2011 | Distributed monitoring using NSClient++ by Michael MedinOSMC 2011 | Distributed monitoring using NSClient++ by Michael Medin
OSMC 2011 | Distributed monitoring using NSClient++ by Michael Medin
 
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013
Erlang On Xen @ Kiev Functional Programming event, Aug 3 2013
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with Chef
 
London open stack meet up - nov 2015
London open stack meet up - nov 2015London open stack meet up - nov 2015
London open stack meet up - nov 2015
 
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
 

Similar to Tessel + Azure IoT hackathon intro

Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project Oxford
Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project OxfordNode.JS Paris Meetup - the Tessel microcontroller, Azure and Project Oxford
Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project OxfordThomas Conté
 
How NOT to write in Node.js
How NOT to write in Node.jsHow NOT to write in Node.js
How NOT to write in Node.jsPiotr Pelczar
 
Arduino delphi 2014_7_bonn
Arduino delphi 2014_7_bonnArduino delphi 2014_7_bonn
Arduino delphi 2014_7_bonnMax Kleiner
 
Zabbix LLD from a C Module by Jan-Piet Mens
Zabbix LLD from a C Module by Jan-Piet MensZabbix LLD from a C Module by Jan-Piet Mens
Zabbix LLD from a C Module by Jan-Piet MensNETWAYS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsRichard Lee
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsGary Yeh
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09Guy Korland
 
Saltstack - Orchestration & Application Deployment
Saltstack - Orchestration & Application DeploymentSaltstack - Orchestration & Application Deployment
Saltstack - Orchestration & Application Deploymentinovex GmbH
 
Introduction to nodejs
Introduction to nodejsIntroduction to nodejs
Introduction to nodejsJames Carr
 
Anatomy of an action
Anatomy of an actionAnatomy of an action
Anatomy of an actionGordon Chung
 
Game Development using SDL and the PDK
Game Development using SDL and the PDK Game Development using SDL and the PDK
Game Development using SDL and the PDK ardiri
 
Async Best Practices
Async Best PracticesAsync Best Practices
Async Best PracticesLluis Franco
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/MultitaskingSasha Kravchuk
 

Similar to Tessel + Azure IoT hackathon intro (20)

Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project Oxford
Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project OxfordNode.JS Paris Meetup - the Tessel microcontroller, Azure and Project Oxford
Node.JS Paris Meetup - the Tessel microcontroller, Azure and Project Oxford
 
Node js lecture
Node js lectureNode js lecture
Node js lecture
 
How NOT to write in Node.js
How NOT to write in Node.jsHow NOT to write in Node.js
How NOT to write in Node.js
 
Arduino delphi 2014_7_bonn
Arduino delphi 2014_7_bonnArduino delphi 2014_7_bonn
Arduino delphi 2014_7_bonn
 
Zabbix LLD from a C Module by Jan-Piet Mens
Zabbix LLD from a C Module by Jan-Piet MensZabbix LLD from a C Module by Jan-Piet Mens
Zabbix LLD from a C Module by Jan-Piet Mens
 
Node.js essentials
 Node.js essentials Node.js essentials
Node.js essentials
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09
 
Saltstack - Orchestration & Application Deployment
Saltstack - Orchestration & Application DeploymentSaltstack - Orchestration & Application Deployment
Saltstack - Orchestration & Application Deployment
 
Introduction to nodejs
Introduction to nodejsIntroduction to nodejs
Introduction to nodejs
 
Anatomy of an action
Anatomy of an actionAnatomy of an action
Anatomy of an action
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
SDAccel Design Contest: Xilinx SDAccel
SDAccel Design Contest: Xilinx SDAccel SDAccel Design Contest: Xilinx SDAccel
SDAccel Design Contest: Xilinx SDAccel
 
Game Development using SDL and the PDK
Game Development using SDL and the PDK Game Development using SDL and the PDK
Game Development using SDL and the PDK
 
Async Best Practices
Async Best PracticesAsync Best Practices
Async Best Practices
 
.NET Multithreading/Multitasking
.NET Multithreading/Multitasking.NET Multithreading/Multitasking
.NET Multithreading/Multitasking
 
Task and Data Parallelism
Task and Data ParallelismTask and Data Parallelism
Task and Data Parallelism
 
Elk stack @inbot
Elk stack @inbotElk stack @inbot
Elk stack @inbot
 
Nodejs
NodejsNodejs
Nodejs
 

More from Thomas Conté

DevSum'15 : Microsoft Azure and Things
DevSum'15 : Microsoft Azure and ThingsDevSum'15 : Microsoft Azure and Things
DevSum'15 : Microsoft Azure and ThingsThomas Conté
 
Azure Web Camp : Cache Distribué
Azure Web Camp : Cache DistribuéAzure Web Camp : Cache Distribué
Azure Web Camp : Cache DistribuéThomas Conté
 
Azure Web Camp : Moteur de Recherche
Azure Web Camp : Moteur de RechercheAzure Web Camp : Moteur de Recherche
Azure Web Camp : Moteur de RechercheThomas Conté
 
Azure Web Camp : NoSQL
Azure Web Camp : NoSQLAzure Web Camp : NoSQL
Azure Web Camp : NoSQLThomas Conté
 
Running Java workloads in Microsoft Azure
Running Java workloads in Microsoft AzureRunning Java workloads in Microsoft Azure
Running Java workloads in Microsoft AzureThomas Conté
 
TechDays 2014 : retour d'expérience Kompass migration Java dans Azure
TechDays 2014 : retour d'expérience Kompass migration Java dans AzureTechDays 2014 : retour d'expérience Kompass migration Java dans Azure
TechDays 2014 : retour d'expérience Kompass migration Java dans AzureThomas Conté
 
TechDays 2014 : tour d'horizon de Java dans Azure
TechDays 2014 : tour d'horizon de Java dans AzureTechDays 2014 : tour d'horizon de Java dans Azure
TechDays 2014 : tour d'horizon de Java dans AzureThomas Conté
 
Architecture d'une application Facebook pour Windows Azure
Architecture d'une application Facebook pour Windows AzureArchitecture d'une application Facebook pour Windows Azure
Architecture d'une application Facebook pour Windows AzureThomas Conté
 
JavaScript pour les développeurs .NET
JavaScript pour les développeurs .NETJavaScript pour les développeurs .NET
JavaScript pour les développeurs .NETThomas Conté
 
Presentation: Java in the Cloud with Windows Azure
Presentation: Java in the Cloud with Windows AzurePresentation: Java in the Cloud with Windows Azure
Presentation: Java in the Cloud with Windows AzureThomas Conté
 
Présentation Windows Azure - MS Days 2011
Présentation Windows Azure - MS Days 2011Présentation Windows Azure - MS Days 2011
Présentation Windows Azure - MS Days 2011Thomas Conté
 
ReMix11 Paris: Windows Azure & développement mobile
ReMix11 Paris: Windows Azure & développement mobileReMix11 Paris: Windows Azure & développement mobile
ReMix11 Paris: Windows Azure & développement mobileThomas Conté
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une Application
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une ApplicationTechDays 2010 (CLO301) : Windows Azure Comment Migrer Une Application
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une ApplicationThomas Conté
 
TechDays 2010 (CLO202) : Introduction à Windows Azure
TechDays 2010 (CLO202) : Introduction à Windows AzureTechDays 2010 (CLO202) : Introduction à Windows Azure
TechDays 2010 (CLO202) : Introduction à Windows AzureThomas Conté
 

More from Thomas Conté (16)

DevSum'15 : Microsoft Azure and Things
DevSum'15 : Microsoft Azure and ThingsDevSum'15 : Microsoft Azure and Things
DevSum'15 : Microsoft Azure and Things
 
Azure Web Camp : Cache Distribué
Azure Web Camp : Cache DistribuéAzure Web Camp : Cache Distribué
Azure Web Camp : Cache Distribué
 
Azure Web Camp : Moteur de Recherche
Azure Web Camp : Moteur de RechercheAzure Web Camp : Moteur de Recherche
Azure Web Camp : Moteur de Recherche
 
Azure Web Camp : NoSQL
Azure Web Camp : NoSQLAzure Web Camp : NoSQL
Azure Web Camp : NoSQL
 
Running Java workloads in Microsoft Azure
Running Java workloads in Microsoft AzureRunning Java workloads in Microsoft Azure
Running Java workloads in Microsoft Azure
 
TechDays 2014 : retour d'expérience Kompass migration Java dans Azure
TechDays 2014 : retour d'expérience Kompass migration Java dans AzureTechDays 2014 : retour d'expérience Kompass migration Java dans Azure
TechDays 2014 : retour d'expérience Kompass migration Java dans Azure
 
TechDays 2014 : tour d'horizon de Java dans Azure
TechDays 2014 : tour d'horizon de Java dans AzureTechDays 2014 : tour d'horizon de Java dans Azure
TechDays 2014 : tour d'horizon de Java dans Azure
 
Linux on azure
Linux on azureLinux on azure
Linux on azure
 
Architecture d'une application Facebook pour Windows Azure
Architecture d'une application Facebook pour Windows AzureArchitecture d'une application Facebook pour Windows Azure
Architecture d'une application Facebook pour Windows Azure
 
JavaScript pour les développeurs .NET
JavaScript pour les développeurs .NETJavaScript pour les développeurs .NET
JavaScript pour les développeurs .NET
 
Presentation: Java in the Cloud with Windows Azure
Presentation: Java in the Cloud with Windows AzurePresentation: Java in the Cloud with Windows Azure
Presentation: Java in the Cloud with Windows Azure
 
Présentation Windows Azure - MS Days 2011
Présentation Windows Azure - MS Days 2011Présentation Windows Azure - MS Days 2011
Présentation Windows Azure - MS Days 2011
 
ReMix11 Paris: Windows Azure & développement mobile
ReMix11 Paris: Windows Azure & développement mobileReMix11 Paris: Windows Azure & développement mobile
ReMix11 Paris: Windows Azure & développement mobile
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une Application
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une ApplicationTechDays 2010 (CLO301) : Windows Azure Comment Migrer Une Application
TechDays 2010 (CLO301) : Windows Azure Comment Migrer Une Application
 
TechDays 2010 (CLO202) : Introduction à Windows Azure
TechDays 2010 (CLO202) : Introduction à Windows AzureTechDays 2010 (CLO202) : Introduction à Windows Azure
TechDays 2010 (CLO202) : Introduction à Windows Azure
 

Recently uploaded

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Tessel + Azure IoT hackathon intro

  • 1. IoT Hackathon : Tessel Thomas Conté @tomconte
  • 4. Modules ▪ Accelerometer ▪ Ambient Light + Sound ▪ Audio ▪ Bluetooth Low Energy ▪ Camera ▪ Climate ▪ GPS ▪ GPRS ▪ Infrared ▪ MicroSD Card ▪ nRF24 Module ▪ Relay ▪ RFID ▪ Servo
  • 5.
  • 7. What can you do with a Tessel? ▪ Ambient monitoring: monitor temperature, noise… Detect variations and take action / notify. – Is the light on at home?Turn on Hue lights automatically at dark. ▪ Accelerometer: game controllers, activity trackers… ▪ Camera: take pictures on event, motion detection… ▪ Infrared: control yourTV – Clap your hands to turn it on ▪ Lots of projects ideas: https://projects.tessel.io/projects
  • 8. What can you do with Azure? ▪ In theory, anything you can do in Node.JS – In practice, some complex modules or projects will cause translation problems because not all Node constructs are fully supported – Most notably, the Azure SDKs for Node.JS seem to be causing some problems – It might be easier to revert to plain old REST APIs when possible ▪ Upload stuff to Azure: Blob Storage ▪ Send monitoring/telemetry to Azure: Service Bus, Event Hubs – Experiment with different protocols: HTTPS, AMQP, MQTT… ▪ Interact with mobile devices through Mobile Services – Send notifications ▪ Labs on https://github.com/dx-ted-emea/azure-tessel
  • 9. Node for Tessel crash course
  • 10. Node.JS for the Tessel ▪ Node.JS is usually used on the server-side; here we are going to use it on the client side! ▪ Node.JS is well suited to real-time processing of events, thanks to its asynchronous nature; this is well adapted to a device whose main job is to monitor and process events (temperature / noise / light / etc.) ▪ Instead of listening to server-side events (GET, POST, etc.) you will be listening to module-specific events ▪ Events are handled using callbacks, functions that you pass when registering for the event
  • 11. Hello World: tessel run blinky.js // Import the interface to Tessel hardware var tessel = require('tessel'); // Set the led pins as outputs with initial states // Truthy initial state sets the pin high // Falsy sets it low. var led1 = tessel.led[0].output(1); var led2 = tessel.led[1].output(0); setInterval(function () { console.log("I'm blinking! (Press CTRL + C to stop)"); // Toggle the led states led1.toggle(); led2.toggle(); }, 100);
  • 12. npm for the Tessel ▪ When you install theTessel library, you will use npm –g ▪ This will install the library and CLI “globally”, i.e. in a place where it can be found by default from your shell ▪ When you installTessel Node.JS modules (corresponding to the hardware “modules”) you will not use –g ▪ This will install the module locally in a directory called node_modules ▪ When you run your script with tessel run, all the dependent modules in node_modules will automatically be packaged and sent to the Tessel
  • 13. Listen for Ambient module events var tessel = require('tessel'); var ambientlib = require('ambient-attx4'); var ambient = ambientlib.use(tessel.port['A']); ambient.on('ready', function () { ambient.setLightTrigger(0.5); ambient.on('light-trigger', function(data) { console.log("Our light trigger was hit:", data); }); });
  • 14. JavaScript callback hell var db = require('somedatabaseprovider'); http.get('/recentposts', function(req, res){ db.openConnection('host', creds, function(err, conn){ res.param['posts'].forEach(post) { conn.query('select * from users where id=' + post['user'],function(err,results){ conn.close(); res.send(results[0]); }); } }); });
  • 15. Don’t panic var db = require('somedatabaseprovider'); http.get('/recentposts', afterRecentPosts); function afterRecentPosts(req, res) { db.openConnection('host', creds, function(err, conn) { afterDBConnected(res, conn); }); } function afterDBConnected(err, conn) { res.param['posts'].forEach(post) { conn.query('select * from users where id=‘ +post['user'],afterQuery); } } function afterQuery(err, results) { conn.close(); res.send(results[0]); } ▪ Avoid anonymous callbacks ▪ Give them names and move them out of the “pyramid” ▪ This is good enough to make the code reasonably maintainable ▪ To go further, explore JavaScript Promises and/or the Q library
  • 16. Let’s hack! ▪ Grab your hardware ▪ Pair up –Might be best to have one person who knows JS/Node per pair ▪ Get something done in 4 hours ▪ Present your results/learnings/findings
  • 17. Getting Started ▪ First, install Node.JS! –http://nodejs.org/ –Click on the big green INSTALL button ▪ Go to tessel.io/start ▪ Basically, –npm install -g tessel –tessel update
  • 18. More getting started: Wi-Fi ▪ Pretty hard to connect to MSFT network, even MSFTOPEN isn’t stable ▪ Revert to using phone hotspot ▪ tessel wifi -n “MyPhone" -p "Passxyz "