Wi-Fi Remote Terminal

This example demonstrates how to setup ZentriOS to enable remote access to your module or evaluation board using telnet via the Wi-Fi interface. The example shows how to use a Wi-Fi remote terminal, either via the softAP interface, or via the Wi-Fi client interface.

Once your evaluation board and ZentriOS is configured to enable the Remote Terminal feature, there is no longer any need to use a serial connection to control the board. The board can instead be controlled directly by Connecting the Remote Terminal.

Features demonstrated

Soft AP Remote Terminal

Set Up

The example is based on a Zentri Mackerel board, but the process is generic for any Zentri evaluation board with a serial interface and a ZentriOS device.

Connect a computer to the evaluation board USB connector. Use your terminal program to make a serial connection to the board (see Getting Started).

View the Default State of the Soft AP and Remote Terminal Variables

This step is for information only. It is NOT necessary to list the variables before you change them.

In the serial terminal console use the get softap and get remote_terminal command to display the current state of the softap and remote_terminal variables. In the default state the variables are as shown below:

> get softap
softap.auto_start: 0
softap.channel: 0
softap.dhcp_server.enabled: 1
softap.dns_server.enabled: 1
softap.idle_timeout: 7
softap.static.ip: 10.10.10.1
softap.passkey:
softap.rate.protocol: auto
softap.rate.transmit: auto
softap.ssid: ZentriOS-#
softap.dns_server.url: zentrios,zentrios.com,www.zentrios.com
> get remote_terminal
remote_terminal.enabled: 0
remote_terminal.interface: default
remote_terminal.password:
remote_terminal.port: 2000
remote_terminal.timeout: 60

If the variables do not display as shown, you may wish to perform a factory reset to return them to the default state (see Factory Reset).

Change the Soft AP and Remote Terminal Variables

Setting up the soft Access Point (softap) and remote terminal, from the default state, requires just a few commands:

ZentriOS Commands Description

set softap.auto_start 1
set remote_terminal.enabled 1
set remote_terminal.interface softap

save

reboot

 <- Start softap automatically on boot
 <- Enable the remote terminal
 <- Set the remote terminal to interface
    via the soft AP
 <- Save the state of the
    ZentriOS variables to flash memory
 <- Reboot the device

You can reboot the board using the reboot command, by pressing the reset button, or by power cycling.

After reboot, ZentriOS displays a message similar to the following:

> IPv4 address: 10.10.10.1
SoftAP 'ZentriOS-098' started
Remote terminal listening on port: 2000
[Ready]

View the Changed State of the Soft AP and Remote Terminal Variables

This step is for information only. It is NOT necessary to list the variables after you change them.

After reboot, in the serial terminal, check the state of all softap and remote_terminal variables.

> get softap
softap.auto_start: 1
softap.channel: 1
softap.dhcp_server.enabled: 1
softap.dns_server.enabled: 1
softap.idle_timeout: 7
softap.static.ip: 10.10.10.1
softap.passkey:
softap.rate.protocol: auto
softap.rate.transmit: auto
softap.ssid: ZentriOS-#
softap.dns_server.url: ZentriOS,ZentriOS.com,www.ZentriOS.com
> get remote_terminal
remote_terminal.enabled: 1
remote_terminal.interface: softap
remote_terminal.password:
remote_terminal.port: 2000
remote_terminal.timeout: 60

Connecting the Remote Terminal to the Soft AP

On the computer running the remote terminal, connect to the Soft AP. The softap SSID is determined by the softap.ssid variable. The default value of ZentriOS-# means ZentriOS-, followed by the last 3 digits of the device WLAN MAC address, e.g. ZentriOS-098. The passkey is determined by the softap.passkey variable. The default is empty i.e. no passkey.

In your communication terminal program (e.g. Teraterm) create a new TCP/IP telnet connection with the Host determined by the softap.static.ip or softap.dns_server.url and the Port determined by remote_terminal.port:

PropertyZentriOS variableDefault Value
Host:softap.static.ip
softap.dns_server.url
10.10.10.1
zentrios,zentrios.com,www.zentrios.com
TCP port:remote_terminal.port2000

The terminal program should now complete the telnet connection to the eval board.

Note that the softap runs a DNS server by default. Softap urls are determined by the variable softap.dns_server.url. For example, you can connect the remote terminal to zentrios.com:2000, or set a softap.dns_server.url and remote_terminal.port as desired.

Before typing commands, ensure that local echo is turned on. For example, in Teraterm, select the checkbox in the menu Setup | Terminal | Local echo.

The remote terminal provides full access to all ZentriOS commands, exactly as if you were connected via a serial interface.

When a telnet client is connected to the remote terminal via Wi-Fi, the serial interface is disabled.

If required, and to add security, a remote terminal password can be added by configuring the remote_terminal.password variable.

WLAN Remote Terminal

Using a remote terminal via the WLAN interface is similar to the Soft AP example shown above. The difference is that we connect the module to the WLAN and set the remote terminal to use the WLAN interface.

Setup

For remote terminal control via Wi-Fi, set up the ZentriOS device to connect to your WLAN, and enable the remote terminal.

In this example we also set up mDNS, so we can connect to a known name without determining the module IP address.

ZentriOS CommandsDescription

set wl s <MY_SSID>
set wl p <MY_PASSWORD>
set wlan.auto_join.enabled 1
set remote_terminal.enabled 1
set remote_terminal.interface wlan
set mdns.enabled 1
set mdns.name mymodule
save
reboot

Substitute your WLAN SSID here
Substitute your WLAN password here
Join WLAN on restart
Enable remote terminal
Remote terminal listens on WLAN interface
Set up an mDNS address
This allows connecting without knowing the IP
Save
Reboot

The ZentriOS device restarts and displays output similar to:

[2015-04-21 | 01:08:15: Disassociated]
ZentriOS-beta-2.3.0.0, Built:2015-04-15 10:45:20 for AMW004.3, Board:AMW004-E03.3
[Ready]
[Associating to Zentri]
> Obtaining IPv4 address via DHCP
IPv4 address: 10.5.6.108
Starting mDNS
mDNS domain: mymodule.local
Remote terminal listening on port: 2000

Connecting the Remote Terminal to the WLAN

On the computer running the remote terminal, connect to the WLAN.

In your communication terminal program (e.g. Teraterm) create a new TCP/IP telnet connection with the Host determined by the ZentriOS device's wlan.network.ip or the module's mdns.name, and the Port determined by remote_terminal.port (2000 by default):

PropertyZentriOS VariableValue in this Example
Host:wlan.network.ip
mdns.name
10.5.6.108
mymodule
TCP port:remote_terminal.port2000

Supporting ZentriOS Editions and Versions

Change Log

ModifiedChanges
2014-Oct-20Created
2015-Apr-21Added WLAN Remote Terminal section