Basic Web Setup Example

Connect a device to a Wi-Fi network using the web setup API.

API Features Demonstrated

Platforms

This app works on:

Requirements and Prerequisites

This app requires a ZentriOS device.

Description

Web setup is a popular method used for connecting devices to a wireless network. The ZentriOS web setup API zx_setup_start is used to start a softAP and web server.

Usage

When it starts, the web_setup app starts a SoftAP and displays this message on the ZentriOS terminal:

> Starting Web Setup App ...
Web setup running ...
Wi-Fi network: ZentriOS-#
     password: password
  HTTP URL(s): zentrios.com,www.zentrios.com,setup.com,www.setup.com

Join a computer or mobile device to the Soft AP network using the network name starting with ZentriOS- and ending with the last 3 digits from your ZentriOS device MAC address. There's probably only one network available with a name in this form.

Use the password password.

Then open a browser on the device, and navigate to one of the HTTP URLs listed, e.g zentrios.com.

The Zentri Web App opens and displays a list of available networks. Select one, then supply the password for that network. See Getting Started with the ZentriOS Web App.

The Web App verifies the network credentials and sets the wlan.ssid and wlan.passkey credentials accordingly.

Implementation

There are two main types of events that are possible when web setup is running, join/leave events and a web setup finished event.

When a WLAN client joins or leaves the softAP, a 'client event handler' runs. The handler provided in this app simply prints status information to the ZentriOS terminal.

When web setup completes, a 'finished handler' runs and again prints a status update.

Source

See: