Azure Sphere for Internet of Things

Well Rounded

Development Boards

Most of the sample code for newcomers relies on the Azure Sphere MT3620 Development Kit by Seeed Studio [6]. This development board comes with two integrated WLAN antennas and two connectors for external antennas. It also has two function keys, a reset button, several status LEDs, and a micro-USB port that provides power and an interface for programming and debugging (Figure 2).

Figure 2: The Grove Starter Kit extends the Azure Sphere MT3620 Development Kit without the need to solder.

The connections for peripheral devices are accessible by two rows of double pins, or headers. Together with the Grove Starter Kit from the same manufacturer, the development board forms a solid basis for first steps [7]. However, because of its layout, it is unfortunately not compatible with existing shields for Arduino systems.

Microsoft guides you through the commissioning process with easy-to-follow instructions [8]. You can choose whether to develop images for the device with the full-blown Visual Studio IDE or the versatile Visual Studio Code editor. If you opt for the IDE, the Community Edition is suitable, although Microsoft only offers it free of charge to students, genuine open source projects, and individual developers. In contrast, the Visual Studio Code editor, which I also used in the tests, is available free of charge for commercial projects and enterprises of any size.

Regardless of which development environment you prefer, the first step is to install the Azure Sphere Software Development Kit (SDK) with the

azsphere

command, which runs both on the classic command line and in PowerShell sessions [9]. Also, according to Microsoft's documentation, you need to install Visual Studio Code, followed by the additional CMake and Ninja packages before launching Visual Studio Code with the included extensions for Azure Sphere.

Connect your development board to the computer by USB. You can then communicate with the device with the azsphere command, which, thanks to the built-in license, entitles you to create a new customer account, or tenant, with Azure Sphere Security Service and to register the device. In the case of the development board in this example, however, I first had to reinstall (recover) the operating system because the version that came with the board was simply obsolete:

azsphere register-user --new-user <your mail address>
azsphere device recover
azsphere tenant create --name <your name>
azsphere tenant select --tenant <uid>
azsphere device claim

You are free to choose the name of your tenant, but be aware that the subsequent claim irreversibly connects the device to your tenant. Security is the top priority here. The MCU does not accept images outside of your tenant during a cloud deployment, which rules out hijacking by another tenant.

First Signals from the Cloud

Before you go any further, you need to enable the device to run code locally. Microsoft's learning path then takes you to the simplest imaginable example. Whereas budding programmers in almost any language first learn to output "Hello World," the equivalent in the field of microcontrollers is to make an LED flash on the device. Microsoft also provides some sample code; you need to compile the code in Visual Studio Code, copy it to the MCU over USB, and execute the code [10].

A cloud deployment, in comparison, is far more exciting because it lets the Azure Sphere cloud service play to its strengths. You create a "product" in the cloud as a management unit for a specific application [11]. You then assign one or more MCUs to the product, and – assuming the WiFi configuration is correct – it will retrieve images of your applications from the cloud with FOTA from then on. For this to happen, the Azure Sphere service automatically creates device groups for each product, including development, field test, and production, giving you the best possible support for the development process.

Conclusions

Although conventional approaches to development for IoT often, unfortunately, mean security falling by the wayside or being painstakingly retrofitted to the finished product, Microsoft has thought about protecting the entire platform right from the outset with Azure Sphere. Microsoft's approach of anchoring security in the hardware of the MCUs and linking it to a cloud service addresses professional use cases and ensures that you can focus entirely on your application logic. Azure Sphere takes care of the framework and provides the required infrastructure for a staged process from development to testing to production.

You can already find Azure Sphere-compatible hardware on the market and numerous code samples on GitHub. The only downside is the lack of compatibility with the Arduino ecosystem. This platform offers a large range of hardware and application examples, making it easier to get started, but it is less widespread in the professional environment outside of the maker scene.

The Author

Christian Knermann is Head of IT-Management at Fraunhofer UMSICHT, a German research institute. He's written freelance about computing technology since 2006.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus