Dkords html5devconf2012-nodejsf-for-embedded

1,635 views

Published on

Node.js for Embedded Systems

http://www.html5devconf.com/sessions.html#d_kordsmeier

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
1,635
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
15
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Dkords html5devconf2012-nodejsf-for-embedded

  1. 1. Node.js for Embedded Systems“Preparing for the (HTML5) robot ARMy” David J. Kordsmeier @dkords
  2. 2. Node.js? HTML5? Robot ARMy?● Node runs just about everywhere (dependency set is small … you just have to port it), the runtime is small (< 8MB)● HTML5 is why we are here (and why I believe this is the platform of tomorrow)● Robot ARMy – Who else would take over the world? It will be our iPhones and Android devices● Best of all, you all know JS
  3. 3. Who Am I?● David J. Kordsmeier● Organizer of Node.js ++ SSJS Club SF Meetup (Est. November 2010)● Boutique Agency – Razortooth Communications, LLC● Board Member, SMILE Consortium (a 501c3 Nonprofit)● @dkords
  4. 4. Remember the Sun JAVA = Everywhere Campaign?● This campaign ran back early 2000s on CNN/CNBC● ... probably not, here is a refresher: http://www.youtube.com/watch?v=VBp347dE0qw● WebTone (http://bit.ly/OvOyJ1) has been restored● HTML5 Everywhere (is my new campaign)● And this campaign is working now finally;p
  5. 5. Enter the Robot ARMy● Devices are everywhere● You have one in your pocket/hand/ear/lap● They are semi-autonomous agents, and network aware● And they run apps, services, they feed us information, and one day they will rule the planet (pause, looks down)
  6. 6. What is ARM?● 32-bit processor, RISC instruction set● Dates back to 1981 (Acorn Computer)● Divided into Architecture families● Today we typically see: ARMv5, ARMv6, ARMv7● Price, Size, Power Consumption, Ecosystem● Read more on the Encyclopedia: http://en.wikipedia.org/wiki/ARM_architecture
  7. 7. ARM family● Low End – Rasberry Pi $35 (+ cost of accessories & S/H =~ $50) – ARMv6, 256MB RAM, no NAND● Mid End ● Marvell SMILE Plug – ARMv7, 1GB NAND, MicroSD slot, dual GIG-E, Wifi A/B/G, 1 GB RAM (ships with Node.js), battery powered ● Beagleboard - $149 for an ARM Cortex A8 with a huge developer community, be prepared to buy all the accessories you need, has DSP● High End ● Nvidia Tegra 3 – Will likely be in your next non-Apple tablet (4 cores + 1 & GPU) ● Iphone5 (dual core core) ● ARMv8 Servers - 64bit, rare, exotic, expensive
  8. 8. Ive been building WebServices on ARM devices● I tried to put PHP + Lighttpd and some JS onto a Mobile Phone as a prototype for a Web-based GUI front end (2007, before WebOS). Also tried Java.● The LAMP stack is big, in the context of a little box. Java is sort of huge too.● Any device is capable of serving content, publishing locally, running micro-clouds● PALM figured this out (but no one else figured out why that was cool)● Traditional Embedded Toolchains are a not fun (and not cheap either)● The Web Runtime (of Web Standards origins) enables anyone to develop on embedded platforms
  9. 9. Jaded SF Hipster Says >● “I dont need web services on my device”● “I have an iPhone 5”● “I hack on my arduino when Im not busy with my startup”● “I write iPhone apps with Ruby”● “Native apps are the only way to go for user experience”● “Ive got 4G LTE … G”● “This place is dead anyway”
  10. 10. Why Bother?● SF Hipster is right … data is everywhere, Native apps rule, and this place is dead● NEWS Flash: 80% of the world is not yet on the Internet● Good NEWS: Global Mobile use is growing like nothing weve ever seen (but … theres like an 85% base that still doesnt use DATA other than SMS)● Bringing information and education to people via Mobile will transform education
  11. 11. SMILE Consortium (a 501c3 Nonprofit) The mission of the SMILE Consortium is to cause a paradigm shift within education by enabling students to be active agents in their learning through an inquiry-based learning model. By utilizing both mobile and cloud- based technology, SMILE Consortium provides an open platform for this inquiry- based learning environment with limitless academic potential.
  12. 12. Deployment Styles – Node.js ARM(ed forces)● As a scripting layer on any device● As a web server of static or dynamic content● As a web service/API endpoint● As a JS wrapper around native code (in Node via V8 extensions, or as in the style of PhoneGaps native bindings)
  13. 13. Join The Cause● You need a toolchain● You need a board (or box, or plug, or phone)● Your best options: ● Android – check out anode (on Github) ● Rasberry Pi – (use Arch Linux ARM, pacman -S nodejs) ● Beagleboard – (use Open Embedded and cross compile for ARMv7 target) ● SMILE Plug – (Its preloaded with Node.js 0.8.x and Arch Linux ARM … start developing in 5 minutes)● A nice multicore Intel-based host build system helps● Be prepared to spend a lot of time on your new hobby
  14. 14. Thanks for ListeningFor Questions, Comments, Ideas, Contact: David J. Kordsmeier @dkords http://www.linkedin.com/in/dkords Tweet about your work: #nodejsARMy
  15. 15. Some Benchmarks on SMILE Plug● Scale up to 288.32 requests / per second● https://gist.github.com/3883652● OpenSSL - http://pastie.org/4900410● Wifi Performance: 0.0-10.1 sec 78.0 MBytes 65.1 Mbits/sec● Benchmark.js - node benchmark.js : RegExp#test x 956,776 ops/sec ±0.71% (94 runs sampled), String#indexOf x 1,769,536 ops/sec ±0.69% (99 runs sampled), String#match x 543,285 ops/sec ±2.15% (87 runs sampled), Fastest is String#indexOf
  16. 16. Node.js ARMy References● Open Source project for Education – SMILE Consortium – http://smileconsortium.org and on github: http://github.com/SmileConsortium● For information about global education projects using mobility and technology – http://seeds ofempowerment.org● For ARM CPUs: Marvell Semiconductor – http://marvell.com or TI: http://ti.com● The lightest, simplest Linux Distro for ARM – http://archlinuxarm.org● SMILE Plug (I demoed this), featured on Engadget: http://engt.co/PPKWkK● A good starting point for Android: https://github.com/paddybyers/anode● When it is time to roll your own Linux and toolchains: http://openembedded.org and http://yoctoproject.org (to save yourself pain)● A good starting point for iOS: http://n8.io/nodejs-on-ios/ (I only recommend this if you are comfortable with embedded development, Jailbreaking can be hazardous to your iPhone)● If you need people to work on Node.js + ARM - http://razortooth.biz (we only take on specialized projects, but I can refer you to general Node.js resources, contact us)● Node.js ++ SSJS Club SF - http://www.meetup.com/Node-js-Serverside-Javascripters-Club-SF/ (We have a meeting coming up 10/25)
  17. 17. Seeds of Empowerment:SMILE around the world● Using a variety of hardware, BYOD: Netbooks, OLPC, Android handsets, Android Tablets, Plug Computers● Projects ranged from 1 Day workshops to permanent long term installations● Methodology involves training teachers, technology is provided through partnerships of public and private sector● Past focus has been on Android devices● New focus through SMILE Consortium OSS projects will be on HTML5 centric model● References for deployments around the globe: https://www.box.com/shared/static/gpmdlg75tljymh9oy2ki.docx

×