Lantronix 900-691-R Import Configuration Group, Curl example configuration as part of command

Page 102

Appendix B: WebAPI

Import Configuration Group

An HTTP POST request can be sent to the device to set configuration.

Protocol: HTTP

Method: Post

Content-Type:multipart/form-data

URL: http://<hostname>/import/config

Parameters:

configrecord: Content of configuration group in XML format. CURL example (configuration is saved in a local file config.xml):

curl -u admin:PASSWORD http://172.19.100.125/import/config -X POST -- form configrecord=@config.xml

CURL example (configuration as part of command):

curl -u admin:PASSWORD http://172.19.100.125/import/config -X POST -- form-string 'configrecord=<?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 = "Access Point" instance = "ap0"> <configitem name = "SSID">

<value>MY DEVICE</value> </configitem>

</configgroup>

</configrecord>'

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>

xPico® Wi-Fi® Embedded Device Server User Guide

102

Image 102
Contents Embedded Device Server User Guide Contacts WarrantyIntellectual Property DisclaimerTable of Contents Configurable Pin Manager Interface SettingsTunnel Settings Services SettingsBranding the xPico Wi-Fi Unit Maintenance and Diagnostics SettingsAdvanced Settings MonitorAppendix C Technical Support 103 Updating FirmwareAppendix B WebAPI 100 105Appendix E Binary to Hexadecimal Conversions 112 XPico Wi-Fi Product Label List of FiguresList of Tables XPico Wi-Fi Embedded Device Server User Guide Summary of Chapters Using This GuidePurpose and Audience Chapter DescriptionAdditional Documentation Document DescriptionKey Features IntroductionTroubleshooting Capabilities Protocol SupportConfiguration Methods Addresses and Port NumbersProduct Information Label XPico Wi-Fi Product Label Configuration Using Web Manager Accessing Web ManagerStatus StatusWeb Manager Components Navigating Web ManagerHelp Area Web Manager Pages Web Manager Description SeeTo Configure Network 1 Interface Settings Network SettingsNetwork 1 Interface ap0 Configuration Network Interface SettingsNetwork 1 ap0 Link Description Settings Network 1 ap0 Link SettingsNetwork 1 ap0 Link Settings To View Network 1 Interface StatusMode To Configure Network 1 Link SettingsTo View Network 1 Link Status UptimeNetwork 2 wlan0 Interface Configuration To Configure Network 2 Interface SettingsNetwork Interface Description Settings To View Network 2 Interface Status Network 2 wlan0 Link StatusWlan Profiles To View Network 2 Link StatusWlan Profile Basic Settings Description To Configure Wlan ProfilesTo Configure Wlan Profile Settings Creating, Deleting or Enabling Wlan ProfilesWlan Profile Security Settings Wlan Profile Description Security SettingsWlan Profile Advanced Settings Description To Configure Wlan Quick ConnectWlan Profile Advanced Settings Wlan Quick ConnectScan network Ssid Wlan Quick Connect Description SettingsWlan Quick Connect Network Name linkLine Configuration Settings Interface SettingsLine Settings Line Settings DescriptionTo View Line Status To Configure Line SettingsGap Timer Xoff CharSerial Perpheral Interface SPI Settings To Configure SPI SettingsSPI Configuration Settings To View SPI Status To View Tunnel Serial Settings Tunnel SettingsLine Settings Tunnel Line SettingsPacking Mode Tunnel Packing Mode SettingsTunnel Packing Mode Description Settings Tunnel Accept Mode Settings To Configure Tunnel Packing Mode SettingsAccept Mode Tunnel Accept Mode Description SettingsTo Configure Tunnel Accept Mode Settings Connect Mode Tunnel Connect Mode SettingsTunnel Connect Description Mode Settings Tunnel Disconnect Mode Settings To Configure Tunnel Connect Mode SettingsDisconnect Mode Tunnel Disconnect Description Mode SettingsModem Emulation Settings Modem Emulation SettingsTo Configure Tunnel Disconnect Mode Settings StatisticsTunnel Settings Modem Emulation Commands and DescriptionsCommand Description ATZ Current Configurable Pins Configurable Pin ManagerConfigurable Pin Status CP StatusRoles Active in RoleTo Configure CPM Settings Role ConfigurationCPM Role Current Description Configuration To Configure Http Settings and Access Control Services SettingsHttp Settings Http SettingsTo View Http Status File System Statistics Maintenance and Diagnostics SettingsFile System Settings File DisplayFile Manipulation Device SettingsDevice Management Settings To Transfer or Modify File System FilesAdmin User To Configure Admin User on the DeviceAdmin User Settings To View IP Socket Status Diagnostics SettingsTo View Hardware Status To View Buffer Pool StatusAdvanced Settings To Import or Export XML ConfigurationXML Import and XML Export Performance Settings Performance SettingsModem Emulation Settings Description To Configure Performance Explorer Settings Description Monitor SettingsMonitor Explorer Settings MonitorRule Number DisplayMonitor Control Settings ConfigurationMonitor Initialization Settings Initialization Description SettingsPoll Settings Description Monitor Poll SettingsMonitor Filter Settings DelayData Settings Description To Configure MonitorMonitor Data Settings Selector NumberExample Data Capture on a Serial Device InitializationPolling Monitor Polling 1Filtering 10 Monitor Filtering 1Data Mining 12 Monitor Data Mining 1Presenting Data Capture on SPI Changing the Presentation Branding the xPico Wi-Fi UnitWeb Manager Customization Path FormatOther Overridable Files Updating Firmware Obtaining Firmware Loading New Firmware through Web ManagerUpdating Firmware XML Architecture and Device Control Appendix a Command ReferenceConventions Convention DescriptionConfiguration Using Serial Port Serial Command ModeBoot to CLI Table A-1 Keyboard Shortcuts Using Keyboard Shortcuts and CLINavigating the CLI Hierarchy Key Combination DescriptionConfiguration Using XML Appendix a Command ReferenceUnderstanding the CLI Level Hierarchy XML Configuration Record Document Type Definition Figure A-3 DTD for XCRsElement Start and End Tags Quick Tour of XML SyntaxDeclaration Element AttributesRecord, Group, Item, and Value Tags Figure A-5 XML ExampleXML for xPicoWi-Fi Embedded Device Server Configgroup Access PointConfiggroup CPM Configitem Port Configgroup Http ServerConfigitem State Configitem Inactivity TimeoutConfiggroup Interface Configitem Access ControlConfigitem Dhcp Client Configgroup Line Configitem Baud Rate Configitem NameConfigitem Protocol Configitem ParityConfiggroup Performance Configitem Wkup Pin Power Up Configgroup SPIConfigitem Maximum Time Powered Down Configitem Time Powered UpConfiggroup Users Configitem Password Configgroup Wlan ProfileConfigitem Instance Configitem BasicConfiggroup XML Import Control Configgroup Modem Emulation Configgroup Monitor Initialization Configgroup Monitor Control Value TimeoutValue Length Configgroup Monitor Poll Configitem DelayConfiggroup Monitor Filter Configitem RuleConfigitem Selector Configgroup Monitor DataConfiggroup Tunnel Accept Configitem Local PortConfigitem Flush Line Configitem Start CharacterConfigitem Flush Start Character Configitem Block LineConfigitem Prompt for Password Configgroup Tunnel LineConfigitem Block Network Configitem DTRConfiggroup Tunnel Connect Configitem HostValue Address Value Port Configitem ConnectionsConfigitem Reconnect Time Value ProtocolConfigitem Flush Stop Character Configgroup Tunnel DisconnectConfigitem Stop Character Configitem Modem ControlConfiggroup Tunnel Packing Configitem Send CharacterConfigitem Trailing Character Export Configuration Group Appendix B WebAPIExport Status Group Take Status Action Appendix B WebAPIImport Configuration Group Curl example configuration as part of commandEurope, Middle East, Africa Emea Appendix C Technical SupportNorth America Japan Asia / Pacific ApacLatin America & Caribbean Online Table D-1 Country Certifications Country SpecificationAppendix D Compliance Table D-2 Country Transmitter IDsTable D-3 Safety Table D-4 Europe EU Declaration of ConformityFederal Communication Commission Interference Statement Radiation Exposure StatementManual Information To the End User Industry Canada StatementEnd Product Labeling Déclaration dexposition aux radiationsPlaque signalétique du produit final Table D-5 Approved Antennas List Manuel dinformation à lutilisateur finalAntenna Requirement Type Gain BrandManufacturers Contact RoHS NoticeConversion Table Appendix E Binary to Hexadecimal ConversionsConverting Binary to Hexadecimal Scientific CalculatorAppendix E Binary to Hexadecimal Conversions