Internet of Things with Python

Interact with the world and rapidly prototype IoT applications using Python

Internet of Things with Python

Gastón C. Hillar

2 customer reviews
Interact with the world and rapidly prototype IoT applications using Python
Mapt Subscription
FREE
$29.99/m after trial
eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$28.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785881381
Paperback388 pages

Book Description

Internet of Things (IoT) is revolutionizing the way devices/things interact with each other. And when you have IoT with Python on your side, you'll be able to build interactive objects and design them.

This book lets you stay at the forefront of cutting-edge research on IoT. We'll open up the possibilities using tools that enable you to interact with the world, such as Intel Galileo Gen 2, sensors, and other hardware. You will learn how to read, write, and convert digital values to generate analog output by programming Pulse Width Modulation (PWM) in Python. You will get familiar with the complex communication system included in the board, so you can interact with any shield, actuator, or sensor.

Later on, you will not only see how to work with data received from the sensors, but also perform actions by sending them to a specific shield. You'll be able to connect your IoT device to the entire world, by integrating WiFi, Bluetooth, and Internet settings. With everything ready, you will see how to work in real time on your IoT device using the MQTT protocol in python.

By the end of the book, you will be able to develop IoT prototypes with Python, libraries, and tools.

Table of Contents

Chapter 1: Understanding and Setting up the Base IoT Hardware
Understanding the Intel Galileo Gen 2 board and its components
Recognizing the Input/Output and the Arduino 1.0 pinout
Recognizing additional expansion and connectivity capabilities
Understanding the buttons and the LEDs
Checking and upgrading the board's firmware
Test your knowledge
Summary
Chapter 2: Working with Python on Intel Galileo Gen 2
Setting up the board to work with Python as the programming language
Retrieving the board's assigned IP address
Connecting to the board's operating system
Installing and upgrading the necessary libraries to interact with the board
Installing pip and additional libraries
Invoking the Python interpreter
Test your knowledge
Summary
Chapter 3: Interacting with Digital Outputs with Python
Turning on and off an onboard component
Prototyping with breadboards
Working with schematics to wire digital outputs
Counting from 1 to 9 with LEDs, Python code and the mraa library
Taking advantage of object-oriented code to control digital outputs
Improving our object-oriented code to provide new features
Isolating the pin numbers to improve wirings
Controlling digital outputs with the wiring-x86 library
Test your knowledge
Summary
Chapter 4: Working with a RESTful API and Pulse Width Modulation
Printing numbers in LEDs with a RESTful API
Composing and sending HTTP requests
Wiring pins with PWM capabilities
Using PWM to generate analog values
Generating analog values via HTTP requests
Preparing the RESTful API for Web application requirements
Using PWM plus a RESTful API to set colors for an RGB LED
Controlling PWM with the wiring-x86 library
Test your knowledge
Summary
Chapter 5: Working with Digital Inputs, Polling and Interrupts
Understanding pushbuttons and pullup resistors
Wiring digital input pins with pushbuttons
Reading pushbutton statuses with digital inputs and the mraa library
Reading pushbutton statuses and running a RESTful API
Reading digital inputs with the wiring-x86 library
Using interrupts to detect pressed pushbuttons
Test your knowledge
Summary
Chapter 6: Working with Analog Inputs and Local Storage
Understanding the analog inputs
Wiring an analog input pin with a voltage source
Measuring voltage with analog inputs and the mraa library
Wiring a photoresistor to an analog input pin
Determining the darkness level with analog inputs and the mraa library
Firing actions when the environment light changes
Controlling analog inputs with the wiring-x86 library
Logging to files in the local storage
Working with USB attached storage
Test your knowledge
Summary
Chapter 7: Retrieving Data from the Real World with Sensors
Understanding sensors and their connection types
Working with accelerometers
Wiring an analog accelerometer to the analog input pins
Measuring three axis acceleration with an analog accelerometer
Wiring a digital accelerometer to the IC bus
Measuring three axis acceleration with a digital accelerometer
Using the IC bus to control a digital accelerometer with the mraa library
Wiring an analog temperature sensor
Measuring ambient temperature with an analog sensor
Wiring a digital temperature and humidity sensor to the IC bus
Measuring temperature and humidity with a digital sensor
Test your knowledge
Summary
Chapter 8: Displaying Information and Performing Actions
Understanding LCD displays and their connection types
Wiring an LCD RGB backlight to the IC bus
Displaying text on an LCD display
Wiring an OLED dot matrix to the IC bus
Displaying text on an OLED display
Wiring a servo motor
Positioning a shaft to indicate a value with a servo motor
Test your knowledge
Summary
Chapter 9: Working with the Cloud
Publishing data to the cloud with dweepy
Building a web-based dashboard with Freeboard
Sending and receiving data in real-time through Internet with PubNub
Publishing messages with commands through the PubNub cloud
Working with bi-directional communications
Publishing messages to the cloud with a Python PubNub client
Using MQTT with Mosquitto and Eclipse Paho
Publishing messages to a Mosquitto broker with a Python client
Test your knowledge
Summary
Chapter 10: Analyzing Huge Amounts of Data with Cloud-based IoT Analytics
Understanding the relationship between Internet of Things and Big Data
Understanding the Intel IoT Analytics structure
Setting up devices in Intel IoT Analytics
Setting up components in Intel IoT Analytics
Collecting sensor data with Intel IoT Analytics
Analyzing sensor data with Intel IoT Analytics
Triggering alerts with rules in Intel IoT Analytics
Test your knowledge
Summary

