Table of contents
1.
Introduction
2.
Networking connectivity overview
3.
Steps to connect Azure Sphere to Wi-Fi
3.1.
Wi-Fi configuration using the CLI
3.2.
Wi-Fi configuration using Applibs
4.
Configure Wi-Fi in the field
4.1.
BLE-based Wi-Fi setup - reference solution
4.2.
Enable targeted scanning
4.3.
Disable Wi-Fi
5.
Frequently Asked Questions
5.1.
What is Azure?
5.2.
What is the Azure sphere used for?
5.3.
Where can we use Microsoft Azure?
5.4.
What do you understand by cloud computing?
5.5.
What are Azure communication services?
6.
Conclusion
Last Updated: Mar 27, 2024

Connectivity overview in Azure Sphere

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Microsoft Azure, previously called Windows Azure, is a public cloud computing platform provided by Microsoft. It delivers various cloud services, including analytics, computing, storage, and networking. Users can pick from these services to scale and develop new applications or run existing applications in the public cloud. It offers tools that support almost every industry, such as e-commerce and finance, and is even compatible with many open-source technologies.

Networking connectivity overview

Azure Sphere services and products from Microsoft allow vendors of Internet of things (IoT) devices to increase security by combining a specific system on a chip, Azure Sphere OS, and an Azure-based cloud environment for continuous monitoring.

Some of the characteristics of the Azure sphere in terms of connectivity are listed below such as:

  1. The Azure Sphere OS currently supports LAN network connectivity of two types: Ethernet and wifi. 2 pre-defined network interfaces are given to support these methods: eth0 for Ethernet and wlan0 for wifi.
     
  2. An Azure Sphere MT3620 device gives an 802.11 b/g/n wifi radio that operates at both 5GHz and 2.4GHz. OS services handle network authentication and the network firewall for all outbound traffic. Application libraries support networking.
     
  3. Azure Sphere OS and services communicate with Azure IoT Hub, devices, and other services using various ports, endpoints, and protocols.
     
  4. Azure Sphere devices depend on network connectivity to receive over-the-air OS and application updates.
     
  5. An Azure Sphere device needs an external Ethernet adapter to communicate over Ethernet.
     
  6. We can configure an Azure Sphere device to connect to the Internet with the help of a proxy server.
     
  7. Azure Sphere applications can deliver DHCP, SNTP, and other network services on the network for external (non-Azure Sphere) devices. 
     
  8. Azure Sphere supports the MQTT messaging protocol for communication and device provisioning with Azure IoT Hub and non-Azure hosts.  

Steps to connect Azure Sphere to Wi-Fi

You can configure an Azure Sphere device to connect to the Internet through 

  1. Wifi using the CLI 
  2. Azure Sphere SDK Application Libraries (Applibs)

Wi-Fi configuration using the CLI

  • To manage wifi configuration from the command line, use the azsphere device wifi CLI commands. For example, the device wifi add command adds the details of a wireless network to the device.
azsphere device wifi add --ssid "New SSID" --psk "key \'value\' with quotes"

 

  • The network interface (wlan0) must be active to use the configured wifi network. Use the device network list-interfaces command to determine if the interface is active.
azsphere device network list-interfaces

 

  • Use the device network enable command to activate it if necessary.
azsphere device network enable --interface wlan0

 

  • To enable the configured wifi network use the device wifi enable command.
azsphere device wifi enable --id <network id>

Wi-Fi configuration using Applibs

  • To configure wifi, your application must use the applibs wificonfig API. Include this header file in your application:
#include <applibs/wificonfig.h>

 

  • The application manifest must contain the WifiConfig capability.
"Capabilities": {
  "WifiConfig" : true
}

 

  • To check if the network interface is active, use the Networking_GetInterfaceConnectionStatus function.
Networking_GetInterfaceConnectionStatus("wlan0", &currentInterfaceStatus);

 

  • To activate the network interface, you can use the Networking SetInterfaceState function.
Networking_SetInterfaceState("wlan0", true);

 

  • To enable a configured Wi-Fi network from your application, you can use the WifiConfig_SetNetworkEnabled function.
WifiConfig_SetNetworkEnabled(<network id>, true);

Configure Wi-Fi in the field

Azure Sphere devices depend on network connectivity to receive over-the-air OS and application updates. During development, it's easy to configure wifi for a device connected to your PC. When you incorporate Azure Sphere into a manufactured product, however, your customers must be able to set up wifi at their location. 

One way to accomplish this is by providing a physical control panel through which the customer can configure their wifi connection, or you might provide a mobile app to connect to the Azure Sphere device and configure wifi connectivity via an additional Bluetooth Low Energy (BLE) chip. In either case, your Azure Sphere app will need to use the Azure Sphere wifi configuration API (wificonfig.h) to find available networks, then accept the user's network selection and wifi credentials.

BLE-based Wi-Fi setup - reference solution

The BLE-based Wi-Fi setup and device control reference solution demonstrate how to connect Azure Sphere over UART to a Nordic nRF52 BLE Development Kit. It also includes a sample Windows companion app that uses BLE to view and modify the Wi-Fi settings of the Azure Sphere device, and control attached device behavior.

Enable targeted scanning

Azure Sphere supports targeted scanning, which enables devices to connect to wifi networks that do not broadcast their SSID or are presently located in a crowded wireless network environment.

Disable Wi-Fi

Your software application has the power to enable or disable the wifi network interface using the Networking_SetInterfaceState function.

If your hardware doesn't require wifi, you can exclude RF front-end components from your hardware design. 

Frequently Asked Questions

What is Azure?

Microsoft Azure, also called Azure, is a cloud computing service operated by Microsoft for application management via Microsoft-managed data centers.

What is the Azure sphere used for?

The Azure Sphere Security Service is used to:

  1. Supports authentication, 
  2. Software updates
  3. Error reporting over secured cloud-to-device
  4. Device-to-cloud channels

Where can we use Microsoft Azure?

Azure is commonly used as a platform for hosting databases in the cloud.

In addition, the platform is frequently used for backup and disaster recovery. Microsoft offers serverless relational databases such as Azure SQL and non-relational databases such as NoSQL.

What do you understand by cloud computing?

It is the delivery of computing services—including databases, servers, storage, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer flexible resources, foster innovation, and economies of scale.

What are Azure communication services?

Azure Communication Services is a combination of video APIs, communication APIs, and SMS APIs for deploying your applications on any device, or any platform.

Conclusion

I hope this article gave you insights into the steps regarding connectivity in the Azure sphere.

Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, System Design, JavaScript, etc. Enroll in our courses, refer to the mock test and problems available, interview puzzles, and look at the interview bundle and interview experiences for placement preparations.

We hope this blog has helped you increase your knowledge regarding AWS Step functions, and if you liked this blog, check other links. Do upvote our blog to help other ninjas grow. Happy Coding!"

Live masterclass