Tải bản đầy đủ (.pdf) (400 trang)

Python programming for arduino (2015)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (12.4 MB, 400 trang )


Python Programming
for Arduino

Develop practical Internet of Things prototypes
and applications with Arduino and Python

Pratik Desai

BIRMINGHAM - MUMBAI


Python Programming for Arduino
Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: February 2015

Production reference: 1230215



Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-593-8
www.packtpub.com


Credits
Author
Pratik Desai
Reviewers

Project Coordinator
Milton Dsouza
Proofreaders

Juan Ramón González

Safis Editing

Marco Schwartz

Maria Gould

Josh VanderLinden

Ameesha Green
Paul Hindle


Commissioning Editor
Saleem Ahmed

Indexer
Mariammal Chettiyar

Acquisition Editor
James Jones

Graphics
Abhinash Sahu

Content Development Editor
Priyanka Shah

Production Coordinator
Manu Joseph

Technical Editor
Ankita Thakur

Cover Work
Manu Joseph

Copy Editors
Jasmine Nadar
Vikrant Phadke



About the Author
Pratik Desai, PhD, is the Principal Scientist and cofounder of a connected devices

start-up, Imbue Labs, where he develops scalable and interoperable architecture for
wearable devices and Internet of Things (IoT) platforms during the day. At night, he
leads the development of an open source IoT initiative, the Semantic Repository of
Things. Pratik has 8 years of research and design experience in various layers of the
IoT and its predecessor technologies such as wireless sensor networks, RFID, and
machine-to-machine (M2M) communication. His domains of expertise are the IoT,
Semantic Web, machine learning, robotics, and artificial intelligence.
Pratik completed his MS and PhD from Wright State University, Ohio, and
collaborated with the Ohio Center of Excellence in Knowledge-enabled Computing
(Kno.e.sis) during his doctoral research. His doctoral research was focused on
developing situation awareness frameworks for IoT devices, enabling semantic
web-based reasoning and handling the uncertainty associated with sensor data.
In his personal life, Pratik is an avid DIY junkie and likes to get hands-on experience
on upcoming technologies. He extensively expresses his views on technology and
shares interesting developments on Twitter (@chheplo).
I would like to dedicate the book to my parents, who were responsible
for building the foundation of what I am today. The book would not
have been possible without the patience, support, and encouragement
from my beloved wife, Sachi. I would also like to thank her for landing
her photography skills that were used in development of some of the
important images used in the book. I would also like to extend my
sincere gratitude to the editors for their valuable feedbacks.


About the Reviewers
Juan Ramón González is a technical engineer of computer systems and lives
in Seville (Andalusia, Spain). For the past 9 years, he has been working on free

software-based projects for the regional Ministry of Education by using Python,
C++, and JavaScript, among other programming languages.

He is one of the main members of the CGA project in Andalusia (Centro de Gestión
Avanzado or Advanced Management Center), which manages a network with more
than 4,000 servers with Debian and 500,000 client computers that run Guadalinex,
a customized Ubuntu-based operating system for Andalusian schools.
As a software developer who has a passion for electronics and astronomy, he started
one of the first projects to control a telescope with the Arduino microcontroller by
using a computer with the Stellarium software and a driver developed with Python
to communicate with the telescope. This project's sources are published on the
collaborative platform GitHub. You can see the whole code and the prototype at
/>

Marco Schwartz is an electrical engineer, entrepreneur, and blogger. He has
a master's degree in electrical engineering and computer science from Supélec,
France, and a master's degree in micro engineering from EPFL, Switzerland.
Marco has more than 5 years of experience working in the domain of electrical
engineering. His interests gravitate around electronics, home automation, the
Arduino and the Raspberry Pi platforms, open source hardware projects, and
3D printing.
He runs several websites around Arduino, including the Open Home Automation
website that is dedicated to building home automation systems using open
source hardware.
Marco has written a book on home automation and Arduino called Arduino Home
Automation Projects, Packt Publishing. He has also written a book on how to build
Internet of Things projects with Arduino called Internet of Things with the Arduino
Yun, Packt Publishing.

Josh VanderLinden is a lifelong technology enthusiast who has been programming


since the age of 10. He enjoys learning and becoming proficient with new technologies.
He has designed and built software, ranging from simple shell scripts to scalable
backend server software to interactive web and desktop user interfaces. Josh has been
writing software professionally using Python since 2007, and he has been building
personal Arduino-based projects since 2010.


www.PacktPub.com
Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get in
touch with us at for more details.
At www.PacktPub.com, you can also read a collection of free technical articles,
sign up for a range of free newsletters and receive exclusive discounts and offers
on Packt books and eBooks.
TM

