Windows 10 for the Internet of Things: Controlling Internet-Connected Devices from Raspberry Pi
By Charles Bell
()
About this ebook
Windows 10 for the Internet of Things presents a set of example projects covering a wide range of techniques designed specifically to jump start your own Internet of Things creativity. You'll learn everything you need to know about Windows IoT Core to develop Windows and IoT applications that run on single board computers such as the Raspberry Pi. You’ll learn to develop for the Raspberry PI using native Windows and all the related programming skills that you have built up from developing desktop and mobile applications.
This book provides just the help you need to get started in putting your Windows skills to use in a burgeoning new world of development for small devices that are ubiquitously connected to the Internet.
What You Will Learn
- Know Windows 10 on the Raspberry Pi
- Read sensor data and control actuators
- Connect to and transmit data into the cloud
- Remotely control your devices from any Windows device
- Develop IOT applications under Windows using C#, C++, and Visual Basic
- Store your IOT data in a database for later analysis
Who This Book Is For
Developers and enthusiasts wanting to take their skills in Windows development and connect everyday devices to the Internet by developing for Windows 10 IoT Core. Readers learn to develop in C#, C++, and Visual Basic using Visual Studio, for deployment on devices such as the Raspberry Pi.
Charles Bell
Dr. Charles A Bell is a Senior Software Engineer at Oracle. He iscurrently the lead developer for backup and a member of the MySQLBackup and Replication team. He lives in a small town in ruralVirginia with his loving wife. He received his Doctor of Philosophy inEngineering from Virginia Commonwealth University in 2005. Hisresearch interests include database systems, versioning systems,semantic web, and agile software development.
Read more from Charles Bell
Maintaining and Troubleshooting Your 3D Printer Rating: 0 out of 5 stars0 ratingsBeginning IoT Projects: Breadboard-less Electronic Projects Rating: 0 out of 5 stars0 ratingsIntroducing MySQL Shell: Administration Made Easy with Python Rating: 0 out of 5 stars0 ratingsBeginning Sensor Networks with XBee, Raspberry Pi, and Arduino: Sensing the World with Python and MicroPython Rating: 0 out of 5 stars0 ratingsIntroducing InnoDB Cluster: Learning the MySQL High Availability Stack Rating: 0 out of 5 stars0 ratingsIntroducing the MySQL 8 Document Store Rating: 0 out of 5 stars0 ratings
Related to Windows 10 for the Internet of Things
Related ebooks
Raspberry Pi IoT Projects: Prototyping Experiments for Makers Rating: 0 out of 5 stars0 ratingsDeveloping IoT Projects with ESP32: Automate your home or business with inexpensive Wi-Fi devices Rating: 0 out of 5 stars0 ratingsCommercial and Industrial Internet of Things Applications with the Raspberry Pi: Prototyping IoT Solutions Rating: 0 out of 5 stars0 ratingsImplementing C# 11 and .NET 7.0: Learn how to build cross-platform apps with .NET Core (English Edition) Rating: 0 out of 5 stars0 ratingsIntel Galileo Blueprints Rating: 0 out of 5 stars0 ratingsInternet of Things with Python Rating: 0 out of 5 stars0 ratingsBeginning Robotics with Raspberry Pi and Arduino: Using Python and OpenCV Rating: 0 out of 5 stars0 ratingsReal-Time IoT Imaging with Deep Neural Networks: Using Java on the Raspberry Pi 4 Rating: 0 out of 5 stars0 ratingsBuilding Smart Homes with Raspberry Pi Zero Rating: 0 out of 5 stars0 ratingsProgramming Basics: Getting Started with Java, C#, and Python Rating: 0 out of 5 stars0 ratingsLearn IoT Programming Using Node-RED: Begin to Code Full Stack IoT Apps and Edge Devices with Raspberry Pi, NodeJS, and Grafana Rating: 0 out of 5 stars0 ratingsVisual Studio Code: End-to-End Editing and Debugging Tools for Web Developers Rating: 0 out of 5 stars0 ratingsInternet of Things with ESP8266 Rating: 0 out of 5 stars0 ratingsInternet of Things Programming Projects: Build exciting IoT projects using Raspberry Pi 5, Raspberry Pi Pico, and Python Rating: 0 out of 5 stars0 ratingsLearn Kotlin for Android Development: The Next Generation Language for Modern Android Apps Programming Rating: 0 out of 5 stars0 ratingsHands-On Internet of Things with MQTT: Build connected IoT devices with Arduino and MQ Telemetry Transport (MQTT) Rating: 0 out of 5 stars0 ratingsConnecting Arduino to the Web: Front End Development Using JavaScript Rating: 0 out of 5 stars0 ratingsDeveloping Web Components with TypeScript: Native Web Development Using Thin Libraries Rating: 0 out of 5 stars0 ratingsMastering Android NDK Rating: 0 out of 5 stars0 ratingsLearn Qt 5: Build modern, responsive cross-platform desktop applications with Qt, C++, and QML Rating: 0 out of 5 stars0 ratingsIntel Galileo Essentials Rating: 0 out of 5 stars0 ratingsBuild Your Own IoT Platform: Develop a Fully Flexible and Scalable Internet of Things Platform in 24 Hours Rating: 0 out of 5 stars0 ratingsData-Driven Security: Analysis, Visualization and Dashboards Rating: 0 out of 5 stars0 ratingsSmart Internet of Things Projects Rating: 4 out of 5 stars4/5Internet of Things with Intel Galileo Rating: 0 out of 5 stars0 ratingsSensor Projects with Raspberry Pi: Internet of Things and Digital Image Processing Rating: 0 out of 5 stars0 ratingsByte by Byte Rating: 0 out of 5 stars0 ratingsMicroPython Projects: A do-it-yourself guide for embedded developers to build a range of applications using Python Rating: 0 out of 5 stars0 ratings
Programming For You
Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsSQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 5 out of 5 stars5/5Spies, Lies, and Algorithms: The History and Future of American Intelligence Rating: 4 out of 5 stars4/5C# Programming from Zero to Proficiency (Beginner): C# from Zero to Proficiency, #2 Rating: 0 out of 5 stars0 ratingsHTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Tiny Python Projects: Learn coding and testing with puzzles and games Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsGrokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5HTML in 30 Pages Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5C All-in-One Desk Reference For Dummies Rating: 5 out of 5 stars5/5iPhone For Dummies Rating: 0 out of 5 stars0 ratings
Reviews for Windows 10 for the Internet of Things
0 ratings0 reviews
Book preview
Windows 10 for the Internet of Things - Charles Bell
© Charles Bell 2021
C. BellWindows 10 for the Internet of Thingshttps://doi.org/10.1007/978-1-4842-6609-0_1
1. What Is the Internet of Things?
Charles Bell¹
(1)
Warsaw, VA, USA
Much has been written about the Internet of Things (hence IoT). Some sources are more about promoting IoT as their next big feature; other sources seem to suggest IoT is something everyone needs to learn or be left behind. Fortunately, books and similar media avoid the sales pitch to expand on the science and technology for implementing and managing the data for IoT, while other texts concentrate on the future or the inevitable evolution of our society as we become more connected to the world around us each and every day. However, you need not dive into such tomes or be able to recite rhetoric to get started with the IoT. In fact, through the efforts of many companies, including Microsoft, you can explore the IoT without intensive training or expensive hardware and software.
This book is intended to be a guide to help you understand the IoT and to begin building solutions that you can use to learn more about it. We will explore many aspects—from understanding what the IoT is to basic knowledge of electronics and even how to write custom software for building solutions for the Internet of Things. Best of all, we do so by using one of the most popular platforms for personal computers—Windows 10—and one of the bestselling hardware for IoT development—the Raspberry Pi.
So, what is this IoT?¹ I’ll begin by explaining what it isn’t. The IoT is not a new device or proprietary software, or some new piece of hardware. It is not a new marketing scheme to sell you more of what you already have by renaming it and pronouncing it new and improved.
² While it is true that the IoT employs technology and techniques that already exist, the way they are employed, coupled with the ability to access the solution from anywhere in the world, makes the IoT an exciting concept to explore. Now let’s discuss what the IoT is.
The essence of the IoT is simply interconnected devices that generate and exchange data from observations, facts, and other data, making it available to anyone. While there seem to be some marketing efforts attempting to make anything connected to the Internet an IoT solution or device (not unlike the shameless labeling of everything cloud
), IoT solutions are designed to make our knowledge of the world around us more timely and relevant by making it possible to get data about anything from anywhere at any time.
As you can imagine, if we were to connect every device around us to the Internet and make sensory data available for those devices, it is clear there is potential for the number of IoT devices to exceed the human population of the planet and for the data generated to rapidly exceed the capabilities of all but the most sophisticated database systems. These concepts are commonly known as addressability and big data, which are two of the most active and debated topics in IoT.
However, the IoT is all about understanding the world around us. That is, we can leverage the data to make our world and our understanding of it better.
The Internet of Things and You
The human body is a marvel of ingenious sensory apparatus that allow us to see, hear, taste, and even feel through touch anything we encounter or get near. Even our brains can store visual and auditory events recalling them at will. IoT solutions mimic many of these sensory capabilities and therefore can become an extension of our own abilities.
While that may sound a bit grandiose (and it is), IoT solutions can record observations in the form of data from one or more sensors. Sensors are devices that produce either analog or digital values. We can then use the data collected to draw conclusions about the subject matter.
This could be as simple as a sensor to detect when a mailbox is opened. In this case, the knowledge we gain from a simple switch opening or closing (depending on how it is implemented and interpreted) may be used to predict when incoming mail has arrived or when outgoing mail has been picked up. I use the term predict because the sensor (switch) only tells us the door was opened or closed, not that anything was placed in or removed from the mailbox itself—that would require additional sensors.
When working with IoT projects that include sensors, you should always think about what conclusions you can draw from the data. Sometimes, like the switch in the mailbox, it can be only a few things, which is most often the case. By defining what we can perceive (learn) from the sensor data, we can better understand what our IoT project and its data can do for us.
A more sophisticated example is using a series of sensors to record atmospheric data such as temperature, humidity, barometric pressure, wind speed, ambient light, rainfall, and so forth, to monitor the weather and perform analysis on the data to predict trends in weather. That is, we can predict within a reasonable certainty that precipitation is in the area and to some extent its severity.
Now, add the ability to see this data not only in real time (as it occurs) but also remotely from anywhere in the world, and the solution becomes more than a simple weather station. It becomes a way to observe the weather about one place from anywhere in the world.
This example may be a bit commonplace since you can tune into any number of television, Web, and radio broadcasts to hear the weather from anywhere in the world. But consider the implications of building such a solution in your home. Now you can see data about the weather at your own home from anywhere!
In the same way, but perhaps on a smaller scale, we can build solutions to monitor plants to help us understand how often they need water and other nutrients. Or perhaps we can monitor our pets while we are away at work. Further, we can record data about wildlife in our area to better understand our effect on nature.
IoT Is More Than Just Connected to the Internet
So, if a device is connected to the Internet, does that make it an IoT solution? That depends on whom you ask. Some believe the answer is yes. However, others (like me) contend that the answer is not unless there is some benefit from doing so.
For example, if you could connect your toaster to the Internet, what would be the benefit of doing so? It would be pointless (or at least extremely eccentric) to get a text on your phone from your toaster stating that your toast is ready given that it only takes a couple of minutes to complete. In this case, the answer is no. However, if you have someone—such as a child or perhaps an older adult—whom you would like to monitor, it may be helpful to be able to check to see how often and when they use a device like a toaster so that you can check on them.³ That is, you can use the data to help you make decisions about their care and safety.
Allow me to illustrate with another example. I was fortunate to participate in a design workshop held on the Microsoft campus in the late 1990s. During our tour of the campus, we were introduced to the world’s first Internet-enabled refrigerator (also called a smart refrigerator). There were sensors in the shelves to detect the weight of food. It was suggested that, with a little ingenuity, you could use the sensors to notify your grocer when your milk supply ran low, which would enable people to have their grocery shopping not only online but also automatic. This would have been great if you lived in a location where your grocer delivers, but not very helpful for those of us who live in rural areas.⁴ While it wasn’t touted an IoT device (the term was coined later), many felt the device illustrated what could be possible if devices were connected to the Internet.
Thus, being connected to the Internet doesn’t make something IoT. Rather, IoT solutions must be those things that provide some meaning—however small that benefit is to someone or some other device or service. More importantly, IoT solutions allow us to sense the world around us and learn from those observations. The real tricky part is in how the data is collected, stored, and presented. We will see all of these in practice through examples in later chapters.
IoT solutions can also take advantage of companies that provide services that can help enhance or provide features that you can use in your IoT solutions. These features are commonly called IoT services and range from storage and presentation to infrastructure services, such as hosting.
IoT Services
Sadly, there are companies that tout having IoT products and services that are nothing more than marketing hype—much like what some companies have done by prepending cloud
or appending for the cloud
to the name. Fortunately, there are some good products and services being built especially for IoT. These range from data storage and hosting to specialized hardware.
Indeed, businesses are adding IoT services to their product offerings, and it isn’t the usual suspects, such as the Internet giants. I have seen IoT solutions and services being offered by Cisco, AT&T, HP, and countless startups and smaller businesses. I use the term IoT vendor to describe those businesses that provide services for IoT solutions.
You may be wondering what these services and products are and why someone would consider using them. That is, what is an IoT service and why would you decide to buy it? The biggest concerns in the decision to buy a service are cost and time to market.
If your developers do not have the resources or expertise and obtaining them will require more than the cost of the service, it may be more economical to purchase the service. However, you should also consider any additional software or hardware changes (sometimes called retooling) necessary in the decision. I once encountered a well-meaning and well-documented contracted service that permitted a product to go to market sooner than projected at a massive savings. Sadly, while the champions of that contract won awards for technical achievement, they failed to consider the fact that the systems had to be retooled to use the new service. More specifically, it took longer to adopt the new service than it would to write one from scratch. So instead of saving money, the organization spent nearly twice the original budget and was late to market. Clearly, you must consider all factors.
Similarly, if your time is short or you have hard deadlines to meet to make your solution production-ready, it may be quicker to purchase an IoT service rather than create or adapt your own. This may require spending a bit more, but in this case, the motivation is time and not (necessarily) cost. Of course, project planning is a balance of cost, time, and features.
So, what are some of the IoT services available? The following lists a few that have emerged in the last few years. It is likely more will be offered as IoT solutions and services mature.
Enterprise IoT data hosting and presentation: Services that allow your users to develop enterprise IoT solutions from connecting to, managing, and customizing data presentation in a friendly form, such as graphs, charts, and so forth
IoT data storage: Services that permit you to store your IoT data and get simple reports
Networking: Services that provide networking and similar communication protocols or platforms for IoT. Most specialize in machine-to-machine (M2M) services
IoT hardware platforms: Vendors that permit you to rapidly develop and prototype IoT devices using a hardware platform and a host of supported modules and tools for building devices ranging from a simple component to a complete device
Now that you know more about what IoT is, let’s look at a few examples of IoT solutions to get a better idea of what IoT solutions can do and how they are employed.
A Brief Look at IoT Solutions
An IoT solution is simply a set of devices designed to produce, consume, or present data about some event or series of events or observations. This can include devices that generate data, such as a sensor, devices that combine data to deduce something, devices or services designed to tabulate and store the data, and devices or systems designed to present the data. Any or all of these may be connected to the Internet.
IoT solutions may include one or all of these qualities, whether it is combined into a single device such as a web camera; used a sensor package and monitoring unit, such as a weather station; or used a complex system of dedicated sensors, aggregators, data storage, and presentation, such as complete home automation system. Figure 1-1 shows a futuristic picture of all devices—everywhere—connected to the Internet through databases, data collectors or integrators, display services, or other devices.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig1_HTML.pngFigure 1-1
The future of IoT—all devices, everywhere⁵
Let’s take a look at some example IoT solutions. The IoT solutions described in this section are a mix of solutions that should give you an idea of the ranges of sizes and complexities of IoT solutions. I also point out how some of these solutions leverage services from IoT vendors.
Sensor Networks
Sensor networks are one of the most common forms of IoT solutions. Simply stated, sensor networks allow you to observe the world around you and make sense of it. Sensor networks could take the form of a pond monitoring system that alerts you to water level, water purity (contamination), or water temperature; or detects predators; or even turns on features automatically, such as lighting or fish feeders.
If you, or someone you know, have spent any time in a medical facility, it’s likely that a sensor network was employed to monitor body functions, such as temperature, cardiac and respiratory rates, and even movement. Modern automobiles also contain sensor networks dedicated to monitoring the engine, climate, and, even in some cars, road conditions. For example, the lane-warning feature uses sensors (typically a camera, microprocessor, and software) to detect when you drift too far toward lane or road demarcations.
Thus, sensor networks employ one or more sensors that take measurements (observations) about an event or state and communicate that data to another component or node in the network, which is then presented, in some form or another, for analysis. Let’s take a look at an example of an important medical IoT solution .
Medical Applications
Medical applications —including health monitoring and fitness—are gaining a lot of attention as consumer products. These solutions cover a wide range of capabilities, such as the fitness features built into the Apple Watch to fitness bands that keep track of your workout, and even medical applications that help you control life-threatening conditions. For example, there are solutions that can help you manage diabetes.
Diabetes is a disease that affects millions of people worldwide (www.diabetes.org). There are several forms: the most serious being type 1 (www.diabetes.org/diabetes-basics/type-1/?loc=db-slabnav). Those afflicted with type 1 diabetes do not produce enough (or any) insulin due to genetic deficiencies, birth defects, or injuries to the pancreas. Insulin is a hormone that the body uses to extract a simple sugar called glucose, which is created from sugars and starches, from blood for use in cells.
Thus, type 1 diabetics must monitor their blood glucose to ensure that they are using their medications (primarily insulin) properly and balanced with a healthy lifestyle and diet. If their blood glucose levels become too low or too high, they can suffer from a host of symptoms. Worse, extremely low blood glucose levels are very dangerous and can be fatal.
One of the newest versions of a blood glucose tester consists of a small sensor that is inserted in the body along with a monitor that connects to the sensor via Bluetooth. You wear the monitor on your body (or keep it within 20 feet at all times). The solution is marketed by Dexcom (www.dexcom.com) and is called a continuous glucose monitor (CGM) that permits the patient to share their data to others via their phone. Thus, the patient pairs their CGM with their phone and then shares the data over the Internet to others. This could be loved ones, those that help with their care, or even medical professionals. Figure 1-2 shows an example of the Dexcom CGM monitor and sensor. The monitor is on the left, and the sensor and transmitter are on the right. The sensor is the size of a small syringe needle and remains inserted in the body for up to a week.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig2_HTML.pngFigure 1-2
Dexcom continuous glucose monitor with sensor
WHAT ABOUT BLOOD GLUCOSE TESTERS (GLUCOMETERS)?
Until solutions like the Dexcom CGM came about, diabetics had to use a manual tester. Traditional blood glucose testers are single-use events that require the patient to prick their finger or arm and draw a small amount of blood onto a test strip. While this device has been used for many years, it is only recently that manufacturers have started making blood glucose testers with memory features and even connectivity to other devices, such as laptops or phones. The ultimate evolution of these devices is a solution like Dexcom, which has become a medical IoT device that improves the quality of life for diabetics.
Dexcom also provides a free web-based reporting software called Clarity that is accessed from a special uploading application called the Clarity Uploader (see http://dexcom.com/clarity for more details)⁶ to allow patients to see the data collected and generate a host of reports they can use to see their glucose levels over time. Reports include averages, patterns, daily trends, and more. They can even share their data with their doctor. Figure 1-3 shows an example of the Dexcom Clarity with typical data loaded.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig3_HTML.jpgFigure 1-3
Dexcom Clarity
A feature called Dexcom Share permits the patient to make their data available to others via an app on their phone. That is, the patient’s phone transmits data to the Dexcom cloud servers, which is then sent to anyone who has the Dexcom Share app and has been given permission to see the data. Figure 1-4 shows an example of the Dexcom Share CGM report from the Dexcom Share iOS app, which allows you to check the blood glucose of a friend easily and quickly or loved one.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig4_HTML.jpgFigure 1-4
Dexcom Share app report
Not only does the app allow the visualization of the data, it can also relay alerts for low or high blood glucose levels, which has profound implications for patients who suffer from additional ailments or complications from diabetes. For example, if the patient’s blood glucose level drops while they are alone, incapacitated, or unable to get treatment, loved ones with the Dexcom Share app can respond by checking on the patient and potentially avoiding a critical diabetic event.
While this solution is a single sensor connected to the Internet via a proprietary application, it is an excellent example of a medical IoT device that can enhance the lives of not only the patient but everyone who cares for them.
Combined with the programmable alerts, you and your loved ones can help manage the effects of diabetes. If you have a loved one who suffers with diabetes, a CGM is worth every penny for peace of mind alone. This is the true power of IoT materialized in a potentially life-saving solution.
Automotive IoT Solutions
Another personal IoT solution is the use of Internet-connected automotive features. One of the oldest products is called OnStar (www.onstar.com), which is available on most late-model and new General Motors (GM) vehicles. While OnStar predates the IoT evolution, it is a satellite-based service that has several levels and many fee-based options; it incorporates the Internet to permit communication with vehicle owners. Indeed, the newest GM vehicles come with a Wi-Fi access point built into the car! Better still, there are some basic features that are free to GM owners that, in my opinion, are very valuable.
The free, basic features include regular maintenance reports sent to you via email and the ability to use an app on your phone to remotely unlock, lock, and start the car—all the features on your key fob. This is a really cool feature if you have ever locked your keys in your car! Figure 1-5 shows an example of the remote key fob app on iOS. Of course, there are even more features available for a fee, including navigation, telephone, Wi-Fi, and on-call support.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig5_HTML.jpgFigure 1-5
OnStar app key fob feature
The OnStar app works by connecting to the OnStar services in the cloud, requesting the feature (e.g., unlock) that is sent to the vehicle via the OnStar satellite network. So, it is an excellent example of how IoT solutions use multiple communication protocols.
The feature I like most is the maintenance reports. You will receive an email with an overview of the maintenance status of your vehicle. The report includes such things as oil life, tire pressure, engine and transmission warnings, emissions, air bag, and more. Figure 1-6 shows an excerpt of a typical email that you receive.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig6_HTML.jpgFigure 1-6
OnStar maintenance report
Notice the information displayed. This is no mere indicator light. Actual data is transmitted to OnStar from your vehicle. For example, the odometer reading and tire pressure data is taken directly from the vehicle’s onboard data storage. Data from the sensors is read and interpreted, and the report is generated for you. This feature demonstrates how automatic compilation of data in an IoT solution can help us keep our vehicles in good mechanical condition with early warning of needed maintenance. This serves us best by helping us keep our vehicles in prime condition and thus in a state of high resell value.
I should note that GM is not the only automotive manufacturer offering such services. Many others are working on their own solutions, ranging from an OnStar-like feature set to solutions that focus on entertainment and connectivity.
Fleet Management
Another example of an IoT solution is a fleet management system .⁷ While developed and deployed well before the coining of the phrase Internet of Things, fleet management systems allow businesses to monitor their cars, trucks, and ships—just about any mobile unit—to not only track their current location but also to use the location data (GPS coordinates taken over time) to plan more efficient routes, thereby reducing the cost of shipment.
Fleet management systems are not just for routing. Indeed, fleet management systems also allow businesses to monitor each unit to conduct diagnostics. For example, it is possible to know the amount of fuel in each truck, when its last maintenance was performed—or more importantly, when the next maintenance is due—and much more. The combination of vehicle geographic tracking and diagnostics is called telematics. Figure 1-7 shows a drawing of a fleet management system.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig7_HTML.pngFigure 1-7
Fleet management example⁸
In Figure 1-7, you see the application of GPS systems to track location as well as satellite communication to transmit additional data, such as diagnostics, payload states, and more. All these ultimately traverse the Internet, and the data becomes accessible by the business analysts.
You may think fleet management systems are only for large shipping companies, but with the proliferation of GPS modules and even the microcontroller market, anyone can create a fleet management system. That is, they do not cost millions of dollars to develop.
For example, if you owned a bicycle delivery company, you could easily incorporate GPS modules with either cellular or wireless connectivity on each delivery person to track their location, average travel time, and more. More specifically, you can use such a solution to minimize delivery times by allowing packages to be handed off from one delivery person to another, rather than having them return to the depot each time they complete a set of deliveries.
CAMERA DRONES AND THE IOT
One possible use of the IoT is making data that drones generate available over the Internet. Some people feel that drones are an invasion of privacy. I agree in situations where they are misused, or established laws are violated. Fortunately, most drone owners obey local laws, regulations, and property owners’ wishes.⁹
However, there are many legitimate uses of drones, be they land, air, or sea based. For example, I can imagine home monitoring solutions where you can check on your home remotely by viewing data from fixed cameras as well as data from mobile drones. I for one would love to see a solution that allowed me to program a predetermined sentry flight path to monitor my properties with a flying camera drone.
While some vendors have Wi-Fi-enabled drones, there are not many consumer-grade options available that stream data in real time over the Internet. However, it is just a matter of time before we see solutions that include drones. Of course, the current controversy and the movement of the US government to register and track drones, along with increasing restrictions on their use, may limit the expansion of drones and IoT solutions that include drone-acquired data.
IoT and Security
The recent rash of massive data breaches proves that basic security simply is not good enough. We have seen everything from outright theft to exploitation of the data stolen from very well-known businesses, like popular brick-and-mortar retailers, convenience stores, and even some government agencies!
IoT solutions are not immune to security threats. Indeed, as IoT solutions become more and more integrated into our lives, so too will our personal data. Thus, security must be taken extremely seriously and built into the solution from the start.
This includes solutions that we develop ourselves. More specifically, if you design a weather station for your own use, you should take reasonable steps to ensure that the data is protected from both accidental and deliberate exploitation. You may think weather data is not a high risk, but consider the case where you include GPS coordinates for your sensors (a reasonable feature) so that people can see where this weather is being observed. If someone could see that information and determine the solution uses an Internet connection, it is possible they could gain physical access to the Internet device and possibly use it to further penetrate and exploit your systems. Thus, security is not just about the data; it should encompass all aspects of the solution—from data to software to hardware to physical access.
There are four areas where you may want to consider spending extra care ensuring that your IoT solution is protected with good security. As you will see, this includes several things you should consider for your existing infrastructure, computers, and even safe computing habits. By leveraging all these areas, you will be building a layered approach to security, often called a defense-in-depth method.
Security Begins at Home
Before introducing an IoT solution to your home network, you should consider taking precautions to ensure that the machines on your home network are protected. Some of the best practices for securing your home networking include the following:
Passwords: This may seem like a simple thing, but always make sure that you use passwords on all your computers and devices. Also, adopt good password habits, such as requiring longer strings, mixed case, numbers, and symbols to ensure that the passwords are not easily guessed.¹⁰
Secure your Wi-Fi: If you have a Wi-Fi network, make sure that you add a password and use the latest security protocols, such as WPA2, or even better the built-in secure setup features of some wireless routers.
Use a firewall: You should also use a firewall to block all unused ports (TCP or UDP). For example, lock down all ports except those your solution uses, such as port 80 for HTML.
Restrict physical access: Lock your doors! Just because your network has a great password and your computers use super world-espionage spy-encrypted biometric access, these things are meaningless if someone can gain access to your networking hardware directly. For IoT solutions, this means any external components should be installed in tamper-proof enclosures or locked away so that they cannot be discovered. This also includes any network wiring.
Secure Your Devices
As I mentioned, your IoT devices also need to be secured. The following are some practices to consider:
Use passwords: Always add passwords to the user accounts you use on your IoT devices. This includes making sure that you rename any default passwords. For example, you may be tempted to consider a wee Raspberry Pi or BeagleBone Black too small of a device to be a security concern, but if you consider that these devices run one of the most powerful operating systems available (forms of Linux), a Raspberry Pi can be a very powerful hacking tool.
Keep your software up to date: You should try to use the latest versions of any software that you use. This includes the operating system as well as any firmware that you may be running. Newer versions often have improved security or fewer security vulnerabilities.
If your software offers security features, use them: If you have servers or services running on your devices, and they offer features such as automatic lockout for missed passwords, turn them on. Not all software has these features, but if they are available, they can be a great way to defeat repeated attacks.
Use Encryption
This is one area that is often overlooked. You can further protect yourself and your data if you encrypt the data as it is stored and the communication mechanism as it is transmitted. If you encrypt your data, it cannot be easily deciphered, even if someone were to gain physical access to the storage device. Use the same care with your encryption keys and passcodes as you do your computer passwords.
Security Doesn’t End at the Cloud
There are many considerations for connecting IoT devices to cloud services. Indeed, Microsoft has made it very easy to use cloud services with your IoT solutions. However, there are two important considerations for security and your IoT data:
Do you need the cloud? The first thing you should consider is whether you need to put any of your data in the cloud. It is often the case that cloud services make it very easy to store and view your data, but is it really necessary to do so? For example, you may be eager to view logistical data for where your dog spends his time while you are at work, but who else would really care to view this data? In this case, storing the data in the cloud to make it available to everyone is not necessary.
Do not relax! Many people seem to let their guard down when working with cloud services. For whatever reason, they consider the cloud more secure. The fact is—it is not! In fact, you must apply the very same security best practices when working in the cloud that you do for your own network, computers, and security policies. Indeed, if anything, you need to be even more vigilant because cloud services are not in your control with respect to protecting against physical access (however remote and unlikely) nor are you guaranteed your data isn’t on the same devices as tens, hundreds, or even thousands of other users’ data.
Now that you have an idea of how you should include security in your projects, let’s look at how Windows 10 has evolved into a modern platform that supports not only the usual productivity and gaming tasks but also help us build IoT solutions.
Introducing Windows 10
Microsoft has not been idle in recent years. In fact, the latest release of the Windows operating system, Windows 10, has shown Microsoft listens to its customers and delivers features that people want. More than any release in the past, Windows 10 is both familiar and capable on desktop, laptop, and tablets. In fact, Windows 10 has become the most stable Windows release in history.
As a long-term platform-independent user, I have had my favorites over the years, but some versions of Windows have not been high on the list and at times not on the list at all. This was mostly due to the changing face of the PC from beige boxes¹¹ to personal, tactile, sensitive devices through the proliferation of tablets and other smart devices.
However, with the release of Windows 10 and their line of Surface computers (desktop, laptop, and tablet varieties), I consider my Surface computers a platform that I am very comfortable using and wouldn’t hesitate to use for almost any task. It just works the way a Windows 10 computer should. In fact, I used my Surface Laptop for all the examples in this book.
In case you are new to Windows 10, the following sections introduce a number of the newest features of Windows 10, including some familiar behavior that has been missing for some time, and some new things that make using Windows 10 across several platforms seamless. I have included this information for those that have yet to experience Windows 10 or those that have delayed upgrading. To use this book, you need a machine running Windows 10. If you have not upgraded yet, the following sections will be helpful.
However, if you are already using Windows 10 or have been for some time, you may want to skim this section so that you are familiar with the newest features. I have found that it is always helpful to read the impressions of others because I often discover features that I was not aware of or had yet to encounter. Plus, it gives me a greater depth of knowledge on the subject.
Overview of Windows 10 Features
This section explores the major advances and new features of Windows 10. If you are thinking about upgrading to Windows 10, this section should convince you to do so, because it covers what the latest Windows operating system has become. I cover the most important features related to developing IoT applications. Thus, this is not a complete list of the many features of the new version. For a complete list, see the Microsoft Windows 10 site (www.microsoft.com/en-us/windows/features).
The Return of the Desktop
One of the evolutions I found to be most unappealing was the shift from a desktop with a Start menu to that of a panel of small application interfaces. While I understand the reason for the evolution (the rise of the touch screen and tablets), I found the dual interface of Windows 8 confusing. It was as if the operating system had two heads: one for legacy
users, complete with an abbreviated Start menu, and another for new
touch-enabled applications (which seemed to only include the latest Office applications). Switching from one to another—particularly on a typical desktop without a touch screen—was awkward and often frustrating.
Fortunately, Windows 10 brings back the desktop concept with an all-new design that incorporates the best of the Windows 8 Start screen with a much improved Start menu. That is, we once again have the familiar menu, floating windows, tray, and more. Figure 1-8 shows a snapshot of the new desktop. Does this look familiar?
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig8_HTML.pngFigure 1-8
Windows 10 desktop
If you use a tablet or a machine that can switch from laptop to tablet (also called a 2-in-1), Windows allows you to use the new desktop when in desktop mode (a keyboard is attached) and the more tablet-friendly Start screen when in tablet mode (the keyboard is removed). Of course, you can configure this behavior to your liking.
Tip
You can access the power user menu by pressing Windows key + X.
After having used the new desktop for some time, I must say it just works the way a PC should. That may seem like false praise, but it is not. There are many things about Windows 10 that work like it should—as it should have in previous versions.
One feature of the desktop I welcome more than any other is the use of virtual desktops. The other platforms I use have had this feature for some time. Having it in Windows 10 allows me to use my PCs in a very familiar manner: by placing my most frequently used (and running) applications maximized in their own desktops.
To create a new virtual desktop, click the task view icon on the taskbar (see the red arrow in Figure 1-9). You will then see a pop-up pane that shows a thumbnail of all the virtual desktops that are active. To add a new virtual desktop, click the plus sign to the right. You can close a virtual desktop by clicking the X icon on the thumbnail. Figure 1-9 shows how to access the virtual desktop feature depicting an excerpt of a full screen snapshot. You may find using virtual desktops to be very helpful when developing applications or working on productivity applications alongside your mail and other communication applications.
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig9_HTML.pngFigure 1-9
Virtual desktops in Windows 10
The task view is also used in tablet mode. In fact, the virtual desktop is very similar to the tablet mode of the desktop. You can switch from one to the other by using the task view icon.
Compatibility
With so many changes and new features, it is reasonable to expect Windows 10 to have problems running older applications. However, Microsoft has worked very hard to make the new version run the older applications. In fact, I have several rather old (Windows XP era) applications that I have installed on Windows 10, and they all work well. There are a few things that you can do to adjust compatibility, but most applications should run unaltered and without jumping through menus to customize. Thus, if you are concerned about being able to run your older applications, you should not have to worry.
Notifications and Action Center
The Action Center is an interesting feature that allows application developers to display notices. The Action Center is accessed by a right edge swipe or by clicking the Action Center icon on the system tray.
When applications trigger a notification, the Action Center displays the notification briefly as a small fly-in dialog. I like this new feature, especially since the other platforms I have used have their own implementation. Not only is it convenient to know what is going on—such as getting new emails or receiving a bid on your auction—it is also a great way to take a look at the events of the day. Just swipe and view all your notifications in a list (see Figure 1-10).
../images/416714_2_En_1_Chapter/416714_2_En_1_Fig10_HTML.jpgFigure 1-10
Windows 10 Action Center
At the bottom of the Action Center are a few shortcut buttons for many common tasks, which put the action in Action Center. Here we find buttons for switching to tablet mode, brightness, Bluetooth, network connections, and more. The Action Center, coupled with the new desktop and Start menu, completes the user experience.
Fortunately, you can develop your IoT solutions to include notification to users. I encourage you to do so in your own Windows applications.
Windows 10 and the IoT
There are several versions of Windows 10—ranging from those that run on phones to those that run on desktop computers and laptop replacement tablets. Indeed, Microsoft Windows 10 runs on more devices than any previous version of Windows, but that is not the end of the Windows 10 proliferation. Windows 10 also comes in a version designed to run on low-cost computing hardware, such as single-board computers designed for integration with hardware and embedding in other solutions, which makes it an excellent choice for use in IoT solutions.
The Windows 10 version designed to run on low-cost computing boards is called the Windows 10 IoT Core. We use Windows 10 IoT Core in this book. The Windows 10 IoT Core is designed to run on smaller devices, such as the Raspberry Pi, MinnowBoard Max, and other small computing boards. It is optimized to run in smaller memory without the need for advanced processors or even a graphical user interface. Thus, it supports only console or background applications.
Windows 10 IoT Core supports the Universal Windows Platform (UWP), allowing you to create your applications and deploy them. As mentioned previously, we will use Visual Studio 2019 to build these applications. As you will see in Chapter 4, Visual Studio 2019 includes all the tools you need to build UWP applications for deployment to the Raspberry Pi. This includes APIs and drivers for accessing the general-purpose input/output (GPIO) pins, as well as interfaces such as I2C and SPI. Best of all, there are a host of example code that you can use for your own projects.
This really is an exciting element to Windows 10. Indeed, except for some rather limited exploration of Windows Embedded Compact (Windows CE), Windows 10 represents the first time that you can use the Windows 10 IoT Core to leverage the power of Windows on your smaller devices. You explore the Windows 10 IoT Core in greater detail in the next chapter.
Summary
The Internet of Things is an exciting new world for us all. Those of us young at heart but old enough to remember The Jetsons TV series recall seeing a taste of what is possible in the land of make believe. Talking toasters, flying cars that spring from briefcases, and robots with attitude notwithstanding, television fantasy of decades ago is now coming true. We have wristwatches that double as phones and video players. We can unlock our cars from around the world, find out if our dog has gone outside, and even answer the door from across the city. All of this is possible and working today with the advent of the IoT.
In this chapter, we discovered what the IoT is and saw some examples of well-known IoT solutions. We also discovered how Microsoft is opening doors for Windows users by expanding its Windows 10 operating system to the IoT via the Raspberry Pi and similar low-cost computing hardware. This is a very exciting opportunity for people who do not want to learn the nuances of a Linux-based operating system to explore the world of hardware and IoT from a familiar and well-understood platform.
In the next chapter, we will discover more about the Windows 10 IoT Core including what hardware it runs on and how to get started running Windows 10 on a Raspberry Pi. As you will see, it is not difficult. We will then explore the Raspberry Pi in more detail in Chapter 3 to complete our tour of getting started with Windows 10 IoT Core.
Footnotes
1
https://en.wikipedia.org/wiki/Internet_of_Things
2
For example, everything seems to be cloud-this, cloud-that when in reality nothing was changed.
3
Toasters and toaster ovens have appeared in the top 5 most dangerous appliances in the home. Scary.
4
However, given the COVID-19 stay-at-home orders in many places, this idea may have come back into practicality.
5
https://pixabay.com/en/network-iot-internet-of-things-782707/
6
Dexcom also provides a mobile version of Clarity for iOS or Android.
7
https://en.wikipedia.org/wiki/Fleet_management
8
Éric Chassaing—via CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/).
9
Drones are increasingly under scrutiny, and the rules change often. If you have a drone and operate in the United States, be sure to check the following website for the latest rules: https://registermyuas.faa.gov/.
10
You also need to balance complexity of passwords with your ability to remember them. If you have to write it down, you’ve just defeated your own security!
11
Yes, I was using PCs when IBM put the PC in personal computer. My first PC had an Intel 8088 processor running at 8MHz with a modest 512KB of memory. Most phones exceed these capabilities by orders of magnitude.
© Charles Bell 2021
C. BellWindows 10 for the Internet of Thingshttps://doi.org/10.1007/978-1-4842-6609-0_2
2. Introducing the Windows 10 IoT Core
Charles Bell¹
(1)
Warsaw, VA, USA
Windows 10 represents an exciting entry in the IoT arena, giving Windows users a native toolset to experiment with building IoT solutions. While some platforms such as the Arduino are very Windows-friendly, other platforms have forced users to learn about new, sometimes very different, operating systems or tools that are, in contrast to Visual Studio, very challenging to learn. In fact, I’ve heard of some people giving up altogether or not even trying because the operating system and tools seemed too intimidating.¹ All of these became roadblocks for those wanting a familiar and easy-to-use platform to develop IoT solutions.
Microsoft has risen to the occasion, creating a unique way to develop applications for and deploy solutions to hardware that traditionally has been off limits for many Windows users who did not want to learn a new operating system, such as Linux, which is the most popular choice for embedded hardware development. Regardless, I recommend you understand the basics of these other platforms. In fact, there is a short primer on the Raspberry Pi in the next chapter including a look at the base or preferred operating system. But don’t worry; you need not become a Linux expert to use Windows 10 with the Raspberry Pi.
In this chapter, you discover a version of Windows 10 called the Windows 10 IoT Core that runs on low-cost computers, such as the Raspberry Pi. You will discover the basic features of Windows 10, including how to prepare your PC and get started with the Windows 10 on your device. You will even see how to boot up the Raspberry Pi with Windows 10! Let’s start with what you will need to get started.
Things You Will Need
Working with Windows 10 IoT Core is easy, but you will need a few things to get started. First and foremost, you will need an IoT board that you can use to run Windows 10 IoT Core. You will also need to download the correct image for your IoT board from Microsoft, install it on the correct medium, then use that to boot your IoT board. Finally, to create IoT solutions, you will need to install and configure Visual Studio 2019 on your Windows 10 machine. This may sound like a lot, but most of the steps need only run once.
In this section, we will examine each of these topics and introduce the components you need, starting with Windows 10 IoT Core.
Windows 10 IoT Core
Windows IoT Core gives the ability for Windows users to leverage their experience and knowledge of developing applications for Windows on smaller devices. While Microsoft has offered several products designated as embedded
or compact
or embedded compact
in the past, which were scaled-down versions of the operating system, there were many differences and a few bridges that had to be crossed to use them. While highly touted, the offerings never really lived up to the write the code once and deploy everywhere
mantra. That is, until now.
WHAT MAKES IOT CORE SO SPECIAL?
Unlike the previous limited featured Windows products meant for smaller platforms, Windows 10 IoT Core shares many of the same components as the flagship operating system for PCs. That is, it has the same core components and kernel, and even some of the middleware is based on the same core code. In fact, the code generated can be binary compatible with the other platforms, which means you can write code that can