SlideShare uma empresa Scribd logo
1 de 65
Baixar para ler offline
HOW I GOT BACK
MY CODING MOJO!
Mark West
#iottechday
What	is	Mojo?
“Any	application	that	can	be	
written	in	JavaScript,	will	
eventually	be	written	in	
JavaScript”
James	Atwood	(founder,	 	stackoverflow.com)
NodeBot Rover
NodeBot Rover	Demo
https://vimeo.com/162426456
NodeBot Rover	Component	Overview
Hardware
Computer
Micro	
Controller
Camera
Chassis
Pan	&	Tilt
Software
Speech
Robot	
Control
Web	
Server
Integration
Other
The	Arduino Ecosystem
• MicroController platform.
• Many	different	Arduino
models.
• Open	Source	design.
• MicroControllers extensible	
via	“Shields”.
Putting	the Hardware	Together
Two Servos
for	Camera
Pan	&	Tilt
Servos wired
to	Arduino
Chassis
Raspberry PI	
In	Plastic Case
WIFI	Dongle
Raspberry PI	
Camera
Wired directly
to	the
Raspberry PI
Actuators
Sensors
Nervous System
Raspberry	PI	2Raspberry	PI	Cam
Arduberry Microcontroller Arduino Chassis Servo
Servo
Brain
NodeBot Rover	Hardware
Combining the Raspberry PI	&	Arduino
Raspberry PI
• Linux	PC.
• Supports	USB	peripherals.
• Programming.
ArduinoPlatform
• MicroController.
• Robust.
• Native	analogue support.
The	whole is	greater than the sum	of parts!
Actuators
Sensors
Nervous System
Raspberry	PI	2Raspberry	PI	Cam
Arduberry Microcontroller Arduino Chassis Servo
Servo
Brain
NodeBot Rover	Hardware
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
Speech
Robot	
Control
Web	
Server
Integration
Other
Raspberry	PI	2
Arduberry
Servo
Software	Communication	across	
Hardware	Layers
Servo
Raspberry PI	 Chassis
JavaScriptPI Binary (Compiled C	/	C++)
The	NodeBots Movement
Source	:	nodebots.io
1. Maturity
2. Community
3. DSL
4. Portability
5. Open	Source
6. Node.js ecosystem
7. REPL
Benefits	of	using	Johnny-Five
Imports	J5	Dependancy
Adds LED	instance to	REPL
Declares LED	as	connected to	UNO	Pin	13
Blinks	LED	every 500	milliseconds
Code	block triggered by	UNO	”Ready”	Event
Initialises UNO
Johnny-Five	Code	Example
var five = require("johnny-five");
var myBoard = new five.Board();
myBoard.on("ready", function() {
var myLed = new five.Led(13);
myLed.blink(500);
this.repl.inject({
replLed: myLed
});
});
Johnny-Five	REPL	Demo
https://vimeo.com/134953425
Arduberry
Servo
Bridging	the	gap	with	Firmata
Servo
Raspberry PI	 Chassis
Johnny-Five
(Firmata Client)
Std.	Firmata
(Firmata Server)
JavaScriptPI Binary (Compiled C	/	C++)
Getting	Started	with	Johnny-Five
1. Buy	an	Arduino Experimenters	Kit.
2. Follow	the	tutorials	at	http://node-ardx.org.
3. Visit	http://johnny-five.io for	more	
information	and	inspiration.
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
Speech
Johnny-
Five
Web	
Server
Integration
Other
Speech	Recognition	Requirements
Need	to	have
• Quality	and	speed	of	
speech	recognition.
• Free,	no	restrictions.
• Software	based.
• JavaScript.
Nice	to	have
• Speech	to	text.
• One	stop	service.
• Battle	tested.
Web	Speech	
API
(limited	to	Google	Chrome)
Web	Speech	API	:	Configuration
Web	Speech	API	:	Events
Web	Speech	API	:	Control
Speech	Demo
See	https://vimeo.com/162426456 for	an	
example	of	the	speech	recognition	in	progress.
Button	press	and	release	connected	to	
Web	Speech	API	start and	stop Control	
methods.
Continuous	dictation	switched	on,	to	avoid	
cutting	commands	short.	
Interim	results	switched	on	– shown	in	
green	text	(final	results	in	white).
Each	set	of	results	checked	for	uniqueness	
to	avoid	sending	duplicate	commands	to	
the	Robot.
Web	Speech	API	:	
Robot
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
HTML5
Speech
Johnny-
Five
Web	
Server
Integration
Other
Node.js
Express	Web	
Server
(17	lines	of	code)
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
Speech
Johnny-
Five
Express
Integration
Other
Johnny-Five	
Process
Express	
Process
Raspberry PI	2
WE
Browser
HTTPS
NodeBot
Rover
Hardware
Firmata
Johnny-Five	
Process
Express	
Process
Raspberry PI	2
WE
Browser
HTTPS
NodeBot
Rover
Hardware
Firmata
MQTT
Message	Broker
MQTT
MQTT	over	
WebSockets
Commands
Acknowledgements
MQTT.js
Client
MQTT.js
Client
Why Add a	Message	Broker?
• Seperation of
concerns.
• Isolate main
components for	
easier testing.
MQTT	– MQ	Telemetry Transport
• Internet of Things	connectivityprotocol.
• Designed to	be	lightweightwith a	small footprint and	little
overhead.
• Is	a	protocoland a	Pub-Sub	Message	Broker.
• Used	by	Facebook for	pushing updates to	mobile	clients.
Adding MQTT	to	the NodeBot Rover
Broker
• Public	MQTT	Broker
– ManyPublic	Brokers	exist.
– One	less	process to	run	on
RaspberryPI.
Client
• MQTT.js
– Provides an	MQTT	client
libraryfor	Node.js.
– Extremelysimple	to	use.
– Integrates seamlesslywith
Johnny-Five.
MQTT.js (Node.js)	Client	Example
MQTT	Over	WebSockets with MQTT.js
• MQTT.js is	a	Node.js package and	is	
meant for	use on the Server	Side.
• To	allow MQTT.js to	run	from	the
Browser,	we first	needed to	
”Browserify”	the MQTT	library.
• We could then access the
”Browserified”	MQTT	client library
from	the Browser.
• This	solution requires that your MQTT	
Broker	has	a	WebSocket endpoint.
MQTT	Over	WebSockets Demo
Demo	of	the	HiveMQ WebSocket Client
http://www.hivemq.com/demos/websocket-
client
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
HTML5	
Speech
Johnny-
Five
Express
MQTT	&	
WebSocket
Other
Node.js Twitter Client
• Fully fledged Twitter Client:
– Asynchronous.
– Supports	REST	API	(read and	write)
– Supports	Streaming API	(eventsand	tweets).
• Requires developer credentials from	Twitter:
– Trivial	to	get hold	of.
Node.js Twitter	Client	REST	Example
Video	Streaming via	Motion
• Motion:	Software	Motion	Detector.
• Provides streaming video	with possibility to	create
snapshots.
• Good performance on the Raspberry PI.
• Potential side	project:	get Robot	to	follow moving objects?
NodeBot Rover	Component	Overview
Hardware
Raspberry	
PI
Arduberry
(Arduino)
Pi	Cam
Zumo
Chassis
Servos
Software
HTML5	
Speech
Johnny-
Five
Express
MQTT	&	
WebSocket
Twitter &
Motion
So	Did I	Get My	
Coding Mojo
Back?
Controlling	a	Parrot	Drone	with	
Motion	Detectors	and	JavaScript
https://vimeo.com/137264033
“please rate my talk in the offical
IoT Tech Day app”
@markawest

