Споделяне чрез


Configure Wi-Fi in the field

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

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

BLE-based Wi-Fi setup - reference solution

The BLE-based Wi-Fi setup and device control reference solution demonstrates 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 allows devices to connect to Wi-Fi networks that don't broadcast their SSID, or are located in a crowded wireless network environment.

Important

Targeted scanning causes the device to transmit probe requests that may reveal the SSID of the network to other devices. This should only be used in controlled environments, or on networks where this an acceptable risk.

You can enable targeted scanning through the the CLI or an Applibs API. To enable targeted scanning through the CLI, run the az sphere device wifi add command with the  --targeted-scan parameter. An application can enable targeted scanning by calling the WifiConfig_SetTargetedScanEnabled function with the enabled parameter set to true.

Disable Wi-Fi

Your software application can enable or disable the Wi-Fi network interface using the Networking_SetInterfaceState function.

If your hardware doesn't require Wi-Fi, you can exclude RF front-end components from your hardware design. For more information see Disable Wi-Fi RF front end on MT3620.