You are previewing Node.js for Embedded Systems.
O'Reilly logo
Node.js for Embedded Systems

Book Description

How can we build bridges from the digital world of the Internet to the analog world that surrounds us? By bringing accessibility to embedded components such as sensors and microcontrollers, JavaScript and Node.js might shape the world of physical computing as they did for web browsers. This practical guide shows hardware and software engineers, makers, and web developers how to talk in JavaScript with a variety of hardware platforms. Authors Patrick Mulder and Kelsey Breseman also delve into the basics of microcontrollers, single-board computers, and other hardware components.

Table of Contents

  1. Foreword
  2. Preface
    1. Who This Book Is For
    2. How to Use This Book
    3. Conventions Used in This Book
    4. Using Code Examples
    5. Safari® Books Online
    6. How to Contact Us
    7. Acknowledgments
      1. From Patrick
      2. From Kelsey
  3. 1. Connecting Worlds
    1. Why the Internet of Things?
      1. Embedded Devices
      2. Embedded Internet
      3. Protocols
      4. Examples and Use Cases
    2. JavaScript for Distributed Programming
      1. JavaScript and the IoT
      2. Hello World with JavaScript
    3. JavaScript Runtime Environments
      1. The Browser
      2. The Server
      3. Embedded Devices
    4. The Node.js API
      1. Buffer
      2. Streams
  4. 2. Blink with Arduino
    1. Getting Started with Microcontrollers
    2. Arduino
      1. The Blink Sketch
    3. The Firmata Bridge
      1. Programming an Arduino with JavaScript
    4. Functional Blocks of an MCU
      1. Pins
      2. Microcontroller Versus Microprocessor
      3. Block Diagrams
      4. Analog Inputs
      5. Pulse-Width Modulation
      6. Pinouts
    5. Firmware
  5. 3. Espruino
    1. The Espruino Hardware
    2. Programming Espruino
    3. Variable Blink
    4. Modules
    5. Flashing Espruino Firmware
  6. 4. The Tessel 2
    1. Hardware
    2. Toolchain
      1. Command-Line Interface
    3. Pin Abstractions
      1. Digital Pins
      2. Analog Pins
    4. Embedded Internet with System-on-Chip
  7. 5. Particle Photon
    1. The Particle Photon
    2. Particle Command-Line Interface
    3. OTA Code Deploys
  8. 6. Single-Board Computers
    1. The Raspberry Pi
    2. BeagleBone
    3. The Intel Edison
    4. Boards with 64-Bit Instruction Sets
    5. Using Embedded Linux
      1. Working with SD Cards
      2. Embedded Linux Distributions
      3. OpenWRT
      4. Debian
      5. Yocto
    6. Network Configuration
      1. Debugging Network Settings
    7. Running Node.js
    8. Deploy Projects with Git
  9. 7. Components for Prototyping
    1. Wiring Circuits
      1. Breadboards
      2. Grove Kit
      3. Soldering
      4. Printed Circuit Boards
      5. Tessel Modules
    2. Basic Components
      1. Datasheets
      2. Passive Components
      3. LEDs
    3. Sensors
      1. Temperature
      2. Motion
      3. Ultrasonic Distance
    4. Actuators
      1. Servo Motors
      2. Stepper Motors
      3. DC Motors
    5. Multimedia
    6. Cables
      1. Jumper Wires
      2. USB Cables
      3. FTDI-USB-Cable
      4. Network Cables
  10. 8. Node.js Libraries for Hardware
    1. JavaScript for the Hardware Abstraction Layer
    2. The node-serialport Library
      1. Serial Communication with JavaScript
      2. Scanning for Devices
      3. Receiving Data from Arduino
      4. Sending Data to Arduino
    3. The Johnny-Five Library
      1. An Empty Project
      2. The Board Object
      3. The Johnny-Five REPL
      4. Buttons
      5. Analog Inputs
      6. Proximity
      7. Nodebot
      8. The I2C Library
    4. The LibMRAA Library
      1. MRAA Setup
      2. Outputs
      3. Reading Inputs
      4. Interrupts
      5. Communications
    5. The Cylon.js Library
  11. 9. Exploring Network Protocols
    1. The Hypertext Transfer Protocol
      1. Requesting the Weather
      2. Prepare the HTTP Client
    2. Building a Weather Station
      1. Adding a Database
    3. The Transmission Control Protocol and User Datagram Protocol
    4. The WebSocket Protocol
      1. The ws Module
      2. Remote Procedure Calls over Websockets
  12. 10. Web Frontends for Things
    1. Adding Static Pages
    2. Basic jQuery
      1. Adding the Model-View-Controller
    3. Websockets in a Browser
      1. A Bare Minimum Websocket Connection
    4. The D3.js Library for Plotting Data
    5. P5.js
  13. 11. Entering the Cloud
    1. Publish–Subscribe Pattern
    2. The MQTT Protocol
      1. Connecting to an MQTT Broker
      2. Publish Messages
      3. Subscribe to Updates
      4. MQTT Server with Mosca
    3. Cloud Services
      1. CloudMQTT
      2. HiveMQ
      3. PubNub
      4. Telegram
      5. Temboo
    4. System Design with NodeRED
      1. Install NodeRED
      2. Concepts
  14. 12. Making Robots with Node.js
    1. What Is a Robot?
    2. Why Build Robots in Node.js?
      1. Community
      2. Education
      3. Product Development
    3. The Tessel Project
    4. Robot Kits
      1. Motors and Potentiometers
      2. Sumobot Jr.
      3. Hackarobot
    5. Example Project: The Robot Claw
    6. Example Project: Move a Vehicle
      1. Servo
      2. MD25 Motor Shield
  15. 13. Wireless Data with Bluetooth
    1. The Bluetooth Low Energy Protocol
      1. Communication Modes
      2. Connect with Centrals
      3. Beacons
      4. RedBear Shields and Boards
      5. BlueIOT
    2. Libraries for Bluetooth
      1. Arduino
      2. BLE Scanner and Parser
      3. Noble.js
      4. Bleno.js
    3. Example Project: Proximity Detection
  16. 14. Toward the Physical Internet
    1. What Are Shared Experiences?
      1. Connected Products
      2. Responsive Environments
    2. Impacts of the Physical Internet
  17. 15. From Products to Toolkits
    1. JavaScript as a Toolkit
    2. The Power of Modularity
    3. Modularity in Hardware
    4. Node.js: Driving Innovation in the IoT
    5. Building Good Technology
  18. A. Node.js
    1. Module Basics
      1. The Filesystem Module
    2. The Node Package Manager
      1. Install Modules with npm
      2. Running Scripts with npm
      3. The Stream Module
  19. B. Early Hardware for IoT Systems
    1. Raspberry Pi
    2. BeagleBone
    3. Intel Galileo
  20. Index