Mais conteúdo relacionado

Semelhante a IoT Tech Day Coding Mojo slides. Utrecht, April 2016

Taking The Cloud Native
Taking The Cloud NativeTaking The Cloud Native
Taking The Cloud Native
Corey Clark, Ph.D.
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for Engineers
Brian LeRoux
 
Presentatoion hwl marvin1
Presentatoion hwl marvin1Presentatoion hwl marvin1
Presentatoion hwl marvin1
Marc Fournier
 

Semelhante a IoT Tech Day Coding Mojo slides. Utrecht, April 2016 (20)

Coding Mojo : Node.js Meetup
Coding Mojo : Node.js MeetupCoding Mojo : Node.js Meetup
Coding Mojo : Node.js Meetup
 
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
JavaOne 2015 : How I Rediscovered My Coding Mojo by Building an IoT/Robotics ...
 
Master-Master Replication and Scaling of an Application Between Each of the I...
Master-Master Replication and Scaling of an Application Between Each of the I...Master-Master Replication and Scaling of an Application Between Each of the I...
Master-Master Replication and Scaling of an Application Between Each of the I...
 
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
Using Java Script and COMPOSE to build cool IoT applications, SenZations 2015
 
Workshop: Arduino for makers - Strumenti SW per la prototipazione elettronica...
Workshop: Arduino for makers - Strumenti SW per la prototipazione elettronica...Workshop: Arduino for makers - Strumenti SW per la prototipazione elettronica...
Workshop: Arduino for makers - Strumenti SW per la prototipazione elettronica...
 
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
Building a Raspberry Pi Robot with Dot NET 7, Blazor and SignalR - TechDays 2023
 
