Difference between revisions of "XPicoWiFi/DeveloperGuide"

From Lantronix Wiki!
Jump to navigation Jump to search
 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
 +
 +
The xPico Wi-Fi is a fully integrated Wi-Fi module with TCP/IP stack and Lantronix SmartSuite applications that make deployment of secure, reliable products much easier.
 +
 +
At the heart of the Lantronix SmartSuite is a fully-featured Configuration Manager which saves all module configuration to Flash. This means that once the module is configured, there is no initialization process that is needed to run externally as the module loads the configuration from flash each time it boots.
 +
 +
The software splits the network applications from the applications that run on the serial port, so that they don't depend on each other. For example, the SNTP client can run regardless of what runs on the serial port, so that many different information consumers on the device (web server, serial port, etc) know what the internet time is.
 +
 +
== Configuration Manager ==
 +
 +
=== Overview ===
 +
The xPico Wi-Fi includes a fully-featured Configuration Manager which saves configuration to Flash. This means that once the device is configured, there is no init process needed each time it boots, as it loads configuration from flash each time. There are different ways to change configuration when needed:
 +
 +
=== Accessing configuration ===
 +
==== Web browser ====
 +
The xPico Wi-Fi has a built-in web server that by default serves the configuration manager GUI. The user can log in with their browser and change configuration. This can be accessed either from the SoftAP interface or the Infrastructure interface.
 +
 +
==== Serial Port ====
 +
From the Command Line Interface (CLI), you can either send XML, or traverse the menus of the CLI. The menu structure and definition is starting on page 106 of the [http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide].
 +
 +
There are different ways to enter the command line, depending on how the serial port is configured:
 +
* From Modem Emulation: while in command mode, send ATD0\r to enter the CLI
 +
* From Mux: while not sending/receiving data, send C\r to enter the CLI
 +
 +
Another option is to have a serial port always configured to be Command Line to provide out of band management of the module.
 +
 +
See the [[XPicoWiFi/CommandLineStatusExample|Command Line Status example]] to see how to use the CLI to access the XML Status Register (XSR) from the xPico Wi-Fi to get various system status.
 +
 +
==== WebAPI ====
 +
From the network using WebAPI: With a simple HTTP request, you can change configuration by sending XML-formatted changes. See Chapter 5 of the [http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide].
 +
 +
The WebAPI has HTTP functions to import or export configuration, as well as to export current status of the device.
 +
 +
=== XML ===
 +
You can use XML to import or export configuration from the Configuration Manager, which makes it easy to replicate the configuration of one device to the next. See Chapter 3 of the [http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide] for more details on the XML format.
  
 
== Connecting xPico Wi-Fi to a microcontroller ==
 
== Connecting xPico Wi-Fi to a microcontroller ==
Line 12: Line 46:
 
==== Hardware ====
 
==== Hardware ====
 
Both UART interfaces (referred as Line 1 and Line 2) can have baud rates up to 921kbps, and only require the TX and RX pins connected to a microcontroller to work. In addition, Line 1 can also use RTS and CTS lines for hardware flow control. Both lines can use XON/XOFF software flow control.
 
Both UART interfaces (referred as Line 1 and Line 2) can have baud rates up to 921kbps, and only require the TX and RX pins connected to a microcontroller to work. In addition, Line 1 can also use RTS and CTS lines for hardware flow control. Both lines can use XON/XOFF software flow control.
 +
 +
==== Configuration ====
 +
See the [[XPicoWiFi/SerialPortSetup|Serial Port configuration page]] for details on how the UART can be configured.
  
 
=== SPI interface ===
 
=== SPI interface ===
Line 17: Line 54:
  
 
=== USB interface ===
 
=== USB interface ===
The USB interface is a full speed (12 mbps) Device interface. It will be enabled in future firmware.
+
The USB interface is a full speed (12 mbps) Device interface. Please contact your Lantronix Field Applications Engineer for Alpha firmware to enable this functionality.
 
 
 
 
== Serial port communication/protocol ==
 
