xPico-WiFi配置手册

Lantronix xPico-WiFi配置使用手册

第三版

2017-10-8更新

一、产品介绍

功能和规格

无线接口

        IEEE802.11 b/g 和 IEEE 802.11n (单天线) WLAN 接口 (只支持2.4 GHz )

        IEEE802.11 d/h/i/j/k/w/r

        板载陶瓷天线 (XPCW1003100B)

        u.FL外接天线连接器 (XPC100100B-01 和 XPCW1002100B)

串口

        两个CMOS串口(3.3V,5V兼容)

        速率300bps~921.6Kbps

        流控制XON/XOFF、RTS/CTS

        Lantronix隧道应用

主要接口

        两个串口、SPI、USB 2.0(设备)

        8根GPIO引脚

网络协议

        TCP/IP、UDP/IP、DHCP、ARP、ICMP、DHCP、Auto-IP、DNS、SNMPv1

网络功能

        可作为软AP,内置DHCP服务器

        内置Lantronix SmartRoam™技术,可连续跟踪有效范围内的Wi-Fi信号强度,采用预身份验证和缓存方式提供平滑、自动、无时延的接入点切换

        快速连接:动态配置文件使连接到接入点简单又快捷

管理和控制

        Web服务器登录页面

        命令行界面(串行监控端口)、Telnet

        XML导入和导出(XCR)

        现场可升级固件(OTA)

安全性

        支持IEEE 802.11i,采用WPA和WPA2(个人版)安全技术

        256位AES加密*

架构

        ARMCortex M3处理器,芯片集成闪存和SRAM

        1MB闪存和128KB SRAM

        SPI闪存存储

电源

        输入电压: 3.3VDC

        低功耗,待机时约 6μA

物理接口

        40针板对板SMT连接器

        56-PadSMT Castellation (XPCW1002100B and XPCW1003100B)

环境限制

        工作温度:-40~+85℃

        XPW100100B-01: 工作温度超过70℃,需采用散热片

        存储温度:-40~+85℃

        相对湿度:0~90%,无冷凝

认证

        FCCClass B, UL and EN EMC, Japan, AU/NZ

封装

        尺寸:

        XPW100100B-01:24mm (L) x 16.5mm (W) x 5.64mm (H)

        XPCW1002100B:26.1mm (L) x 18.3mm (W) x 3.0 mm (H)

        XPCW1003100B:30.1mm (L) x 18.3mm (W) x 3.0 mm (H)

       

        重量: 2.5克

质保

        五年质保

二、配置说明

Lantronix xPico-WiFi提供多种配置方式

l  Web 界面直接配置

l  串口CLI命令

l  串口XML配置

Web界面配置

       xPico-WiFI供电后默认作为无线AP,可以用手机或者笔记本电脑搜索一个无线SSID(xPicowifi_xxxx命名规则),手机或者笔记本电脑可直接连接。

       无线认证密码:XPICOWIFI

       Xpc200:PASSWORD

       xPico-WiFi作为无线AP,支持DHCP Server,最多支持4个终端连接,终端可从xPico-WiFi获取IP地址,默认地址段为:192.168.0.2-192.168.0.4

         在浏览器地址栏中输入192.168.0.1,进入xPico-WiFi的配置界面,

       用户名:admin

       密码:PASSWORD

针对最常用的串口数据到TCP 透传,Lantronix xPico-WiFi需要设置的步骤:

1,         连接到无线AP

xPico-WiFi支持快速无线连接,Quickconnect ,该功能可搜索到网络中存在的无线网络名称,可直接连接。

配置完成,点击submit按钮,配置会直接生效,无需重启。

配置生效后的状态界面:

Interface AP0:

xPico-WiFi模块作为AP时的运行状态

Interface Wlan0

xPico-WiFi模块作为Client,连接到其他无线AP的运行状态,

在Network选项中可以修改IP地址和获取IP地址的方式。

Network:在这个选项中,可以查看并修改AP0和Wlan的参数,

例如DHCP server中分配的IP地址和mac地址;修改AP0的SSID,无线认证加密方式和密码等,修改AP模式所在的信道。

注意:xPico-wifi提供的是SoftAP,当同一个区域中有多个无线AP处于同一个信道,会产生同频干扰,导致网络连接失败。如果出现这种情况,会影响xPico-wifi作为Client的正常通讯,可关闭SoftAP功能,或者使用发射功率较小且满足传输距离的天线。

2,         设置串口参数Line

xPico-WiFi模块有两个串口,Line1和Line2分别是串口1和串口2。

Status界面中可以查看模块当前串口配置参数 以及 串口收发数据统计。在调试过程中可以查看收发数据数量,判断串口和网络是否通讯正常。

Configuration 中可设置串口运行的协议和串口波特率等参数。

若要设置为串口转WiFi数据透传,Protocol需要设置为 Tunnel

Command Line:配置该串口为命令行模式,可通过串口配置模块。

Modem Emulation:

Mux:

None:

Trouble Log:捕获设备运行日志

Tunnel:串口数据透传通道。

Brand rate:xPico-WiFi模块串口配置支持300-921600的标准波特率,在硬件流控模式下不会出现数据丢失,实际传输速率可到700Kbps。

Line1 Custom定制波特率,最高速率可达3.75Mbps,开启硬件流控与MCU通讯,可实现100%数据传输,实际传输速率可达2.3Mbps,满足高速串口传输功能。

Line2 不支持硬件流控,因此最高速率为921600.

当MCU需要通过串口发送XML配置指令到WiFi模块,需要配置硬件流控,否则有可能会丢失数据导致配置失败。

3,         设置TCP连接方式

Tunnel主要设置模块的TCP连接模式

xPico-WiFi可作为TCP Server和TCP Client,支持TCP数据加密,模块支持UDP协议,UDP AES加密协议。

Status 中可以查看当前串口的连接状态等

Line 中可以查看当前串口的配置参数。

Packing 中设置串口封包方式,根据收包时间间隔,或者是数据包的大小,将串口数据打包为TCP数据发送到网络,默认状态为不启用,TCP打包方式为12ms打包一个TCP包。

Accept 该模式为TCP Server模式,可设置接收数据TCP连接端口。

Connect 该模式为TCP Client模式,可同时发送数据到两个不同的IP地址。该选项中可设置UDP模式。Mux模式中,可以通过AT指令,同时建立4路TCP连接。

若要设置TCP串口数据透传,xPico-WiFi模块可设置为TCPServer,也可设置为TCPClient,根据客户应用情况决定。

Xpicowifi模块tcpserverTCPClient 可同时启用,同一个串口 TCP UDP协议可同时启用,两种协议的数据可同时发送到串口。

三、SPI

 

xPicowifi目前支持SPI接口,且只支持master,需要在xPico-WiFi模块和连接的SPISlave设备上编程以相互通讯,最高速率可达5Mbps。详细技术问题可咨询lantronix技术工程师。

 

Powe mode

Xpicowifi支持电源管理,深度待机模式3.3V电流为6uA,在9600的速率下,wifi连接双向通讯最大电流为90mA。具体的功耗参数请参考表格。

 

 

USB bridge功能

xPico-WiFi支持USB转WIFI的功能,相当于工业级USB无线网卡,针对windows和Linux系统,不需要用户开发程序,模块支持Microsoft RNDIS协议,目前处于初级版本,无法通过操作系统配置wifi的连接参数,仍然需要使用串口或者是WEB界面配置。        

配置步骤:

1, 连接Wlan到无线AP,

2, 连接成功后开启bridge 功能,Submit后系统提示重启。

重启后电脑加载驱动程序,在操作系统中可以发现增加了一个有线网络连接。

四、XML串口配置指令

串口配置参数步骤

1.     电脑运行一个终端程序,连接到xPicowifi的串口,
2.
设置终端程序的串口参数如下:
u9600 baud
u8-bit
uNo parity
u1 stop bit
3. Power off thedevice.
4. Get into the serial backdoor as follows:
a.While asserting the defaults signal,

b. Reset the device while sending X, Y, or Z characters.
c. When the incoming characters are recognized, a prompt in the following formwill be seen:
xPicoWifi <MAC ADDRESS>
Note: It is important to release the defaults signal as soonas possible after the
prompt is seen; continuing to hold it down may result in a reset to factorydefaults.

通过按键组合的方式,可以重启模块进入到CLI配置界面。

1,持续按住Default按键,

2,点击Reset管脚,然后持续输入x,y或者z.

3,直到串口调试软件界面出现xPico-WIFI 00:80:A3:B7:66:66

Press <enter>to continue>

3, 输入<enter>,会返回Command Line started.

 

>
OR
a. Whileasserting the defaults signal,
b. Reset the device while sending ! character until it is echoed back.
c. Then release the defaults line, and enter xyz.

XML格式说明

The xPico Wi-Fi DTD rules state the following:
uThe XML documentelement is a <configrecord> element. This is the root element.
uA <configrecord>must have one ormore <configgroup> elements and can have a
version attribute.
uA <configgroup>must have one ormore <configitem> elements and can have name
and instance attributes.
uA <configitem>element must haveone or more <value> elements and can have a name
attribute.
uA <value>element can haveonly data and can have a name attribute.
uThe nameattribute identifies a group, item, or value. It is always a quoted string.
uThe instanceattribute identifies the specific option, like the serial port number. The"instance"
attribute is always a quoted string.