/>
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser


Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.



Table of Contents
Preface1
Chapter 1: Getting Started with Python and Arduino
7
Introduction to Python
7
Why we use Python
8
When do we use other languages
9
Installing Python and Setuptools
10
Installing Python
10
Linux10

Ubuntu11
Fedora and Red Hat
11

Windows11

Mac OS X
14
Installing Setuptools
14

Linux15
Windows15
Mac OS X
16

Installing pip
16
Installing Python packages
17
The fundamentals of Python programming
18
Python operators and built-in types
19
Operators20
Built-in types
20

Data structures
22
Lists22
Tuples24
Sets25
Dictionaries25

Controlling the flow of your program

The if statement
The for statement
The while statement

25

26
26
26


Table of Contents

Built-in functions

27

Conversions27

Introduction to Arduino
29
History29
Why Arduino?
29
Arduino variants
30
The Arduino Uno board
31
Installing the Arduino IDE
32


Linux33
Mac OS X
33
Windows33

Getting started with the Arduino IDE
34
What is an Arduino sketch?
34
Working with libraries
36
Using Arduino examples
37
Compiling and uploading sketches
38
Using the Serial Monitor window
40
Introduction to Arduino programming
41
Comments41
Variables41
Constants42
Data types
42
Conversions44
Functions and statements
44

The setup() function

45
The loop() function
45
The pinMode() function
45
Working with pins
46
Statements46

Summary47

Chapter 2: Working with the Firmata Protocol and
the pySerial Library

49

Connecting the Arduino board
50
Linux50
Mac OS X
51
Windows52
Troubleshooting52
Introducing the Firmata protocol
53
What is Firmata?
54
Uploading a Firmata sketch to the Arduino board
54
Testing the Firmata protocol

57
[ ii ]


Table of Contents

Getting started with pySerial
62
Installing pySerial
62
Playing with a pySerial example
63
Bridging pySerial and Firmata
65
Summary66

Chapter 3: The First Project – Motion-triggered LEDs
Motion-triggered LEDs – the project description
The project goal
The list of components
The software flow design
The hardware system design
Introducing Fritzing – a hardware prototyping software
Working with the breadboard
Designing the hardware prototype

Testing hardware connections
Method 1 – using a standalone Arduino sketch
The project setup
The Arduino sketch

The setup() function
The loop() function

67
68
68
69
70
71

72
73
74

77
78
78
78

80
80

Working with custom Arduino functions
80
Testing81
Troubleshooting82
Method 2 – using Python and Firmata
82
The project setup
82

Working with Python executable files
83
The Python code
84
Working with pyFirmata methods
85
Working with Python functions
86
Testing87
Troubleshooting87
Summary88

Chapter 4: Diving into Python-Arduino Prototyping

89

Prototyping90
Working with pyFirmata methods
91
Setting up the Arduino board
91
Configuring Arduino pins
93
The direct method
Assigning pin modes

94
95

Working with pins


96

Reporting data
Manual operations

96
97

[ iii ]


Table of Contents

Additional functions
Upcoming functions
Prototyping templates using Firmata
Potentiometer – continuous observation from an analog input

98
99
99
99

Connections100
The Python code
100

Buzzer – generating sound alarm pattern


102

DC motor – controlling motor speed using PWM

105

LED – controlling LED brightness using PWM

107

Servomotor – moving the motor to a certain angle

109

Connections102
The Python code
103
Connections105
The Python code
106
Connections107
The Python code
108
Connections110
The Python code
110

Prototyping with the I2C protocol
Arduino examples for I2C interfacing


Arduino coding for the TMP102 temperature sensor
Arduino coding for the BH1750 light sensor

112
114

114
117

PyMata for quick I2C prototyping

119

Useful pySerial commands

122

Interfacing TMP102 using PyMata
Interfacing BH1750 using PyMata

120
121

Connecting with the serial port
Reading a line from the port
Flushing the port to avoid buffer overflow
Closing the port

122
123

123
123

Summary123

Chapter 5: Working with the Python GUI

Learning Tkinter for GUI design
Your first Python GUI program
The root widget Tk() and the top-level methods
The Label() widget
The Pack geometry manager
The Button() widget – interfacing GUI with Arduino and LEDs
The Entry() widget – providing manual user inputs
The Scale() widget – adjusting the brightness of an LED
The Grid geometry manager
The Checkbutton() widget – selecting LEDs
The Label() widget – monitoring I/O pins
[ iv ]

125

126
127
128
129
129
130
133
135

