How to Build Your Own Internet of Things Product from the ground up-Raspberry PI


Details
Introduction
In this session you will start with a pile of hardware and build a working, cloud-enabled device from the ground up.
Essential skills will be presented:
• Building the device from raw hardware
• Writing software for the Raspberry PI and the Cloud
• Mono and C# on the device
• Node.js in the cloud
http://photos3.meetupstatic.com/photos/event/d/5/7/c/600_381834652.jpeg
The Gold Rush is here
Machine-to-machine (M2M) computing and Internet of Things (IoT) is fast becoming a technology that all developers and architects need to embrace. Numerous studies suggest a coming world of tens of billions of devices (a half-dozen for every human on earth) by 2020 (bit.ly/M2qBII). One reason this is happening is because it has never been easier for garage tinkerers and hobbyists to prototype a consumer or commercial device for later manufacture and sale. Getting started with both the hardware and software is incredibly inexpensive. For less than $100, you can order an Arduino or a Raspberry PI.
Understanding the Cloud
These devices rarely have value unless they’re connected to something else, perhaps a cloud back end that receives data and sends commands. But connecting to, communicating with and managing these devices from an application running in the cloud presents some special challenges. The sheer number of devices, as well as their limited battery life and bandwidth, forces companies developer to carefully consider all options.
In this session we will review the landscape and take a close look on the role of cloud computing with respect to the world of M2M and IoT. We will address key issues, such as bandwidth and security. We will debunk the myth that IPv6 and virtual private networks (VPNs) are simple, efficient, and secure, and will propose some specific recommendations for using the Cloud to solve these challenges. We will look at some specific examples using the Arduino and the Raspberry PI.
The building of a working product - Soup to Nuts
We will also present “SmartDoor,” where we really roll up our sleeves, both from a hardware and software point of view and learn what it takes to truly embrace this new computing paradigm. SmartDoor and is the reference IoT product we will build from the ground up, making it possible for any one to start embracing the Internet of Things.
Soldering a doorbell to the device
If you look closely, you will see a doorbell and a camera on top of a PI device. The idea is that someone arrives on your doorstep and rings your doorbell. Once the doorbell is pressed a photo is automatically taken. This photo is then forwarded to a mobile device as a push notification message with a hyperlink to the image taken of the person at your doorstep. This invention was inspired by the need to know who is ringing your doorbell, even if you’re not home.
What we will build
We will begin by illustrating exactly how to purchase and put together the raw hardware. But software rules the world, and that’s where a bulk of the presentation will focus. Once the hardware is built, we will build software that runs on the device itself, as well as software that runs in the cloud. The code will need to be able to take a picture and upload it to the cloud. From there, a push notification will need to be sent to the appropriate mobile device(s), indicating that someone has pressed the doorbell, and that the photo is available. Because of the ambitious nature of this project we will provide a number of blog posts to support the work and provide the needed details.
Mono and C#
http://photos3.meetupstatic.com/photos/event/d/a/f/e/600_381836062.jpeg
On the Raspberry PI we will install and run Mono, which is a free and open source project led by Xamarin (formerly by Novell) that provides a .NET Framework-compatible set of tools including, among others, a C# compiler and a Common Language Runtime. The beauty of Mono is that it allows us to write .Net code compiled on Windows and run it unchanged on the Raspberry PI. In our case, we will take a photo and upload it to Windows Azure storage. We will expand the code base further, supporting the ability to send a push notifications to a Windows Phone.
Node.js running in the cloud
In the cloud we will work with Node.js, which will enable the PI to send photos directly to cloud storage.
The Raw Hardware
Getting the hardware together is really straightforward because almost all of it is available in a single Raspberry PI kit. This kit is called Canakit and can be found at http://www.canakit.com/. The kit contains a few really useful things to get to get our IoT device built, including a system Board, A/C Adapter, GPIO Breakout, Bread Board, Bread Board wires, assorted resisters and LEDs. You will also need an external monitor, keyboard and mouse so you can configure and test the Raspberry PI. In addition to the Canakit, you will need two more things – a regular doorbell and a Raspberry PI compatible camera, both of which are easily purchased.
http://photos1.meetupstatic.com/photos/event/d/6/3/a/600_381834842.jpeg
More to come...
Bruno Terkaly
Bruno is a Principal Software Engineer at Microsoft with the objective to enable the development of industry leading applications and services across devices. He is responsible for driving the top cloud and mobile opportunities across the United States and beyond from a technology enablement perspective. He helps partners bring their applications to market by providing architectural guidance and deep technical engagement during the ISV’s evaluation, development, and deployment. In addition, Bruno works closely with the cloud and mobile engineering groups, providing feedback and influencing the roadmap.
Steven Edouard
Steven Edouard is a Developer Evangelist and full-time hacker at Microsoft. Before moving to the bay he worked on the.NET runtime team as a Software Test Engineer delivering products like .NET 4.5 and .NET Native Compilation. Now his passion resides in exciting people on the limitless potentials of cloud computing services through engaging technical demonstrations, online content and presentations.
More Info
By 2020 nearly every human on earth will be connected to about six devices. It has never been more economical or easy for the average person to prototype and produce a consumer or commercial device manufacture and sale. For less than $100, devices like the Arduino or Raspberry Pi provides you a microcontroller fitted with a small CPU, memory, and storage. Moreover, there is a plethora of expansion boards that plug into these devices, such as motor controls, GPS, Ethernet, LCD displays, sensors, actuators and more. These tiny devices come equipped with either a proprietary operating system or GNU/Linux with up to 512MB or RAM.
But these devices rarely have value unless they are connected to a cloud service on the backend. The cloud provides many useful services, including data analysis, issuing commands to control the device, security, provisioning, and management.
This talk will focus on the key considerations that companies, entrepreneurs, and individuals will face when creating and supporting these devices at scale.
Device Spectrum
At the low end of the spectrum is the Arduino. The higher-end devices include the raspberry pi. A myriad of expansion boards can be attached to the small microcontrollers.
What other capabilities with respect to CPU, memory, and storage?
What expansion boards are available and what purpose do they serve?
Device Software
A variety of operating systems are supported on these devices. Programming tools and compilers make it possible to create custom software that run on these devices.
What are the capabilities of these operating systems in terms of storage, memory, processing speed, and networking?
What type of programming tools are available?
What programming languages are supported in the device itself?
Cloud Backend
The cloud provides many useful services for these devices in a connected world.
What role does the cloud play with respect to security?
Which networking connectivity solutions that should be considered for device-to-cloud communication?
How does the cloud help alleviate bandwidth challenges and minimize power consumption on the device?
What are the four patterns for device to cloud service message communication?
Choosing a device
Selecting CPU, memory, and storage
At the low end of the spectrum is the Arduino with only 4K of memory. The raspberry pie represents the higher end of the spectrum, running a full-blown version of Linux.
Expanding device capabilities
The ability to expand your device capabilities is astounding. You can connect everything from motor controls to infrared remote control, GPS, wireless networking, home automation to sensor and beyond.
Even if you limit yourself to look in all sensors, there is remarkable variety: Acoustic, sound, vibration, Automotive, transportation, Chemical, Electric current, electric potential, magnetic, radio, Environment, weather, moisture, humidity, Flow, fluid velocity, Ionizing radiation, subatomic particles, Navigation instruments, Position, angle, displacement, distance, speed, acceleration, Optical, light, imaging, photon, Pressure, Force, density, level, Thermal, heat, temperature, Proximity, presence
Writing software for your device
Most of these devices come pre-equipped with some type of operating system, and support for programming tools. Many of these devices are even capable of running a Web server or supporting an external display that can provide a user interface for interaction
Programming tools, compilers and languages
Software developers work with code editors and compilers to create executables that run on the device. This presentation will provide an overview about what’s available and what makes sense given specific use case scenarios. Practically all popular languages are supported on these devices. It is even possible to write code with C# on top of Mono running on Linux, for example.
Client connectivity to the cloud
How a client device connects it to the cloud is important. Choosing an efficient communication protocol, including both networking and messaging is critical, as it affects performance, power consumption, and security.
Microsoft Azure – an ideal cloud back-end for IoT devices
Special consideration must be given to the cloud backend. Microsoft Azure is ideally suited because of its support for the Service Bus, which provides a hosted, secure, and widely available infrastructure for widespread communication, large-scale event distribution, naming, and service publishing.
Addressability and network connectivity
Virtual private networks fail miserably in providing a simple, efficient, and secure way to connect a client device to the cloud. Many of these devices are not under direct physical control, so making them part of a virtual network dramatically compromises security.
Typical HTTP request response architectures drains battery life on devices. Moreover, the payload associated with the request/response payload is unnecessarily huge and can be ridiculously wasteful.
Finally, most, if not all of these devices sit behind a network address translation layer, posing a big problem for addressability and connectivity. The Microsoft Azure Service Bus greatly simplifies connectivity acting as a relay service, and serving as a proxy for the cloud backend.
Scalabilty, Storage, Big Data, Web Services
One of the most important aspects of the cloud is its ability to scale on demand. The amount of devices put into production is generally unknown in the beginning and can change dramatically throughout the lifecycle of the devices in the field. Having the capability to scale as needed, whether scaling up or scaling down, is critical.
The amount of data that devices can generate staggering. Having a storage infrastructure that provides the necessary security, scale, and support for various data formats is mandatory. Microsoft Azure supports traditional blobs, key-value, column family, graph, relational, and document stores.
The ability to analyze this data is also critically important. Support for Hadoop, reporting and data analytics is an essential part of the cloud backend. I signing probability to predictions, as well as finding patterns is an important part of the infrastructure needed to support these data producing devices.
The cloud backend also needs to support a variety of operating systems, languages and open-source software. Microsoft Azure supports everything from Python to C#, Node.js, C/C++, as well as a variety of functional languages typically used in machine learning scenarios.
Conclusion
This abstracts reflects the content that will be presented during our talk. It provides a comprehensive deep dive into the challenges and solutions for individuals and companies looking to enter the brave new world of Machine to Machine computing or the Internet of Things. The discussion will address the needs of the executive decision-makers, architects, software developers, and hardware enthusiasts. Real-life examples will be brought into the discussion as well as concrete recommendations and examples.

How to Build Your Own Internet of Things Product from the ground up-Raspberry PI