XPicoWiFi/SDK/Introduction

From Lantronix Wiki!
Revision as of 20:46, 25 August 2015 by Ltrxmg42 (talk | contribs)
Jump to navigation Jump to search

Introduction

The xPico Wi-Fi SDK lets you run your custom programs in the microcontroller that's part of the module. The SDK is organized in a modular fashion, so that you can use all of the Lantronix programs, and just add what you need, without having to re-write all of the networking and configuration utilities that are part of the Lantronix SmartSuite software offering.

Installation

The xPico Wi-Fi SDK is to be used in the Microsoft Windows operating system.

Double-click on the setup executable, and follow the prompts. The installer will create two directories on your computer:

C:\MinGW which is an Open Source programming tool that provides the GNU Compiler Collection (GCC) in a Windows environment.

C:\xPicoWifi where the SDK resides.

Projects and Modules

To understand the organization of the SDK, it is critical that you understand two concepts: Projects and Modules.

Projects

The end result of a project is a .rom file which can be flashed into an xPico Wi-Fi. This is where you will determine which modules you will use. Modules can be either the ones written by Lantronix, or the custom modules that you create.

Projects are in the following directory:

c:\xPicoWifi\custom\project\

You can edit Makefile to change the SDK_VERSION which will be incorporated in the firmware version of the resulting image.

The modules.make file tells the compiler which modules to include in the final build.

Modules

These are the building blocks of the firmware image, and where you will be spending the most time. There are a number of Lantronix-provided modules that you can include in your Project. This means that your code only needs to take care of what you need to customize, and you don't need to re-create network configuration and management utilities.

The Lantronix provided modules are:

  • aes: AES encryption/decryption
  • bridge: USB to Wi-Fi bridging
  • discovery: Lantronix discovery protocol
  • main: Required for the main Lantronix software
  • modem_emulation: UART Protocol: AT command set
  • monitor: UART/SPI Protocol: Monitor scripting and Explorer configuration
  • mux: UART Protocol: Serial API for multiplexing network connections onto single serial port
  • ntp: Simple NTP Client (Network Time Protocol)
  • rndis: Ethernet over USB module (used with bridge)
  • tunnel: UART Protocol: Can be used to tunnel data to network
  • user_data: Framework for adding your own tabs to the Lantronix Web Manager page

Getting Started

Navigate to C:\xPicoWifi and double-click on the MinGW-shell shortcut, which will start a MinGW shell window.

In that shell, enter:

cd /c/xPicoWifi/custom/project/helloDemo
make

This will build the Hello World module and main module. The Hello World module registers a Line module that writes Hello World on that Line.

The output of the build will be in the C:\xPicoWifi\work\helloDemo directory. Update firmware on your xPico Wi-Fi with the .rom file in that directory.

If you look at hello_world.c in the Module, you will see that hello_world_module_initialization registers a Line Protocol (calls ltrx_line_register_protocol). This means that when you load the firmware, the only thing the code does is tell the xPico Wi-Fi system that a new Line Protocol is available for use.

To actually start sending "Hello World" to the serial port every 2 seconds, you need to configure one of the Lines to the Hello World protocol:

HelloWorld.png

Documentation

The canonical documentation for the SDK is part of your installation. You can open the browser-based documentation by double-clicking on the C:\xPicoWifi\documentation\theDocument.bat file.

Documentation.png