137
139
141


Table of Contents

Remaking your first Python-Arduino project with a GUI
144
Summary146

Chapter 6: Storing and Plotting Arduino Data
Working with files in Python
The open() method
The write() method
The close() method
The read() method
The with statement – Python context manager
Using CSV files to store data
Storing Arduino data in a CSV file
Getting started with matplotlib
Configuring matplotlib on Windows
Configuring matplotlib on Mac OS X
Upgrading matplotlib
Troubleshooting installation errors

147

148
148

149
149
149
150
151
152
155
156
156

157
157

Setting up matplotlib on Ubuntu
158
Plotting random numbers using matplotlib
158
Plotting data from a CSV file
160
Plotting real-time Arduino data
163
Integrating plots in the Tkinter window
166
Summary168

Chapter 7: The Midterm Project – a Portable DIY Thermostat
Thermostat – the project description
Project background
Project goals and stages
The list of required components

Hardware design
Software flow for user experience design
Stage 1 – prototyping the thermostat
The Arduino sketch for the thermostat
Interfacing the temperature sensor
Interfacing the humidity sensor
Interfacing the light sensor
Using Arduino interrupts

Designing the GUI and plot in Python

Using pySerial to stream sensor data in your Python program
Designing the GUI using Tkinter
Plotting percentage humidity using matplotlib
Using button interrupts to control the parameters

169

169
170
170
171
174
176
178
178

179
179
180

180

181

181
182
184
185

Troubleshooting186
[v]


Table of Contents

Stage 2 – using a Raspberry Pi for the deployable thermostat
What is a Raspberry Pi?
Installing the operating system and configuring the Raspberry Pi
What do you need to begin using the Raspberry Pi?
Preparing an SD card
The Raspberry Pi setup process

Using a portable TFT LCD display with the Raspberry Pi
Connecting the TFT LCD using GPIO
Configuring the TFT LCD with the Raspberry Pi OS

187
188
189


189
190
192

194

195
196

Optimizing the GUI for the TFT LCD screen
197
Troubleshooting199
Summary200

Chapter 8: Introduction to Arduino Networking
Arduino and the computer networking
Networking fundamentals
Obtaining the IP address of your computer

201

202
202
203

Windows204
Mac OS X
205
Linux206


Networking extensions for Arduino

208

Arduino Ethernet library

210

Arduino Ethernet Shield
Arduino WiFi Shield
Arduino Yún

208
209
210

The Ethernet class
The IPAddress class
The Server class
The Client class

Exercise 1 – a web server, your first Arduino network program
Developing web applications using Python
Python web framework – web.py
Installing web.py
Your first Python web application

Essential web.py concepts for developing complex web applications

211

212
212
212

213
219
219

219
220

221

Handling URLs222
The GET and POST methods
222
Templates223
Forms224

Exercise 2 – playing with web.py concepts using the Arduino
serial interface
RESTful web applications with Arduino and Python
Designing REST-based Arduino applications
Working with the GET request from Arduino
The Arduino code to generate the GET request
[ vi ]

225
230
230

231

231


Table of Contents
The HTTP server using web.py to handle the GET request

233

Working with the POST request from Arduino

234

Exercise 3 – a RESTful Arduino web application

236

The Arduino code to generate the POST request
The HTTP server using web.py to handle the POST request
The Arduino sketch for the exercise
The web.py application to support REST requests

Why do we need a resource-constrained messaging protocol?
MQTT – A lightweight messaging protocol
Introduction to MQTT
Mosquitto – an open source MQTT broker
Setting up Mosquitto
Getting familiar with Mosquitto
Getting started with MQTT on Arduino and Python

MQTT on Arduino using the PubSubClient library
Installing the PubSubClient library
Developing the Arduino MQTT client

234
235
237
238

239
240
241
242
242
243
244
244

245
245

MQTT on Python using paho-mqtt

247

Exercise 4 – MQTT Gateway for Arduino

251

Installing paho-mqtt

Using the paho-mqtt Python library

Developing Arduino as the MQTT client
Developing the MQTT Gateway using Mosquitto
Extending the MQTT Gateway using web.py
Testing your Mosquitto Gateway

248
248
252
254
255
256

Summary258

Chapter 9: Arduino and the Internet of Things
Getting started with the IoT
Architecture of IoT web applications
Hardware design
The IoT cloud platforms
Xively – a cloud platform for the IoT
Setting up an account on Xively
Working with Xively

Alternative IoT platforms

261
262
263

266
267
268

268
270

273

ThingSpeak273
Carriots274