Internet of things (IoT) with Azure
Internet of things (IoT) with AzureInternet of things (IoT) with Azure
Internet of things (IoT) with Azure
 
How To Electrocute Yourself using the Internet
How To Electrocute Yourself using the InternetHow To Electrocute Yourself using the Internet
How To Electrocute Yourself using the Internet
 
Selfie booth ppt
Selfie booth pptSelfie booth ppt
Selfie booth ppt
 
Nodebots
NodebotsNodebots
Nodebots
 
Alex lakatos state of mobile web
Alex lakatos   state of mobile webAlex lakatos   state of mobile web
Alex lakatos state of mobile web
 
Taking The Cloud Native
Taking The Cloud NativeTaking The Cloud Native
Taking The Cloud Native
 
node.js is made for IoT - node.hh 07/16, Hamburg by Michael Kuehne
node.js is made for IoT - node.hh 07/16, Hamburg by Michael Kuehnenode.js is made for IoT - node.hh 07/16, Hamburg by Michael Kuehne
node.js is made for IoT - node.hh 07/16, Hamburg by Michael Kuehne
 
Poster IOTROBOT vatsalnshah_ec_indusuniversity
Poster IOTROBOT vatsalnshah_ec_indusuniversityPoster IOTROBOT vatsalnshah_ec_indusuniversity
Poster IOTROBOT vatsalnshah_ec_indusuniversity
 
Iot meets Serverless
Iot meets ServerlessIot meets Serverless
Iot meets Serverless
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for Engineers
 
Internet of Things Conference - Bogor city
Internet of Things Conference - Bogor cityInternet of Things Conference - Bogor city
Internet of Things Conference - Bogor city
 
Presentatoion hwl marvin1
Presentatoion hwl marvin1Presentatoion hwl marvin1
Presentatoion hwl marvin1
 
Hardware Libre - M.A.R.V.I.N. Robot Project
Hardware Libre - M.A.R.V.I.N. Robot ProjectHardware Libre - M.A.R.V.I.N. Robot Project
Hardware Libre - M.A.R.V.I.N. Robot Project
 
C# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile AppsC# Powered Robots, C# Powered Mobile Apps
C# Powered Robots, C# Powered Mobile Apps
 

Mais de Mark West

Mais de Mark West (16)

A Practical-ish Introduction to Data Science
A Practical-ish Introduction to Data ScienceA Practical-ish Introduction to Data Science
A Practical-ish Introduction to Data Science
 
Explaining the new Java release and licensing models
Explaining the new Java release and licensing modelsExplaining the new Java release and licensing models
Explaining the new Java release and licensing models
 
IoT Meetup Oslo - AI on Edge Devices
IoT Meetup Oslo - AI on Edge DevicesIoT Meetup Oslo - AI on Edge Devices
IoT Meetup Oslo - AI on Edge Devices
 