下面的XML指令是设置Interface AP0的参数和串口2的参数,可直接发送到xPico-WiFi的串口即可生效。

<?xml version="1.0" standalone="yes"?>

<!--Automatically generated XML -->

<!DOCTYPEconfigrecord [

   <!ELEMENT configrecord (configgroup+)>

   <!ELEMENT configgroup (configitem+)>

   <!ELEMENT configitem (value+)>

   <!ELEMENT value (#PCDATA)>

   <!ATTLIST configrecord version CDATA#IMPLIED>

   <!ATTLIST configgroup name CDATA#IMPLIED>

   <!ATTLIST configgroup instance CDATA#IMPLIED>

   <!ATTLIST configitem name CDATA#IMPLIED>

   <!ATTLIST configitem instance CDATA#IMPLIED>

   <!ATTLIST value name CDATA #IMPLIED>

]>

<configrecordversion = "0.1.0.1">

   <configgroup name = "TunnelAccept" instance = "2">

      <configitem name = "LocalPort">

         <value>4002</value>

      </configitem>

    </configgroup>

</configrecord>

XML配置连接无线AP

<?xml version="1.0"standalone="yes"?>

<!-- Automatically generated XML -->

<!DOCTYPE configrecord [

  <!ELEMENT configrecord (configgroup+)>

  <!ELEMENT configgroup (configitem+)>

  <!ELEMENT configitem (value+)>

  <!ELEMENT value (#PCDATA)>

  <!ATTLIST configrecord version CDATA #IMPLIED>

  <!ATTLIST configgroup name CDATA #IMPLIED>

  <!ATTLIST configgroup instance CDATA #IMPLIED>

  <!ATTLIST configitem name CDATA #IMPLIED>

  <!ATTLIST configitem instance CDATA #IMPLIED>

  <!ATTLIST value name CDATA #IMPLIED>

]>

<configrecord version ="0.1.0.1">

<configgroup name = "WLANProfile" instance = "ChinaNet-ltrx">

     <configitem name = "Basic">

        <value name = "Network Name">ChinaNet-ltrx</value>

        <value name = "State">Enabled</value>

     </configitem>

     <configitem name = "Security">

        <value name = "Suite">WPA2</value>

        <value name = "WEP Key Size">40</value>

        <value name = "WEP TX Key Index">1</value>

        <value name = "WEP Key 1Key"></value>

        <value name = "WEP Key 2 Key"></value>

        <value name = "WEP Key 3 Key"></value>

        <value name = "WEP Key 4 Key"></value>

        <value name = "WPAx Key Type">Passphrase</value>

        <value name = "WPAx Passphrase">12345678</value>

        <value name = "WPAx Key"></value>

        <value name = "WPAx Encryption">CCMP</value>

     </configitem>

     <configitem name = "Advanced">

        <value name = "TX Power Maximum">17 dBm</value>

        <value name = "Power Management">Disabled</value>

        <value name = "PM Interval">1 beacons (100 mseach)</value>

     </configitem>

  </configgroup>

</configrecord>

说明:标红部分修改为您需要连接的无线AP的SSID和密码,修改后将这段代码粘贴到CLI操作的界面即可。

五、Modem Emulation

xPico-wifi模块支持AT指令集,用于控制TCP连接,可建立TCPServer或者作为TCP Client,主动发起TCP连接。在Modem Emulation模式下,串口模式下可使用AT指令集切换到CLI命令行可以对模块进行配置,可发送XML配置指令。

配置方法:

1,           设置Line protocol: Modem Emulation

2,           在Modem Emulation选项中启用并设置。

AT?

 

AT?     Help. Displays this table.

ATA     Answer incoming call request (if ATS0=2 orgreater).

ATD     Connects to the configured Connect Modeaddress and port.

ATD<address>:<port>     Connectsto the specified address and port.

ATD 0   Enters the Command Line Interface (CLI);exit returns to AT commands.

ATDP    Same as ATD.

ATDT    Same as ATD.

ATEn    Switches echo in command mode (n=0: off,n=1: on).

ATH     Disconnects the network session.

ATI     Displays modem information.

ATO     Switches to data mode if connection stillexists. Reverse of '+++'.

ATQn    Quiet mode (n=0: enable results code, n=1:disable results code.)

ATS0=n  Accept connection. (n=0: no, n=1: auto, n=2+:via ATA command).

ATUn    Accept unknown commands. (n=0: off, n=1:on).

ATVn    Verbose mode (n=0: numeric result codes,n=1: text result codes.)

ATXn    Command does nothing and returns OK status.

ATZ     Restore active settings from defaults.

AT&F    Reset saved settings in NVR to factorydefaults.

AT&V    Display    modeif entered from serial port during connection.

3,当启用Incoming connection,相当于TCP Server模式,TCP Client可连接到这个端口。

在串口端发送“+++”,切换到AT模式。

ATD 0 :进入到CLI模式

配置完成后,exit退出

ATD:恢复到TCP通讯模式。

OK

ATD 0

 

Command Line started.

 

>Importing XML

XML import completed.

 

 

>exit

 

atd

fasdfasdf

 

 

4,在AT指令模式,可以主动控制模块连接到TCP Server,建立TCP连接。

六、Web API

WEB API相当于Telnet功能,可在网络模式下读取WiFi模块的工作状态,配置参数等信息,也可以发送配置指令到WiFi模块。支持标准的HTTP request。

支持Curl指令和JavaScript脚本。可通过webApi升级模块固件。

导出系统状态命令:

CURL example:

curl -u admin:PASSWORD -X POST http://<hostname>/export/status

curl -u admin:PASSWORD -X POST -d"optionalGroupList=Device" http://

<hostname>/export/status

备注:

admin:PASSWORD  为用户名和密码,如果有修改密码,请输入修改后密码

<hostname> 可以填写对应的域名,或者是IP地址。

Javascript example:

myXmlhttprequest.open(

"POST",

"/export/status",

true

);

request.send(

"optionalGroupList=Device"

);

导出设备配置参数命令:

CURL example:

curl -u admin:PASSWORD -X POSThttp://<hostname>/export/config

curl -u admin:PASSWORD -X POST -d"optionalGroupList=Interface:wlan0"

http://<hostname>/export/config

Javascript example:

myXmlhttprequest.open(

"POST",

"/export/config",

true

);

request.send(

"optionalGroupList=Interface:wlan0"

);

导入设备配置参数指令

CURL example

curl -u admin:PASSWORDhttp://192.168.199.160/import/config -X POST --formconfigrecord=@config_wlan.xml

hliu:Desktop LTRX_LH$ curl -u admin:PASSWORDhttp://192.168.199.160/import/config -X POST --formconfigrecord=@config_wlan.xml

<?xml version="1.0"standalone="yes"?>

<!-- Automatically generated XML -->

<!DOCTYPE function [

  <!ELEMENT function (return)>

  <!ELEMENT return (result,message+)>

  <!ELEMENT result (#PCDATA)>

  <!ELEMENT message (#PCDATA)>

  <!ATTLIST function version CDATA #IMPLIED>

]>

<function version = "0.1.0.0">

  <return>

     <message>XML import completed.</message>

     <result>Succeeded</result>

  </return>

</function>

hliu:DesktopLTRX_LH$

上面为配置成功的界面显示。

注意:config_wlan.xml为需要上传的配置文件。当运行CURL指令时,需要跳转到当前目录的路径,本示例中,config_wlan.xml的路径为hliu:Desktop LTRX_LH$ window系统和Linux系统原理相同。

HTTP example:

<form method="post"enctype="multipart/form-data" action="/import/

config" target="_blank">

<input name="configrecord"type="file" size="32">

<input name="submit"type="submit" value="Import Configuration">

</form>

WebAPI升级固件示例源码:

hliu:xPico-wifi LTRX_LH$ cd 1.4.0.R28/

hliu:1.4.0.R28LTRX_LH$ ls

xPicoWifi_1.4.0.0R28.rom                               xPicoWifi_1.4.0.0R28_SDK_setup.exe

xPicoWifi_1.4.0.0R28_Engineering_Release_Notes.txt

hliu:1.4.0.R28LTRX_LH$ curl -u admin:PASSWORD -X POST -d"group=Device&action=Firmware Upload"http://192.168.0.1/action/status

<?xml version="1.0"standalone="yes"?>

<!-- Automatically generated XML -->

<!DOCTYPE function [

   <!ELEMENTfunction (return)>

   <!ELEMENT return(result,message+)>

   <!ELEMENTresult (#PCDATA)>

   <!ELEMENTmessage (#PCDATA)>

   <!ATTLISTfunction version CDATA #IMPLIED>

]>

<function version = "0.1.0.0">

   <return>

     <result>Succeeded</result>

  </return>

</function>

hliu:1.4.0.R28LTRX_LH$ curl -X POST -F datafile=@xPicoWifi_1.4.0.0R28.romhttp://192.168.0.1/upgrade

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head><title>Lantronix</title></head><bodystyle="font-family:verdana;"><h2><spanstyle="color:#ff5800"> xPico Wi-Fi </span>FirmwareUpgrade</h2><hr>

Lantronix STM32F2XX OTA Loader 1.1.0.0R10 Jun 20 201415:29:43

<p>Upgrade successful</p><formmethod="post" autocomplete="off"action="/reboot"><p><input type="submit"value="Reboot" onclick="return confirm('WARNING: Are yousure?')" /></p></form></body></html>

hliu:1.4.0.R28LTRX_LH$ curl -X POST http://192.168.0.1/reboot

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head><title>Lantronix</title><metahttp-equiv="refresh" content="30;url=.."></head><bodystyle="font-family:verdana;"><h4>Please wait . ..</h4></body></html>

xPico-WiFi 1.5以后的固件升级了XML加密方式,需要使用digest加密,因此需要参考下面指令升级固件:

升级思路:

1,           进入到升级固件的根目录

2,           执行curl命令

进入到升级文件的根目录

E:\Lantronix  Documents\xPico-wifi\1.5.0.0A27

λ C:\Users\H.liu\curl.exe--digest --compressed -u admin:PASSWORD -X POST -d "group=Device&action=FirmwareUpload" http://172.16.1.248/action/status

<?xmlversion="1.0" standalone="yes"?>

<!--Automatically generated XML -->

<!DOCTYPEfunction [

   <!ELEMENT function (return)>

   <!ELEMENT return (result,message+)>

   <!ELEMENT result (#PCDATA)>

   <!ELEMENT message (#PCDATA)>

   <!ATTLIST function version CDATA#IMPLIED>

]>

<functionversion = "0.1.0.0">

   <return>

      <result>Succeeded</result>

   </return>

</function>

E:\Lantronix  Documents\xPico-wifi\1.5.0.0A27

λ C:\Users\H.liu\curl.exe-X POST -F datafile=@xPicoWifi_1.5.0.0A27.rom http://172.16.1.248/upgrade

<!DOCTYPE HTMLPUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

<html>

<head><title></title></head><bodystyle="font-family:verdana;"><h2>FirmwareUpgrade</h2><hr>

STM32F2XX OTALoader 1.2.0.0R1 Feb 12 2016 09:49:45

<p>Upgradesuccessful</p><form method="post" autocomplete="off"action="/reboot"><p><input type="submit"value="Reboot" onclick="return confirm('WARNING: Are yousure?')" /></p></form></body></html>

E:\Lantronix  Documents\xPico-wifi\1.5.0.0A27

λ C:\Users\H.liu\curl.exe -X POSThttp://172.16.1.248/reboot

<!DOCTYPE HTMLPUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

<html>

<head><title></title><metahttp-equiv="refresh" content="30;url=.."></head><bodystyle="font-family:verdana;"><h4>Please wait . ..</h4></body></html>

七、OEM方法

Lantronix xPico-WiFi模块支持OEM界面定制,客户可根据自己的要求,修改WiFi模块配置界面,Logo信息,产品信息等。

八、Mux的使用方法

Mux是用于WIFI模块与MCU

1,配置步骤

在Line中设置Protocol为Mux

3,           操作方法

建立TPC server: 1a10001TCP

建立接收区:1rb~6

发送数据:1sb~

                  abcdefg ~

                  1p

创建TCP Client:1c192.168.0.2:4001tcp

发送数据:1sb~

                  abcdefg ~

                  1p

用MUX传送文件:

1,           WIFI模块建立主动连接

输入:1c10.0.0.28:4001tcp返回K

输入:1sb~回车,返回<Number>K

开始发送文件或者粘贴数据到串口调试工具发送框(secureCRT),在服务器端应该可以收到透传数据

输入:1p~ 返回K,结束数据传输

用MUX传送数据:

2,           WIFI模块建立主动连接

输入:1c10.0.0.28:4001tcp返回K

输入:1sb~回车,返回<Number>K

开始输入数据,并用~结尾

输入:1p 返回K,结束数据传输

用MUX传送数据:

3,           WIFI模块建立主动连接

输入:1c10.0.0.28:4001tcp返回K

输入:1sb~回车,返回<Number>K

开始输入数据,回车,在输入数据,并用~结尾并回车,返回K

输入:1p 返回K,结束数据传输

在这种模式下,可以将数据中的回车传送到服务器。

若有问题可随时联系Lantronix工程师,邮箱[email protected]


猜你喜欢

转载自blog.csdn.net/qqcooler/article/details/80773534