27,59 €
Blynk, known as the most user-friendly IoT platform, provides a way to build mobile applications in minutes. With the Blynk drag-n-drop mobile app builder, anyone can build amazing IoT applications with minimal resources and effort, on hardware ranging from prototyping platforms such as Arduino and Raspberry Pi 3 to industrial-grade ESP8266, Intel, Sierra Wireless, Particle, Texas Instruments, and a few others.
This book uses Raspberry Pi as the main hardware platform and C/C++ to write sketches to build projects. The first part of this book shows how to set up a development environment with various hardware combinations and required software. Then you will build your first IoT application with Blynk using various hardware combinations and connectivity types such as Ethernet and Wi-Fi. Then you'll use and configure various widgets (control, display, notification, interface, time input, and some advanced widgets) with Blynk App Builder to build applications. Towards the end, you will learn how to connect with and use built-in sensors on Android and iOS mobile devices. Finally you will learn how to build a robot that can be controlled with a Blynk app through the Blynk cloud and personal server.
By the end of this book, you will have hands-on experience building IoT applications using Blynk.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 119
Veröffentlichungsjahr: 2018
Copyright © 2018 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 or its dealers and distributors, will be held liable for any damages caused or alleged to have been 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.
Commissioning Editor: Gebin GeorgeAcquisition Editor: Prachi BishtContent Development Editor: Trusha ShriyanTechnical Editor: Varsha ShivhareCopy Editor:Safis EditingProject Coordinator: Kinjal BariProofreader: Safis EditingIndexer: Pratik ShirodkarGraphics: Jisha ChirayilProduction Coordinator: Shantanu Zagade
First published: May 2018
Production reference: 1220518
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78899-506-1
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
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 [email protected] 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.
Pradeeka Seneviratne is a software engineer with over 10 years of experience in computer programming and systems design. He is an expert in the development of Arduino- and Raspberry Pi-based embedded systems, and is currently a full-time embedded software engineer working with embedded systems and highly scalable technologies. Previously, he worked as a software engineer for several IT infrastructure and technology servicing companies. He has also authored Beginning BBC micro:bit, published by Apress.
Munawwar HussainShelia is a digital artist and software engineer based in Mumbai, India. An engineering graduate (BE) in computer science, his curiosity to try his hand at the next latest technology keeps him thinking ahead on the boundaries of coding. He started his career in mobile application development with Java and Android, before moving on to full-stack JavaScript (MEAN stack) Node.js, where he put his heart and soul into building more real-time web applications. Currently, he is in the role of data science, and extracts actionable intelligence anddoespredictive analytics from large datasets.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Hands-On Internet of Things with Blynk
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Setting Up a Development Environment
What is Blynk?
Hardware platforms
Connection types
Blynk architecture
Blynk ecosystem
Online resources
The Blynk app builder
Installing the Blynk app builder
Creating a Blynk account
Creating a new project
Getting parts
Raspberry Pi
Setting up Raspberry Pi
Setting up software on Raspberry Pi
Installing Raspbian
Writing Raspbian Stretch Lite image on SD card
Creating a configuration file for SSH
Connecting with Raspberry Pi with SSH
Configuring a wireless connection on Raspberry Pi
Installing prerequisite software on Raspbian
Updating and upgrading Raspbian
Installing git
Installing WiringPi
Deploying Blynk libraries
Connecting Raspberry Pi with Blynk Cloud
Summary
Building Your First Blynk Application
Controlling an LED
Things you need
Building the circuit
Building the Blynk app
Adding a Button widget
Running the project
Playing the app
Using virtual pins
Configuring Button widget with virtual pin
Modifying the main.cpp file
Running the project
Summary
Using Controller Widgets
Creating a project
Slider
Adding a Slider widget
Using digital pins
Using virtual pins
Step
Adding a Step widget
Using digital pins
Using virtual pins
zeRGBa
Using digital pins
Using virtual pins
Controlling an RGB LED
Building the circuit
Running the project
Joystick
Using digital pins
Using virtual pins
Summary
Using Display Widgets
Value Display
Using digital pins
Using virtual pins
Labeled Value
Configuring a Labeled Value widget
LED
Using virtual pins
Summary
Using Notification Widgets
Adding a Twitter widget
Configuring
Sending tweets
Twitter button
Notification widget
Configuring the Notification widget
Writing a notification
Configuring the Email widget
Writing code to send email
Summary
Connecting with Sensors on Your Mobile Device
Accelerometer
Accelerometer widget
Configuring the Accelerometer widget
Reading accelerometer data
Calculating overall acceleration
Light sensor
Adding the Light Sensor widget
Configuring the Light Sensor widget
Reading light sensor
Proximity sensor
Configuring the Proximity Sensor widget
Writing code
Summary
Setting Up a Personal Blynk Server
Setting up a Blynk server on Raspberry Pi
Enabling autostart with rc.local
Enabling autostart with crontab
Verifying that the Blynk server is running
Connecting the Blynk app builder with the server
Creating a new project to get the auth token
Using the administration interface
Writing a simple code to build the connection
Summary
Controlling a Robot with Blynk
Choosing a chassis kit
Adafruit
SparkFun
Pololu
Creating a Blynk app
Motor driver
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
Blynk is referred to as the most user-friendly IoT platform, providing a way to build mobile applications in minutes. With Blynk's drag and drop mobile app builder, anyone can build amazing IoT applications with minimal resources and effort. Blynk supports over 400 hardware platforms and major connectivity types. The hardware could be prototyping platforms, such as Arduino and Raspberry Pi, to industrial-grade ESP8266, Intel, Sierra Wireless, Particle, and Texas Instruments offerings.
This book uses Raspberry Pi as the main hardware platform and C++ for writing code to build projects.
The first part of this book offers how to set up the development environment with Raspberry Pi, Raspbian Stretch LITE, and various software components. Then, the reader will build the first IoT application with Blynk.
The middle part of the book presents how to use and configure various widgets (control, display, and notify) with Blynk app builder to build applications.
The latter part of the book will introduce how to connect with and use built-in sensors on mobile devices such as Android and iOS. After this, the reader will learn how to set up a personal Blynk server on Raspberry Pi. Finally, the reader will learn how to build a robot vehicle that can be controlled with a Blynk app through the Blynk cloud service.
This book is for those who want to build rapid IoT applications in minutes for connected products and services with only a basic understanding of electronics, Raspberry Pi, and C++.
Chapter 1, Setting Up a Development Environment, explains how to set up the development environment for Blynk with Raspberry Pi. It describes how to install Blynk libraries and some supporting software components that you can use to build Raspberry Pi-based IoT hardware. Then, you will build a control application with Blynk app builder. After that, you need to write a C++ application to connect with the Blynk cloud. Finally, you run the Blynk app to connect the Raspberry Pi to Blynk app builder through the Blynk cloud over a Wi-Fi network.
Chapter 2, Building Your First Blynk Application, explains how to build your first Blynk application to control an LED (or any actuator) attached to the Raspberry Pi from your smartphone or tablet. First, you will build an app with the Blynk app builder. Then, you will use digital or virtual pins to control the attached LED. After that, you will learn how to write a simple C++ application with nano text editor. Finally, you will build the application and run it to connect the Blynk app and the Raspberry Pi hardware.
Chapter 3, Using Controller Widgets, covers how to use controller widgets such as Slider, Step, Joystick, and zeRGBa, to control actuators. You will also learn how to use WiringPi’s software PWM library, connect controller widgets with digital and virtual pins, use the split and merge mode, and parsing values coming from the controller widgets.
Chapter 4, Using Display Widgets, guides you on how to use display widgets, such as the Value Display widget, and Labeled Value widget to show sensor data, and the LED widget to show a button state.
Chapter 5, Using Notification Widgets, explains how to send notifications to the Blynk app from Raspberry Pi. You will schedule your Raspberry Pi to send notifications to your smartphone on user action. Some of the notification widgets can be integrated with third-party services, such as Twitter to send tweets from Raspberry Pi. Then, you will use the notification widget to send pop-up notifications to the smartphone or tablet. Finally, you will also learn how to send emails from Raspberry Pi using the Email widget.
Chapter 6, Connecting with Sensors on Your Mobile Device, guides you on how to read data from built-in sensors such as the accelerometer, light sensor, and proximity sensor on your smartphone or tablet.
Chapter 7, Setting Up a Personal Blynk Server, guides you on how to set up a personal Blynk server on Raspberry Pi. The Blynk personal server replaces the Blynk cloud. You can connect all your Blynk hardware to this personal server through your local network.
Chapter 8, Controlling a Robot with Blynk, explains how to build a robot vehicle using a two-wheeled robot chassis kit. Then, you will build an application with the Blynk app builder to control it through the Blynk cloud by connecting to a Wi-Fi network.
You should install the Raspbian Stretch LITE operating system on Raspberry Pi. The nano text editor is used to write C++ code in the Raspberry Pi environment. PuTTY is used to make serial connections between Raspberry Pi and the computer that is running Windows.
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packtpub.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub athttps://github.com/PacktPublishing/Hands-On-Internet-of-Things-with-Blynk. If there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available athttps://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/HandsOnInternetofThingswithBlynk_ColorImages.pdf.