Basic Network Verify Example

Verify a ZentriOS device can connect to a specific Wi-Fi Network.

API Features Demonstrated

Platforms

This app works on:

Requirements and Prerequisites

This app requires a ZentriOS device.

Description

In the definitions at the top of the network_verify.c source, specify the Wi-Fi network name (SSID) and password, or a precalculated pre-shared key (PSK). Pre-calculating the PSK speeds up the zn_network_verify step. To pre-calculate the key, see jorisvr.nl/wpapsk.html

The app scans for the specified network with a call to zn_network_scan, then verifies that the supplied password is correct with a call to zn_network_verify.

A success or failure message is logged to the ZentriOS terminal console. Output is similar to the following:

> Network verify app starting ...
Scanning for: Zentri ...
Found!
Verifying PSK for: Zentri ...
Password Valid!

This app exits and reboots after the validation step.

Source

See: