You are previewing Making Things Talk, 2nd Edition.

Making Things Talk, 2nd Edition

Cover of Making Things Talk, 2nd Edition by Tom Igoe Published by O'Reilly Media, Inc.
  1. Special Upgrade Offer
  2. Preface
    1. Who This Book Is For
    2. What You Need to Know
    3. Contents of This Book
    4. On Buying Parts
    5. Using Code Examples
    6. Using Circuit Examples
    7. Acknowledgments for the First Edition
    8. Note on the Second Edition
      1. Software Reference
      2. Hardware Reference
      3. Acknowledgments for the Second Edition
  3. 1. The Tools
    1. It Starts with the Stuff You Touch
    2. It’s About Pulses
    3. Computers of All Shapes and Sizes
    4. Good Habits
      1. Listen More Than You Speak
      2. Never Assume
      3. Agree on How You Say Things
      4. Ask Politely for Clarification
    5. Tools
      1. Physical Tools
      2. Software Tools
    6. Using the Command Line
      1. Controlling Access to Files
      2. Creating, Viewing, and Deleting Files
      3. Hardware
      4. Connecting Components to the Module
    7. Using an Oscilloscope
    8. It Ends with the Stuff You Touch
  4. 2. The Simplest Network
    1. Supplies for Chapter 2
    2. Layers of Agreement
    3. Making the Connection: The Lower Layers
    4. Saying Something: The Application Layer
      1. Project 1: Type Brighter
      2. The Protocol
    5. Complex Conversations
      1. Project 2: Monski Pong
    6. Flow Control
      1. Project 3: Wireless Monski Pong
    7. Finishing Touches: Tidy It Up, Box It Up
      1. Project 4: Negotiating in Bluetooth
    8. Conclusion
  5. 3. A More Complex Network
    1. Supplies for Chapter 3
    2. Network Maps and Addresses
      1. Network Maps: How Things Are Connected
      2. Hardware Addresses and Network Addresses
      3. Packet Switching: How Messages Travel the Net
      4. Clients, Servers, and Message Protocols
      5. How Web Browsing Works
      6. HTTP GET and POST
      7. How Email Works
      8. Project 5: Networked Cat
      9. Putting Sensors in the Cat Mat
      10. Sending Mail from the Cat
      11. Making a Web Page for the Cat Cam
      12. Uploading Files to a Server Using PHP
      13. Capturing an Image and Uploading It Using Processing
      14. Putting It All Together
      15. One Final Test
    3. Conclusion
  6. 4. Look, Ma, No Computer! Microcontrollers on the Internet
    1. Supplies for Chapter 4
    2. Introducing Network Modules
      1. Project 6: Hello Internet!
    3. An Embedded Network Client Application
      1. Project 7: Networked Air-Quality Meter
    4. The Finished Project
    5. Programming and Troubleshooting Tools for Embedded Modules
      1. The Three Most Common Mistakes
      2. Diagnostic Tools and Methods
    6. Conclusion
  7. 5. Communicating in (Near) Real Time
    1. Supplies for Chapter 5
    2. Interactive Systems and Feedback Loops
    3. Transmission Control Protocol: Sockets & Sessions
      1. Project 8: Networked Pong
      2. A Test Chat Server
    4. The Clients
      1.  
    5. Conclusion
  8. 6. Wireless Communication
    1. Supplies for Chapter 6
    2. Why Isn’t Everything Wireless?
    3. Two Flavors of Wireless: Infrared and Radio
      1. Transmitters, Receivers, and Transceivers
      2. How Infrared Works
      3. Project 9: Infrared Control of a Digital Camera
    4. How Radio Works
      1.  
      2. Project 10: Duplex Radio Transmission
      3. Step 1: Configuring the XBee Modules Serially
      4. Step 2: Programming the Microcontroller to Use the XBee Module
      5. Step 3: Two-Way Wireless Communication Between Microcontrollers
      6. Project 11: Bluetooth Transceivers
      7. Step 1: The Circuits
      8. Step 2: Getting to Know the Commands
      9. Step 3: Connecting Two Bluetooth Radios
      10. Step 4: Connecting Two Microcontrollers via Bluetooth
    5. Buying Radios
    6. What About WiFi?
      1. Project 12: Hello WiFi!
      2. WiFi Diagnostics
    7. Conclusion
  9. 7. Sessionless Networks
    1. Supplies for Chapter 7
    2. Sessions vs. Messages
      1. Sessions Versus Messages
    3. Who’s Out There? Broadcast Messages
      1. Querying for Other Devices Using UDP
      2. Querying for XBee Radios Using 802.15.4 Broadcast Messages
      3. Project 13: Reporting Toxic Chemicals in the Shop
      4. What Happens in the Subnet Stays in the Subnet
    4. Directed Messages
      1. Sending Directed UDP Datagrams
      2. Project 14: Relaying Solar Cell Data Wirelessly
    5. Conclusion
  10. 8. How to Locate (Almost) Anything
    1. Supplies for Chapter 8
    2. Network Location and Physical Location
      1. Step 1: Ask a Person
      2. Step 2: Know the Environment
      3. Step 3: Acquire and Refine
    3. Determining Distance
      1. Passive Distance Ranging
      2. Project 15: Infrared Distance Ranger Example
      3. Project 16: Ultrasonic Distance Ranger Example
      4. Active Distance Ranging
      5. Project 17: Reading Received Signal Strength Using XBee Radios
      6. Project 18: Reading Received Signal Strength Using Bluetooth Radios
      7. The Multipath Effect
    4. Determining Position Through Trilateration
      1. Project 19: Reading the GPS Serial Protocol
    5. Determining Orientation
      1. Project 20: Determining Heading Using a Digital Compass
      2. Project 21: Determining Attitude Using an Accelerometer
      3. Determining Pitch and Roll from an Accelerometer
    6. Conclusion
  11. 9. Identification
    1. Supplies for Chapter 9
    2. Physical Identification
      1. Video Identification
      2. Project 22: Color Recognition Using a Webcam
      3. Project 23: Face Detection Using a Webcam
      4. Project 24: 2D Barcode Recognition Using a Webcam
      5. Radio Frequency Identification (RFID)
      6. Project 25: Reading RFID Tags in Processing
      7. Project 26: RFID Meets Home Automation
      8. The Circuit
      9. Construction
      10. Project 27: Tweets from RFID
      11. The Circuit
      12. SonMicro Communications Protocol
      13. Writing to Mifare Tags
      14. Reading from Mifare Tags
      15. Circuit Additions
      16. Saving Program Memory
      17. Troubleshooting
      18. Construction
    3. Network Identification
      1. HTTP Environment Variables
      2. Project 28: IP Geocoding
      3. Mail Environment Variables
    4. Conclusion
  12. 10. Mobile Phone Networks and the Physical World
    1. Supplies for Chapter 10
    2. One Big Network
      1. A Computer in Your Pocket
      2. Start with What Happens
      3. Project 29: CatCam Redux
      4. The Circuit
      5. The Code
      6. Writing to an SD Card
      7. Good SD Card Practice
      8. Making Your Server Public
      9. Dynamic DNS
      10. Network Cameras
      11. Project 30: Phoning the Thermostat
      12. What’s the Standard?
      13. A Brief Introduction to XML
      14. Getting the Content Length Right
      15. HTML5 and Other Mobile Web Approaches
      16. PhoneGap
    3. Text-Messaging Interfaces
    4. Native Applications for Mobile Phones
      1. Processing for Android
      2. Setting Up Processing for Android
      3. Project 31: Personal Mobile Datalogger
      4. The Circuit
      5. The Construction
      6. What About USB?
    5. Conclusion
  13. 11. Protocols Revisited
    1. Supplies for Chapter 11
    2. Make the Connections
      1. Know Your Options at the Physical Level
      2. Picking a Serial Protocol
      3. Plan the Physical System and Information Flow Early
    3. Text or Binary?
      1. Isn’t All Data Binary?
      2. Interpreting a Binary Protocol
    4. MIDI
      1. Project 32: Fun with MIDI
      2. DMX512
      3. The Structure and Syntax of Text-Based Protocols
      4. Markup vs. Programming Languages
    5. Representational State Transfer
      1. A Traditional Web Service
      2. A Web-Based Device
      3. Project 33: Fun with REST
    6. Conclusion
  14. A. Where to Get Stuff
    1. Supplies
      1.  
    2. Hardware
      1.  
    3. Software
      1.  
  15. Index
  16. About the Author
  17. Special Upgrade Offer
  18. Copyright
O'Reilly logo

Chapter 7. Sessionless Networks

image with no caption

Perform-o-shoes by Andrew Schneider

The shoes exchange messages with a multimedia computer via XBee radio. When you moonwalk in the shoes, your pace and rhythm controls the playback of music from the computer.

So far, the network connections you’ve seen in this book have mostly been dedicated connections between two objects. Serial communications involve the control of a serial port; mail, web, and telnet connections involve a network port. In all these cases, there’s a device that makes the port available (generally a server), and something that requests access to the port (a client). Project 8, Networked Pong, in Chapter 5 was a classic example of this—in that application, the server handled all the communications between the other devices. In this chapter, you’ll learn how to make multiple devices on a network talk to each other directly, or talk to all the other devices at once.

Supplies for Chapter 7

DISTRIBUTOR KEY

BASIC XBEE BREADBOARD CIRCUIT

Several of the projects in this chapter use XBee radios. In each project, ...

The best content for your career. Discover unlimited learning on demand for around $1/day.