As part of the Lantronix SmartSuite of serial port applications, the xPico Wi-Fi offers multiple applications that can run on the serial ports.
 
* Tunnel
 
* Modem Emulation (AT Commands)
 
* Monitor (scripting engine)
 
* Mux (serial API)
 
* Command Line Interface
 
 
 
You can choose a combination of these applications to run on each Line. Which application runs will depend on your microcontroller and the application.
 
 
 
Please see the xPico Wi-Fi [http://www.lantronix.com/pdf/xPico-Wi-Fi_UG.pdf User Guide] for details on how all of these applications work. The sections below will give you an overview of each application and how they could be used in your application.
 
 
 
=== Tunnel ===
 
Configure all the connection details before deploying your device.
 
 
 
[[File:TunnelBlock.jpg]]
 
 
 
* Setup the server to send data to or listen for incoming connections
 
* Data is transparently tunneled to/from the serial port to the TCP port at the other end
 
* Configurable for:
 
** Start/End characters
 
** Automatically reconnect
 
** Timeout disconnect
 
** Packing/flushing
 
* xPico Wi-Fi manages all networking
 
 
 
 
 
=== Modem Emulation (AT Commands) ===
 
Control the network connection at run-time.
 
 
 
[[File:ATBlock.png]]
 
 
 
* Easy to use, familiar AT commands
 
* Device controls where the connection is made
 
* xPico Wi-Fi manages all networking
 
* Can also listen for connections with ATA command
 
 
 
  
=== Monitor ===
+
See the [[XPicoWiFi/Usb|USB Guide]].
Connect directly to sensors, display on local web server
 
  
[[File:Monitorblock.png]]
+
== Manufacturing your product with xPico Wi-Fi ==
 +
=== Hardware Integration ===
  
* xPico Wi-Fi will query sensors
+
If you will be using the surface mount version of the xPico Wi-Fi, please follow the instructions in the [http://www.lantronix.com/pdf/xPico-Wi-Fi-SMT_IG.pdf SMT Integration Guide]. Otherwise, if you will be using the connector version, please follow the instructions in the [http://www.lantronix.com/pdf/xPico_IG.pdf xPico Integration Guide]
** Periodically (poll)
 
** On request by Web Browser (control)
 
* Programmable filtering and parsing of returned data
 
* Filtered data stored in on-module RAM
 
* Can access data via Javascript/AJAX from browser
 
  
=== Mux ===
+
=== Configuration ===
Manage multiple connections from one serial port
 
  
[[File:MuxBlock.png]]
+
Your product will probably have settings on the xPico Wi-Fi that are different from the factory defaults. At a minimum, you will want to change some configuration parameter. If using the built-in Web Server for custom web pages, you will also want to upload the HTML pages to the xPico Wi-Fi's filesystem.
  
* xPico Wi-Fi still manages all networking, including web server, TCP sockets, etc.
+
There are multiple ways that this can be achieved. If you have an attached microcontroller, the MCU can configure the xPico Wi-Fi at run-time via the serial port. However, if you want to simplify your MCU's code to just handle data communication and not have to do the one-time configuration of the xPico Wi-Fi, you can configure it at manufacturing.
* Microcontroller can switch, with a simple API:
 
** Sending/receiving data to server
 
** Listening on a TCP port
 
** Get data to/from the webserver at a specific URL
 
* Up to 4 concurrent connections
 
* Data is streamed directly to/from network connection to serial port, no limits because of RAM space
 
  
See the [[XPicoWiFi/Mux|Mux development page]] for more details and examples on how to use the Mux application.
+
Please see the [[XPicoWiFi/ManufacturingConfiguration|Configuring in Manufacturing]] page for more details on how you can do that.

Latest revision as of 12:36, 5 May 2015

Overview

The xPico Wi-Fi is a fully integrated Wi-Fi module with TCP/IP stack and Lantronix SmartSuite applications that make deployment of secure, reliable products much easier.

At the heart of the Lantronix SmartSuite is a fully-featured Configuration Manager which saves all module configuration to Flash. This means that once the module is configured, there is no initialization process that is needed to run externally as the module loads the configuration from flash each time it boots.

The software splits the network applications from the applications that run on the serial port, so that they don't depend on each other. For example, the SNTP client can run regardless of what runs on the serial port, so that many different information consumers on the device (web server, serial port, etc) know what the internet time is.

Configuration Manager

Overview

The xPico Wi-Fi includes a fully-featured Configuration Manager which saves configuration to Flash. This means that once the device is configured, there is no init process needed each time it boots, as it loads configuration from flash each time. There are different ways to change configuration when needed:

Accessing configuration

Web browser

The xPico Wi-Fi has a built-in web server that by default serves the configuration manager GUI. The user can log in with their browser and change configuration. This can be accessed either from the SoftAP interface or the Infrastructure interface.

Serial Port

From the Command Line Interface (CLI), you can either send XML, or traverse the menus of the CLI. The menu structure and definition is starting on page 106 of the User Guide.

There are different ways to enter the command line, depending on how the serial port is configured:

  • From Modem Emulation: while in command mode, send ATD0\r to enter the CLI
  • From Mux: while not sending/receiving data, send C\r to enter the CLI

Another option is to have a serial port always configured to be Command Line to provide out of band management of the module.

See the Command Line Status example to see how to use the CLI to access the XML Status Register (XSR) from the xPico Wi-Fi to get various system status.

WebAPI

From the network using WebAPI: With a simple HTTP request, you can change configuration by sending XML-formatted changes. See Chapter 5 of the User Guide.

The WebAPI has HTTP functions to import or export configuration, as well as to export current status of the device.

XML

You can use XML to import or export configuration from the Configuration Manager, which makes it easy to replicate the configuration of one device to the next. See Chapter 3 of the User Guide for more details on the XML format.

Connecting xPico Wi-Fi to a microcontroller

The xPico Wi-Fi has four serial interfaces that you can use to connect to your microcontroller:

  • 2 UART interfaces
  • 1 SPI Master interface
  • 1 USB Device full speed interface

The UART interface is the simplest to implement, as it requires no driver or special protocol.

UART interfaces

Hardware

Both UART interfaces (referred as Line 1 and Line 2) can have baud rates up to 921kbps, and only require the TX and RX pins connected to a microcontroller to work. In addition, Line 1 can also use RTS and CTS lines for hardware flow control. Both lines can use XON/XOFF software flow control.

Configuration

See the Serial Port configuration page for details on how the UART can be configured.

SPI interface

The SPI interface is a Master interface, which can be controlled with the Lantronix SmartSuite Monitor application.

USB interface

The USB interface is a full speed (12 mbps) Device interface. Please contact your Lantronix Field Applications Engineer for Alpha firmware to enable this functionality.

See the USB Guide.

Manufacturing your product with xPico Wi-Fi

Hardware Integration

If you will be using the surface mount version of the xPico Wi-Fi, please follow the instructions in the SMT Integration Guide. Otherwise, if you will be using the connector version, please follow the instructions in the xPico Integration Guide

Configuration

Your product will probably have settings on the xPico Wi-Fi that are different from the factory defaults. At a minimum, you will want to change some configuration parameter. If using the built-in Web Server for custom web pages, you will also want to upload the HTML pages to the xPico Wi-Fi's filesystem.

There are multiple ways that this can be achieved. If you have an attached microcontroller, the MCU can configure the xPico Wi-Fi at run-time via the serial port. However, if you want to simplify your MCU's code to just handle data communication and not have to do the one-time configuration of the xPico Wi-Fi, you can configure it at manufacturing.

Please see the Configuring in Manufacturing page for more details on how you can do that.