coding mojo : node.js meetup
TRANSCRIPT
“AnyapplicationthatcanbewritteninJavaScript,willeventuallybewrittenin
JavaScript”
JamesAtwood(founder, stackoverflow.com)
TheArduino Ecosystem• MicroController platform.
• ManydifferentArduinomodels.
• OpenSourcedesign.
• Extensiblevia“Shields”.
Actuators
Sensors
Nervous System
RaspberryPI2RaspberryPICam
ArduberryMicrocontroller Arduino Chassis Servo
Servo
Brain
NodeBot RoverHardware
Actuators
Sensors
Nervous System
RaspberryPI2RaspberryPICam
ArduberryMicrocontroller Arduino Chassis Servo
Servo
Brain
NodeBot RoverHardware
RaspberryPI2
Arduberry
Servo
SoftwareCommunicationacrossHardwareLayers
Servo
Raspberry PI Chassis
JavaScriptPI Binary (Compiled C/C++)
1. Maturity2. Community3. DSL4. Portability5. OpenSource6. Node.js ecosystem7. REPL
BenefitsofusingJohnny-Five
ImportsJ5Dependancy
Adds LEDinstance toREPL
Declares LEDasconnected toUNOPin13
BlinksLEDevery 500milliseconds
Codeblock triggered byUNO”Ready”Event
Initialises UNO
Johnny-FiveCodeExamplevar 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
});});
Arduberry
Servo
BridgingthegapwithFirmata
Servo
Raspberry PI Chassis
Johnny-Five(Firmata Client)
Std.Firmata(Firmata Server)
JavaScriptPI Binary (Compiled C/C++)
GettingStartedwithJohnny-Five1. BuyanArduino ExperimentersKit.
2. Followthetutorialsathttp://node-ardx.org.
3. Visithttp://johnny-five.io formoreinformationandinspiration.
Johnny-FiveProcess
ExpressProcess
Raspberry PI2
WE
Browser
HTTPS
NodeBotRover
Hardware
Firmata
MQTTMessageBroker
MQTT
MQTToverWebSockets
Commands
Acknowledgements
MQTT.jsClient
MQTT.jsClient
MQTT– MQTelemetry Transport• Internet of Thingsconnectivityprotocol.
• Designed tobelightweightwith asmall footprint andlittleoverhead.
• Requires aMessageBroker(publish /subscribe).
• UsedbyFacebook forpushing updates tomobileclients.
Adding MQTTtothe NodeBot RoverBroker
• PublicMQTTBroker
– ManyPublicBrokersexist.– Onelessprocess torunon
Raspberry PI.
Client
• MQTT.js
– Provides anMQTTclientlibrary forNode.js.
– Extremely simpletouse.– Integrates seamlesslywith
Johnny-Five.
MQTTOverWebSockets with MQTT.js• MQTT.js isaNode.js package andis
meant foruse on the ServerSide.
• Toallow MQTT.js torunfromtheBrowser,we firstneeded to”Browserify”the MQTTlibrary.
• We could then access the”Browserified”MQTTclient libraryfromthe Browser.
• Thissolution requires that your MQTTBrokerhasaWebSocket endpoint.
MoreaboutHTML5SpeechRecognition
https://utbrudd.bouvet.no/2014/11/11/getting-started-with-html5-speech-recognition-on-
google-chrome