Command API Quickstart

The fastest way to learn about the ZentriOS Command API is to use a desktop machine and a UART terminal application or a web browser over Wi-Fi.

To get your ZentriOS device onto a wireless network, you need to supply the device with network credentials: the wireless network name (SSID) and password. There are several ways to do this, including:

Let's get started!

Getting Started with the ZentriOS Web App

The ZentriOS Web App provides a simple way to configure the network credentials on the device using a web browser. This is particularly convenient for configuring Zentri evaluation boards, which can be put in setup web mode without connecting a ZentriOS terminal. See ZentriOS Web App, Setup Web Mode.

Getting Started with the ZentriOS Terminal

Before configuring your ZentriOS device, it may be helpful to ensure the device is in a known state by performing a factory_reset.

Opening a ZentriOS Terminal

You can control your ZentriOS device using the ZentriOS Command API via a UART serial terminal.

For a ZentriOS evaluation board, plug the computer USB port into the evaluation board micro USB port. USB provides power and UART serial connection.

For a device not on an evaluation board, connect the terminal to device UART 1 and provide power to the device. For pinout information, see Peripherals, GPIO Functions and Pins or the device datasheet.

With the device UART connected:

Ready
>
> version
ZentriOS-3.0.0.0, Built:2015-11-11 11:11:11 for AMW106.5, Board:AMWx06-E03.2

If problems arise, see the ZentriOS Troubleshooting Guide.

Configuring Wi-Fi Credentials on the Device

You need to provide the device with the name of your wireless network (SSID) and password. To do this, enter the following commands into a ZentriOS terminal:

ZentriOS Commands Description

set wlan.ssid     "YOUR AP NAME"
set wlan.passkey  "YOUR AP PASSWORD"

Name of your Access Point
Password for your Access Point

When you issue any ZentriOS command that requires network access, ZentriOS attempts to bring the network up using these properties.

Zentri evaluation boards have a network indicator LED to help determine successful association. Enter the network_up command (nup). The network indicator LED changes its blink rate from fast (no IP address), to medium (DHCP in progress) to slow (DHCP successful, IP address obtained).

To ensure that variables like the AP name and password persist after a reboot, use the save command:

save

Verifying the Internet Connection

To demonstrate that the device is connecting to the Internet, try downloading a web page:

ZentriOS Commands Description

http_get     http://google.com
stream_read  0 1000

<- Google web address
<- Read 1000-bytes of the web page

ZentriOS Applications

Now that you have established control over your ZentriOS device, you can experiment with the rich set of ZentriOS features using the ZentriOS Command API. There are many application notes demonstrating ZentriOS networking applications. See Application Examples.

Getting Help

As well as the ZentriOS documentation provided on this website, ZentriOS also provides interactive command line help:

Help options for the ZentriOS Command API ...
  help all        -> Print a list of all Commands and Variables
  help commands   -> Print a list of Commands
  help variables  -> Print a list of readable Variables
  help <command>  -> Print help for a specific Command
  help <variable> -> Print help for a specific Variable

Additional help is available online at http://docs.zentri.com