Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Internet of Things

You're reading from  Mastering Internet of Things

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788397483
Pages 410 pages
Edition 1st Edition
Languages
Author (1):
Peter Waher Peter Waher
Profile icon Peter Waher

Table of Contents (24) Chapters

Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
1. Preparing Our First Raspberry Pi Project 2. Creating a Sensor to Measure Ambient Light 3. Creating an Actuator for Controlling Illumination 4. Publishing Information Using MQTT 5. Publishing Data Using HTTP 6. Creating Web Pages for Your Devices 7. Communicating More Efficiently Using CoAP 8. Interoperability 9. Social Interaction with Your Devices Using XMPP 10. The Controller 11. Product Life Cycle 12. Concentrators and Bridges 13. Using an Internet of Things Service Platform 14. IoT Harmonization 15. Security for the Internet of Things 16. Privacy 1. Other Books You May Enjoy Index

Getting what you need


For the purposes of this chapter, you will need the following:

  • A Raspberry Pi 2 or 3 (you'll need three in total, throughout the book)
  • A micro SD memory card (16 GB or greater) for each Raspberry Pi
  • A shielded box, to avoid electrostatic damage to your device
  • A laptop or PC running Windows 10, where you can insert the memory card
  • An Ethernet network cable, if you use Raspberry Pi 2 or lack Wi-Fi
  • An internet connection

The Raspberry Pi 2 or 3 will allow us to run .NET applications and control peripherals using digital input and output easily. It's also a great platform for creating connected distributed services. One of its weaknesses, however, is its lack of simple out-of-the-box analog interfaces. To do analog input and output, you must connect additional chips or equipment using either synchronous or asynchronous serial communication interfaces that converts analog signals to digital ones. To simplify this task, you can also use an Arduino board that you connect to the Raspberry Pi via USB. This has the added benefit of allowing you to use a wide range of standard Arduino peripherals and devices in your Raspberry Pi projects. So, you need to add to your list:

  • Arduino shield for Raspberry Pi B+/2B/3B
  • Short serial USB cable to connect the Arduino board to the Raspberry Pi
  • Analog Arduino-compatible light sensor
  • Digital motion detection PIR sensor
  • Digital relay module

Most of the above equipment (and more) can be obtained in so-called Starter Kits. Such starter kits make for great fun, since they often include a wide variety of sensors and actuators for you to play with. For examples, refer to https://www.dfrobot.com/category-173.html.

Note

You can use the Arduino Uno board as well. The advantage of the Arduino shield for Raspberry Pi is that it mounts easier on top of the Raspberry Pi.

Downloading the IoT Dashboard

Installing Windows 10 on a Raspberry Pi is both free and very easy. Microsoft has developed a tool for this purpose: the IoT Dashboard. Apart from allowing you to download and install Windows 10 on your devices, it also helps you manage your devices in the network. It's a very handy tool, and does not require you to learn any command-line syntax:

Note

Download and install the IoT Dashboard from the following link: https://developer.microsoft.com/en-us/windows/iot/docs/iotdashboard

The IoT Dashboard is a Windows 10 app. Once running, you can choose to right-click on its icon and select Pin to taskbar, so that you can find it easier later.

If you don't want to use Windows 10, and want to use Linux instead, you can do so with the following modifications:

  • You can use the Raspbian operating system instead. It's based on Debian. Follow the following instructions on how to download and install it: https://www.raspberrypi.org/documentation/installation/installing-images/.
  • Instead of compiling your project as a .NET Core application, compile it as a standard .NET Framework application instead.
  • Run the application using Mono. You can follow the following instructions on how to accomplish this: http://www.raspberry-sharp.org/eric-bezine/2012/10/mono-framework/installing-mono-raspberry-pi/.

Note

You can run .NET Core on Linux as well. For more information, see: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md

Installing Windows 10 on your Raspberry Pi

When you've installed and run the IoT Dashboard, a window appears:

  1. Select Set up a new device in the left-hand menu. This will open a simple form. Select your device (Raspberry Pi 2 & 3) and the OS you want to download and install (Windows 10 IoT Core).
  1. Also, insert the memory card into the computer and select the Drive letter it is assigned to. Other relevant information you need to provide include the Device name and an Administrator password:

Setting up a new device

Note

Remember the password!

  1. If you have access to Wi-Fi (2.4 GHz), and are programming a device with access to Wi-Fi, make sure the correct Wi-Fi Network Connection is also assigned:

Configuring Wi-Fi connectivity

  1. Finally, accept the license agreement, and press the Download and install button:

Installing Windows 10

You need to confirm you really want to format the memory card, and install Windows 10 on it. All previous data on the card will be lost. The IoT Dashboard then goes on to download the operating system and preparing the memory chip for you, including configuring the device, according to the settings you provided. This process includes performing some command-line tasks, so you will see a terminal window appear temporarily.

You have been reading a chapter from
Mastering Internet of Things
Published in: Mar 2018 Publisher: Packt ISBN-13: 9781788397483
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}