Developing cloud applications using Python and Xively
Interfacing Arduino with Xively
Uploading Arduino data to Xively
Downloading data to Arduino from Xively
Advanced code to upload and download data using Arduino

Python – uploading data to Xively
The basic method for sending data

274
275

275
277
280

281


282

[ vii ]


Table of Contents
Uploading data using a web interface based on web.py

Python – downloading data from Xively

The basic method for retrieving data from Xively
Retrieving data from the web.py web interface
Triggers – custom notifications from Xively

283

284

284
285
287

Your own cloud platform for the IoT
Getting familiar with the Amazon AWS platform

288
289

Creating an IoT platform on the EC2 instance


295

Setting up an account on AWS
Creating a virtual instance on the AWS EC2 service
Logging into your virtual instance
Installing the necessary packages on AWS
Configuring the security of the virtual instance
Testing your cloud platform

290
292
294
296
297
299

Summary303

Chapter 10: The Final Project – a Remote Home
Monitoring System
The design methodology for IoT projects
Project overview
The project goals
The project requirements
Designing system architecture
The monitoring station
The control center
The cloud services

Defining UX flow

The list of required components
Defining the project development stages
Stage 1 – a monitoring station using Arduino
Designing the monitoring station
The Arduino sketch for the monitoring station

Publishing sensor information
Subscribing to actuator actions
Programming an interrupt to handle the press of a button

305
306
307
307
308
309

311
311
311

311
313
315
315
316
319

319
320

321

Testing321
Stage 2 – a control center using Python and the Raspberry Pi
322
The control center architecture
322
The Python code for the control center
323
Creating the GUI using Tkinter
Communicating with the Mosquitto broker
Calculating the system's status and situation awareness
Communicating with Xively
Checking and updating the buzzer's status

[ viii ]

324
325
326
327
328


Table of Contents

Testing the control center with the monitoring station
329
Setting up the control center on the Raspberry Pi
330

Stage 3 – a web application using Xively, Python, and
Amazon cloud service
332
Architecture of the cloud services
332
Python web application hosted on Amazon AWS
333
Testing the web application
335
Testing and troubleshooting
336
Extending your remote home monitoring system
338
Utilizing multiple monitoring stations
339
Extending sensory capabilities
339
Improving UX
341
Expanding cloud-based features
341
Improving intelligence for situation awareness
342
Creating an enclosure for hardware components
342
Summary343

Chapter 11: Tweet-a-PowerStrip345
Project overview
Project requirements

System architecture
Required hardware components

345
346
346
347

Relays348
PowerSwitch Tail
349

User experience flow
350
Development and deployment stages
352
Stage 1 – a smart power strip with Arduino and relays
353
Hardware design
353
The Arduino code
354
Stage 2 – the Python code to process tweets
357
Python software flow
357
Setting up the Twitter application
359
The Python code
361

Testing and troubleshooting
363
Extending the project with additional features
364
Summary365

Index367

[ ix ]



Preface
In the era of the Internet of Things (IoT), it has become very important to rapidly
develop and test prototypes of your hardware products while also augmenting them
using software features. The Arduino movement has been the front-runner in this
hardware revolution, and through its simple board designs it has made it convenient
for anyone to develop DIY hardware projects. The great amount of support that
is available through the open source community has made the difficulties that are
associated with the development of a hardware prototype a thing of the past. On
the software front, Python has been the crown jewel of the open source software
community for a significant amount of time. Python is supported by a huge amount
of libraries to develop various features, such as graphical user interfaces, plots,
messaging, and cloud applications.
This book tries to bring you the best of both hardware and software worlds to help you
develop exciting projects using Arduino and Python. The main goal of the book is to
assist the reader to solve the difficult problem of interfacing Arduino hardware with
Python libraries. Meanwhile, as a secondary goal, the book also provides you with
exercises and projects that can be used as blueprints for your future IoT projects.
The book has been designed in such a way that every successive chapter has increasing

complexity in terms of material that is covered and also more practical value. The
book has three conceptual sections (getting started, implementing Python features,
and network connectivity) and each section concludes with a practical project that
integrates the concepts that you learned in that section.
The theoretical concepts and exercises covered in the book are meant to give you
hands-on experience with Python-Arduino programming, while the projects are
designed to teach you hardware prototyping methodologies for your future projects.
However, you will still need extensive expertise in each domain to develop a
commercial product. In the end, I hope to provide you with sufficient knowledge
to jump-start your journey in this novel domain of the IoT.


Preface

What this book covers

