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

Requires a Gecko OS evaluation board, such as a WGM160P_eval.

Other Gecko OS hardware can also be used by changing the source of the logged data to suit your device.

Description

Web setup is a popular method used for connecting devices to a wireless network. The Gecko OS web setup API gos_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 Gecko OS terminal:

> Starting Web Setup App ...
Web setup running ...
Wi-Fi network: Gecko OS-#
     password: password
  HTTP URL(s): gecko-os.com,www.gecko-os.com,setup.com,www.setup.com

Join a computer or mobile device to the Soft AP network using the network name starting with Gecko OS- and ending with the last 3 digits from your Gecko OS 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 gecko-os.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 Gecko OS 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 Gecko OS terminal.

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

Source

See: