Difference between revisions of "XPicoWiFi/ManufacturingConfiguration"

From Lantronix Wiki!
Jump to navigation Jump to search
Line 29: Line 29:
 
rem
 
rem
 
                 curl -u admin:PASSWORD http://192.168.0.1/import/config -X POST --form configrecord=@build.xml
 
                 curl -u admin:PASSWORD http://192.168.0.1/import/config -X POST --form configrecord=@build.xml
                curl -u admin:PASSWORD http://192.168.0.1/fs/http -X MKCOL
+
                curl -u admin:PASSWORD http://192.168.0.1/fs/http -X MKCOL
 
                 curl -u admin:PASSWORD http://192.168.0.1/fs/http/ -T test.html
 
                 curl -u admin:PASSWORD http://192.168.0.1/fs/http/ -T test.html
 
                 ping -n 30 192.168.0.1 > nul
 
                 ping -n 30 192.168.0.1 > nul

Revision as of 16:20, 27 March 2015

Introduction

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.

Using the Soft Access Point

ManufAP.jpg

Using this scheme, a Host device on the Manufacturing floor (which can be a Windows PC, or an Android device) is always scanning on Wi-Fi to find the SSID of the default Soft AP of the xPico Wi-Fi. When it finds it, it will connect to the device, and then use the WebAPI to upload configuration and the WebDAV filesystem API to upload filesystem files.

From a Windows host

Create a batch file that will be run as Administrator. Copy and paste the following code into the batch file:

@echo off
netsh wlan disconnect interface="Wireless Network Connection"
netsh wlan delete profile name=testXPW
netsh wlan add profile filename="c:\profiles\test.xml"
netsh wlan show networks > temp.out
del /F temp1.out
findstr /L XpicoWiFi_ temp.out > temp1.out
for /F "tokens=4" %%i in (temp1.out) do ( 
                netsh wlan set profileparameter name=testXPW SSIDname=%%i
rem        netsh wlan connect name=testXPW 
rem        profile is set to "auto connect" so the above is not needed
                ping -n 10 192.168.0.1 > nul
rem
rem        do the curl configuration here
rem
                curl -u admin:PASSWORD http://192.168.0.1/import/config -X POST --form configrecord=@build.xml
                curl -u admin:PASSWORD http://192.168.0.1/fs/http -X MKCOL
                curl -u admin:PASSWORD http://192.168.0.1/fs/http/ -T test.html
                ping -n 30 192.168.0.1 > nul
                netsh wlan disconnect interface="Wireless Network Connection" >> log
)
@echo on