Chapter 1, Getting Started with Python and Arduino, introduces the fundamentals of
the Arduino and Python platforms. It also provides comprehensive installation and
configuration steps to set up the necessary software tools.
Chapter 2, Working with the Firmata Protocol and the pySerial Library, discusses the
interfacing of the Arduino hardware with the Python program by explaining the
Firmata protocol and the serial interfacing library.
Chapter 3, The First Project – Motion-triggered LEDs, provides comprehensive guidelines
to create your first Python-Arduino project, which controls different LEDs according to
the detected motion.
Chapter 4, Diving into Python-Arduino Prototyping, takes you beyond the basic
prototyping that we performed in the previous project and provides an in-depth
description of prototyping methods, with appropriate examples.
Chapter 5, Working with the Python GUI, begins our two-chapter journey into
developing graphical interfaces using Python. The chapter introduces the Tkinter

library, which provides the graphical frontend for the Arduino hardware.
Chapter 6, Storing and Plotting Arduino Data, covers Python libraries, CSV and
matplotlib that are used to store and plot the sensor data respectively.
Chapter 7, The Midterm Project – a Portable DIY Thermostat, contains a practical and
deployable project that utilizes the material that we covered in previous chapters
such as serial interfacing, a graphical frontend, and a plot of the sensor data.
Chapter 8, Introduction to Arduino Networking, introduces computer networking
for Arduino while utilizing various protocols to establish Ethernet communication
between the Python program and Arduino. This chapter also explores a messaging
protocol called MQTT, with basic examples. This protocol is specifically designed
for resource-constrained hardware devices such as Arduino.
Chapter 9, Arduino and the Internet of Things, discusses the domain of the IoT while
providing step-by-step guidelines to develop cloud-based IoT applications.
Chapter 10, The Final Project – a Remote Home Monitoring System, teaches a design
methodology for the hardware product, followed by a comprehensive project that
interfaces the cloud platform with Arduino and Python.
Chapter 11, Tweet-a-PowerStrip, contains another IoT project that is based on
everything that we learned in the book. The project explores a unique approach
to integrate a social network, Twitter, with the Python-Arduino application.
[2]


Preface

What you need for this book

To begin with, you will just need a computer with one of the supported operating
systems, Windows, Mac OS X, or Linux. The book requires various additional
hardware components and software tools to implement programming exercises
and projects. A list of required hardware components and locations to obtain these

components are included in each chapter.
In terms of software, the book itself provides step-by-step guidelines to install and
configure all the necessary software packages and dependent libraries that are utilized
throughout the book. Note that the exercises and projects included in the book are
designed for Python 2.7 and they have not been tested against Python 3+.

Who this book is for

If you are a student, a hobbyist, a developer, or a designer with little or no
programming and hardware prototyping experience and you want to develop
IoT applications, then this book is for you.
If you are a software developer and interested in gaining experience with hardware
domain, this book will help you to get started. If you are a hardware engineer who
wants to learn advance software features, this book can help you to begin with.

Conventions

In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"While assigning the value to the weight variable, we didn't specify the data type,
but the Python interpreter assigned it as an integer type, int."
A block of code is set as follows:
/*
Blink
Turns on an LED on for one second, then off for one second,
repeatedly.
This example code is in the public domain.

*/

[3]


Preface
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);
// turn the LED on (HIGH is the voltage
level)
delay(1000);
// wait for a second
digitalWrite(led, LOW);
// turn the LED off by making the voltage
LOW
delay(1000);
// wait for a second
}

Any command-line input or output is written as follows:
$ sudo easy_install pip


New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "In the
System window, click on the Advanced system settings in the left navigation bar
to open a window called System Properties."
Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it
helps us develop titles that you will really get the most out of.

[4]


Preface

To send us general feedback, simply e-mail , and mention
the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.


Downloading the example code

You can download the example code files from your account at http://www.
packtpub.com for all the Packt Publishing books you have purchased. If you
purchased this book elsewhere, you can visit />and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/
diagrams used in this book. The color images will help you better understand the
changes in the output. You can download this file from: ktpub.
com/sites/default/files/downloads/5938OS_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you could report this to us. By doing so, you can save
other readers from frustration and help us improve subsequent versions of this book.
If you find any errata, please report them by visiting />submit-errata, selecting your book, clicking on the Errata Submission Form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded to our website or added to any list of
existing errata under the Errata section of that title.
To view the previously submitted errata, go to />content/support and enter the name of the book in the search field. The required

information will appear under the Errata section.

[5]



Preface

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
Please contact us at with a link to the suspected
pirated material.
We appreciate your help in protecting our authors and our ability to bring
you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at
, and we will do our best to address the problem.

[6]


×