What You Will Learn

  • Prototype and develop IoT solutions from scratch with Python as the programming language
  • Develop IoT projects with Intel Galileo Gen 2 board along with Python
  • Work with the different components included in the boards using Python and the MRAA library
  • Interact with sensors, actuators, and shields
  • Work with UART and local storage
  • Interact with any electronic device that supports the I2C bus
  • Allow mobile devices to interact with the board
  • Work with real-time IoT and cloud services
  • Understand Big Data and IoT analytics

Authors

Table of Contents

Chapter 1: Understanding and Setting up the Base IoT Hardware
Understanding the Intel Galileo Gen 2 board and its components
Recognizing the Input/Output and the Arduino 1.0 pinout
Recognizing additional expansion and connectivity capabilities
Understanding the buttons and the LEDs
Checking and upgrading the board's firmware
Test your knowledge
Summary
Chapter 2: Working with Python on Intel Galileo Gen 2
Setting up the board to work with Python as the programming language
Retrieving the board's assigned IP address
Connecting to the board's operating system
Installing and upgrading the necessary libraries to interact with the board
Installing pip and additional libraries
Invoking the Python interpreter
Test your knowledge
Summary
Chapter 3: Interacting with Digital Outputs with Python
Turning on and off an onboard component
Prototyping with breadboards
Working with schematics to wire digital outputs
Counting from 1 to 9 with LEDs, Python code and the mraa library
Taking advantage of object-oriented code to control digital outputs
Improving our object-oriented code to provide new features
Isolating the pin numbers to improve wirings
Controlling digital outputs with the wiring-x86 library
Test your knowledge
Summary
Chapter 4: Working with a RESTful API and Pulse Width Modulation
Printing numbers in LEDs with a RESTful API
Composing and sending HTTP requests
Wiring pins with PWM capabilities
Using PWM to generate analog values
Generating analog values via HTTP requests
Preparing the RESTful API for Web application requirements
Using PWM plus a RESTful API to set colors for an RGB LED
Controlling PWM with the wiring-x86 library
Test your knowledge
Summary
Chapter 5: Working with Digital Inputs, Polling and Interrupts
Understanding pushbuttons and pullup resistors
Wiring digital input pins with pushbuttons
Reading pushbutton statuses with digital inputs and the mraa library
Reading pushbutton statuses and running a RESTful API
Reading digital inputs with the wiring-x86 library
Using interrupts to detect pressed pushbuttons
Test your knowledge
Summary
Chapter 6: Working with Analog Inputs and Local Storage
Understanding the analog inputs
Wiring an analog input pin with a voltage source
Measuring voltage with analog inputs and the mraa library
Wiring a photoresistor to an analog input pin
Determining the darkness level with analog inputs and the mraa library
Firing actions when the environment light changes
Controlling analog inputs with the wiring-x86 library
Logging to files in the local storage
Working with USB attached storage
Test your knowledge
Summary
Chapter 7: Retrieving Data from the Real World with Sensors
Understanding sensors and their connection types
Working with accelerometers
Wiring an analog accelerometer to the analog input pins
Measuring three axis acceleration with an analog accelerometer
Wiring a digital accelerometer to the IC bus
Measuring three axis acceleration with a digital accelerometer
Using the IC bus to control a digital accelerometer with the mraa library
Wiring an analog temperature sensor
Measuring ambient temperature with an analog sensor
Wiring a digital temperature and humidity sensor to the IC bus
Measuring temperature and humidity with a digital sensor
Test your knowledge
Summary
Chapter 8: Displaying Information and Performing Actions
Understanding LCD displays and their connection types
Wiring an LCD RGB backlight to the IC bus
Displaying text on an LCD display
Wiring an OLED dot matrix to the IC bus
Displaying text on an OLED display
Wiring a servo motor
Positioning a shaft to indicate a value with a servo motor
Test your knowledge
Summary
Chapter 9: Working with the Cloud
Publishing data to the cloud with dweepy
Building a web-based dashboard with Freeboard
Sending and receiving data in real-time through Internet with PubNub
Publishing messages with commands through the PubNub cloud
Working with bi-directional communications
Publishing messages to the cloud with a Python PubNub client
Using MQTT with Mosquitto and Eclipse Paho
Publishing messages to a Mosquitto broker with a Python client
Test your knowledge
Summary
Chapter 10: Analyzing Huge Amounts of Data with Cloud-based IoT Analytics
Understanding the relationship between Internet of Things and Big Data
Understanding the Intel IoT Analytics structure
Setting up devices in Intel IoT Analytics
Setting up components in Intel IoT Analytics
Collecting sensor data with Intel IoT Analytics
Analyzing sensor data with Intel IoT Analytics
Triggering alerts with rules in Intel IoT Analytics
Test your knowledge
Summary

Book Details

ISBN 139781785881381
Paperback388 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

Smarter Decisions – The Intersection of Internet of Things and Decision Science Book Cover
Smarter Decisions – The Intersection of Internet of Things and Decision Science
$ 35.99
$ 25.20
Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Practical Machine Learning Book Cover
Practical Machine Learning
$ 37.99
$ 26.60
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90
Python Programming Blueprints Book Cover
Python Programming Blueprints
$ 39.99
$ 28.00
Python GUI Programming Cookbook Book Cover
Python GUI Programming Cookbook
$ 35.99
$ 25.20