Getting Started with the Internet of Things

Book description

The Internet of Things is the new generation of devices that serve as the Internet's interface to the physical world. Today's tiny microcontrollers, sensors, and actuators are powerful, inexpensive, and simple enough to code that anyone with basic programming skills can create a variety of fun, useful, and even profitable systems -- such as devices that detect and extinguish fires or automatically water plants when the soil becomes too dry. This hands-on introductory guide will quickly show you how it's done.

You'll learn how to program embedded devices using the .NET Micro Framework and the Netduino Plus board, and then connect these devices to the Internet using Pachube, a cloud platform for sharing real-time sensor data. Getting Started with the Internet of Things briefly introduces the tools and then walks you though several techniques for using them, using a series of C# examples:

  • Develop programs that demonstrate the use of simple outputs (actuators) and inputs (sensors)

  • Build client programs that show how measurements can be pushed to an existing Web service

  • Create server programs that provide Web services to clients on the Web

  • Develop a program that is both client and server and runs in the cloud

  • Get .NET classes and methods needed to implement all of the book's examples

This book is still in progress, but you can get going on this amazing microcontroller technology through our Rough Cuts edition, which lets you read the manuscript as it's being written, either online or via PDF. Available at Safari Books Online.

Table of contents

  1. A Note Regarding Supplemental Files
  2. Preface
    1. The Platforms
    2. How This Book Is Organized
    3. Who This Book Is For
    4. What You Need to Get Started
    5. Conventions Used in This Book
    6. Using Code Examples
    7. How to Contact Us
    8. Safari® Books Online
    9. Acknowledgments
  3. I. Introduction
    1. 1. Hello World
      1. Setting Up the Development Environment
      2. HelloWorld
      3. Building the Program in Visual Studio
      4. Deploying to the Device
    2. 2. Writing to Actuators
      1. BlinkingLed
        1. C# Namespaces
        2. Running the Program
        3. Digital Outputs
    3. 3. Reading from Sensors
      1. LightSwitch
        1. Digital Inputs
      2. VoltageReader
        1. Analog Inputs
  4. II. Device as HTTP Client
    1. 4. The Internet of Things
      1. HTTP
      2. Push Versus Pull
    2. 5. Pachube
    3. 6. Hello Pachube
      1. Setting Up the Network Configuration
        1. Internet Addresses
        2. The MFDeploy Tool
      2. HelloPachube
        1. Viewing the Results
        2. How It Works
        3. The WaitUntilNextPeriod Method
      3. What Netduino Said to Pachube
      4. What Pachube Said to Netduino
    4. 7. Sending HTTP Requests—The Simple Way
      1. SimplePutRequest
      2. Making Web Requests
        1. The HttpWebRequest Class
        2. The HttpWebResponse Class
    5. 8. Sending HTTP Requests—The Efficient Way
      1. EfficientPutRequest
        1. The Connect Method
        2. The SendRequest Method
        3. How Can I Get the Response from Pachube?
    6. 9. Hello Pachube (Sockets Version)
      1. PachubeClient
        1. Viewing the Results
        2. How It Works
  5. III. Device as HTTP Server
    1. 10. Hello Web
      1. Relaying Messages to and from the Netduino
        1. Yaler
      2. HelloWeb
        1. Viewing the Results
        2. Using C# Initializers to Create the HttpServer
        3. C#’s Lambda Expression Shorthand
      3. Request Handlers
      4. HelloWebHtml
      5. What You Should Know About Ports
        1. Port Forwarding
    2. 11. Handling Sensor Requests
      1. From Sensor Readings to HTTP Resources
      2. URIs of Measured Variables
      3. VoltageMonitor
        1. Treating Variables Like Methods with C# Delegates
        2. Inside Gsiot.Server’s AnalogSensor Class
        3. Inside Gsiot.Server’s MeasuredVariable Class
      4. What You Should Know About HTTP GET
    3. 12. Handling Actuator Requests
      1. From HTTP Resources to Controlling Things
      2. URIs of Manipulated Variables
      3. LedController
        1. Inside Gsiot.Server’s DigitalActuator Class
        2. C#: Protecting You from Dangerous Conversions
        3. Inside Gsiot.Server’s ManipulatedVariable Class
      4. Test Client in C#
      5. Embed a JavaScript Test Client on the Netduino
      6. What You Should Know About HTTP PUT
    4. 13. Going Parallel
      1. Multithreading
        1. Beware of Scylla: Race Conditions
        2. Beware of Charybdis: Deadlocks
        3. Stay in Calmer Waters: Actors
      2. ParallelBlinker
      3. What You Should Know About Multithreading
    5. 14. Where Can I Go from Here?
      1. Recipes for Modifying a Server
        1. Changing the Pin Assignment of a Sensor
        2. Changing the URI of a Measured Variable
        3. Adding a New Measured Variable
        4. Adding a New Type of Sensor
        5. Adding a New Kind of Resource
        6. Supporting a New Representation for a Measured Variable
        7. Replacing the Server Implementation
      2. Server Versus Client? When to Push, When to Pull?
      3. Taking a REST
      4. Communities
      5. Other Hardware
        1. Sensors, Actuators, and Other Hardware Extensions
        2. Different Processor Boards
        3. Porting the .NET Micro Framework
      6. The Sky Is the Limit
  6. A. Test Server
  7. B. .NET Classes Used in the Examples
  8. C. Gsiot.Server Library
    1. HTTP Server
      1. Class HttpServer
      2. Class RequestRouting
      3. Delegate RequestHandler
      4. Class RequestHandlerContext
    2. Resources
      1. Delegate GetHandler
      2. Delegate PutHandler
      3. Class MeasuredVariable
      4. Class ManipulatedVariable
    3. Representations
      1. Delegate Serializer
      2. Delegate Deserializer
      3. Class CSharpRepresentation
    4. Drivers for Sensors and Actuators
      1. Class DigitalSensor
      2. Class DigitalActuator
      3. Class AnalogSensor
    5. Multithreading
      1. Buffer
  9. D. About the Author
  10. Index
  11. About the Author
  12. Colophon
  13. Copyright

Product information

  • Title: Getting Started with the Internet of Things
  • Author(s): Cuno Pfister
  • Release date: May 2011
  • Publisher(s): Make: Community
  • ISBN: 9781449393571