GeeCon Prague 2018 - A Practical-ish Introduction to Data Science
GeeCon Prague 2018 - A Practical-ish Introduction to Data ScienceGeeCon Prague 2018 - A Practical-ish Introduction to Data Science
GeeCon Prague 2018 - A Practical-ish Introduction to Data Science
 
JavaZone 2018 - A Practical(ish) Introduction to Data Science
JavaZone 2018 - A Practical(ish) Introduction to Data ScienceJavaZone 2018 - A Practical(ish) Introduction to Data Science
JavaZone 2018 - A Practical(ish) Introduction to Data Science
 
NDC Oslo : A Practical Introduction to Data Science
NDC Oslo : A Practical Introduction to Data ScienceNDC Oslo : A Practical Introduction to Data Science
NDC Oslo : A Practical Introduction to Data Science
 
Make Data Smart Again 2018 - Building a Smart Security Camera with Raspberry ...
Make Data Smart Again 2018 - Building a Smart Security Camera with Raspberry ...Make Data Smart Again 2018 - Building a Smart Security Camera with Raspberry ...
Make Data Smart Again 2018 - Building a Smart Security Camera with Raspberry ...
 
DevExperience 2018 : Building a Smart Security Camera with Raspberry Pi Zero,...
DevExperience 2018 : Building a Smart Security Camera with Raspberry Pi Zero,...DevExperience 2018 : Building a Smart Security Camera with Raspberry Pi Zero,...
DevExperience 2018 : Building a Smart Security Camera with Raspberry Pi Zero,...
 
GeeCON Prague : Building a Smart Security Camera with Raspberry Pi Zero, Java...
GeeCON Prague : Building a Smart Security Camera with Raspberry Pi Zero, Java...GeeCON Prague : Building a Smart Security Camera with Raspberry Pi Zero, Java...
GeeCON Prague : Building a Smart Security Camera with Raspberry Pi Zero, Java...
 
JavaZone 2017 : Building a smart security camera with raspberry pi zero, java...
JavaZone 2017 : Building a smart security camera with raspberry pi zero, java...JavaZone 2017 : Building a smart security camera with raspberry pi zero, java...
JavaZone 2017 : Building a smart security camera with raspberry pi zero, java...
 
GeeCon 2017 : Building a Smart Security Camera with Raspberry Pi Zero, Node.j...
GeeCon 2017 : Building a Smart Security Camera with Raspberry Pi Zero, Node.j...GeeCon 2017 : Building a Smart Security Camera with Raspberry Pi Zero, Node.j...
GeeCon 2017 : Building a Smart Security Camera with Raspberry Pi Zero, Node.j...
 
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
Riga Dev Days: Building a Smart Security Camera with Raspberry Pi Zero, Node....
 
IoT Tech Day Smart Camera slides. Utrecht, April 2017.
IoT Tech Day Smart Camera slides.  Utrecht, April 2017.IoT Tech Day Smart Camera slides.  Utrecht, April 2017.
IoT Tech Day Smart Camera slides. Utrecht, April 2017.
 
NTNU Tech Talks : Smartening up a Pi Zero Security Camera with Amazon Web Ser...
NTNU Tech Talks : Smartening up a Pi Zero Security Camera with Amazon Web Ser...NTNU Tech Talks : Smartening up a Pi Zero Security Camera with Amazon Web Ser...
NTNU Tech Talks : Smartening up a Pi Zero Security Camera with Amazon Web Ser...
 
JavaZone 2016 : MQTT and CoAP for the Java Developer
JavaZone 2016 : MQTT and CoAP for the Java DeveloperJavaZone 2016 : MQTT and CoAP for the Java Developer
JavaZone 2016 : MQTT and CoAP for the Java Developer
 
JavaZone 2015 : NodeBots - JavaScript Powered Robots with Johnny-Five
JavaZone 2015 : NodeBots - JavaScript Powered Robots with Johnny-FiveJavaZone 2015 : NodeBots - JavaScript Powered Robots with Johnny-Five
JavaZone 2015 : NodeBots - JavaScript Powered Robots with Johnny-Five
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

IoT Tech Day Coding Mojo slides. Utrecht, April 2016