background image

 

 

WiSnap User Manual 4.41 05282015-ML 

 

 

 

Page 61

 

 

 

 

 
 

22       Command List

 

 

The tables below provide a listing of all available commands and their defaults. For more detailed information, refer to the 
“Command Reference.” 

 

Set commands 

 

Command 

Default 

Description 

set adhoc beacon

 

<value>

 

102 

Sets the ad hoc beacon interval in milliseconds. 

set adhoc probe

 

<value>

 

Sets the ad hoc probe timeout in seconds (ad hoc mode only). 

set adhoc reboot

 

<value>

 

Sets the reboot timer. 

set broadcast address

 

<address>

 

255.255.255.255 

Sets the address to which the UDP hello/heartbeat message is sent. 

set broadcast backup

 

<address>

 

0.0.0.0 

Sets the secondary broadcast backup address. 

set broadcast interval

 

<mask>

 

Sets the interval (in seconds) at which the hell0/heartbeat UDP message 
is sent. 

set broadcast port

 

<value>

 

55555 

Sets the port to which the UDP hello/heartbeat message is sent. 

set broadcast remote

 

<port>

 

Sets the secondary broadcast port. 

set comm $

 

<char>

 

Sets character used to enter command mode to 

<char>

set comm close

 

<string>

 

*CLOS* 

Sets the ASCII string that is sent to the local UART when the TCP port is 
closed. 

set comm idle

 

<value>

 

Sets the idle timer value in seconds. 

set comm match

 

<value>

 | 

<hex>

 

Sets the match character in hex or decimal. 

set comm open

 

<string>

 

*OPEN* 

Sets the ASCII string that is sent to the local UART when the TCP port is 
opened. 

set comm remote

 

<string>

 

*HELLO* 

Sets the ASCII string that is sent to the remote TCP client when the TCP 
port is opened. 

set comm size

 

<value>

 

64 

Sets the flush size in bytes. 

set comm time

 

<value>

 

Sets the flush timer. 

set dhcp lease

 

<value>

 

86400 

Sets the soft AP mode DHCP lease time in seconds. 

set dns address

 

<address>

 

0.0.0.0 

Sets the IP address of the DNC server. 

set dns backup

 

<string>

 

rn.michrochip.com 

Sets the name of the backup host for TCP/IP connections to 

<string>

set dns name

 

<string>

 

server1 

Sets the name of the host for TCP/IP connections to 

<string>

set ftp addr

 

<address>

 

0.0.0.0 

Sets the FTP server’s IP address of the FTP server. 

set ftp dir

 

<string>

 

public 

Sets the starting directory on the FTP server. 

set ftp filename

 

<filename>

 

See description 

Sets the name of the file that is transferred when issuing the 

ftp u

 

command, where 

<filename>

 is the firmware image. 

Default firmware is: 
wifly-GSX.img (RN131 
wifly-EZX.img (RN171) 

set ftp pass

 

<string>

 

Pass123 

Sets the password for accessing the FTP server. 

set ftp mode

 

<mask>

 

0x0 

Sets the ftp mode, where 

<mask>

 indicates active or passive mode. 

Default is passive. 

set ftp remote

 

<value>

 

21 

Sets the FTP server’s remote port number. 

set ftp time

 

<value>

 

200 

Sets the FTP timeout value, where 

<value>

 is a decimal number that is 

five times the number of seconds required. 

set ftp user

 

<string>

 

roving 

Sets the user name for accessing the FTP server. 

set ip address

 

<address>

 

0.0.0.0 

Sets the WiSnap module’s IP address. 

set ip backup

 

<address>

 

0.0.0.0 

Sets a secondary host IP address. 

set ip dhcp

 

<value>

 

Enables/disables DHCP mode. 

set ip flags

 

<mask>

 

0x7 

Sets the TCP/IP functions. 

set ip gateway

 

<address>

 

0.0.0.0 

Sets the gateway IP address. 

set ip host

 

<address>

 

0.0.0.0 

Sets the remote host’s IP address. 

set ip localport

 

<value>

 

2000 

Sets the local port number. 

set ip netmask

 

<address>

 

255.255.255.0 

Sets the network mask. 

set ip protocol

 

<flag>

 

Sets the IP protocol. 

Содержание WinSnap

Страница 1: ...WiSnap User Manual 4 41 05282015 ML Page 1 WISNAP WI FI SERIAL ADAPTER 802 11 B G Wireless LAN Module User Manual and Command Reference Version 4 41 May 28 2015...

Страница 2: ...mers and Auto Connect Timers 29 10 2 Wake on Sensor Input 30 10 3 Wake on UART 31 10 4 UART Receiver RTS CTS Hardware Flow Control 31 10 5 Setting GPIO direction Alternate Functions and Disabling LEDs...

Страница 3: ...in Software 48 15 4 Scanning for Access Points in Ad Hoc Mode 49 15 5 Enable Ad Hoc Mode in Hardware 50 16 Access Point Networking Mode 50 16 1 Enabling AP Mode 50 16 2 Using Access Point Mode 51 17...

Страница 4: ...d and RoHS compliant Host Data Rate Up to 2 7 Mbps for UART Memory 128 KB RAM 2MB ROM 2 KB battery backed memory 8 Mbit Flash Intelligent built in power management with programmablewakeup Can be power...

Страница 5: ...5VDC only on pin 9 of the DB9 connector Rechargeable NiMH batteries will be trickle charged when used with an external 5VDC only power source The power cable is center pin positive outer cylinder GND...

Страница 6: ...address or Config Mode Not Associated Rx Tx data transfer Slow blink IP address OK Associated No Internet Low power OFF Associated Internet OK The blue LED blinks when data is sent or received on the...

Страница 7: ...er to change them Holding the device with the DB9 connector facing to the right the switches are numbered one to four from bottom to top The off position is towards the DB9 connector Switch 1 Ad hoc o...

Страница 8: ...male DB9 1 NC NC 2 RXD TXD 3 TXD RXD 4 DTR PIO7 DON T USE 5 GND GND 6 DSR PIO8 5V DC input 7 RTS CTS 8 CTS RTS 9 5V DC Only 5V DC Only NOTE The RS232 interface uses the SIPEX SP3232ECA chip with capac...

Страница 9: ...3 Configuration 3 1 Entering Command Mode Upon power up the device will be in data mode To enter command mode send the three characters and the device will respond with CMD While in command mode the...

Страница 10: ...onsive for a brief amount of time and you may lose the data sent to the module while the module is in this not associated state making it difficult to get into command mode and configure the module Ve...

Страница 11: ...e Save all the settings to the config file 5 reboot Use the new settings This setup can be tested using TCP server application that opens a socket on port 3000 Port Peeker is a free application that y...

Страница 12: ...e able to put the device into Access Point mode Access point mode allows for an alternative for connecting android devices The device can be put into access point mode by issuing the following command...

Страница 13: ...y operate at boot up time For example At power up you will only associate set the channel and get your IP address once Most of the other commands take effect immediately like the COMM settings and tim...

Страница 14: ...comm char sets character used to enter command mode Typically used when is a possible data string Default is Care should be taken when setting this to note the new character as once this setting is s...

Страница 15: ...tomatically set when using DHCP you must set the DNS IP address for static IP or automatic IP modes set dns name string sets the name of the host for TCP IP connections to string where string is up to...

Страница 16: ...mapped flag register Default 0x7 Bit Protocol 0 TCP connection status see note below 1 Bypass Nagle algorithm and use TCP_NODELAY 2 TCP retry enabled 42 total 3 UDP retry attempts retry if no ACK from...

Страница 17: ...e configuration security purposes Example set ip tcp mode 0x4 Forces the module to use DNS set ip tcp mode 0x10 Disables remote configuration 5 7 OPTIONAL Parameters set opt jointmr msecs join timer i...

Страница 18: ...periodically connect to the host The timer secs determines how often to connect to the stored remote host If set to 1 the module will only make one attempt to auto connect upon power up If set to 2 o...

Страница 19: ...function 5 Enable sleep on GPIO8 The following table describes how you can wake the module using sensor input Wake on Sensor Input Value Command 0 1 set sys trigger 1 1 2 set sys trigger 2 2 4 set sys...

Страница 20: ...57600 115200 230400 Example set u b 9600 sets the baud rate to 9600 baud NOTE the RS 232 interface on the WiSnap does not work below 2400 or above 230400 baud set uart instant rate this immediately c...

Страница 21: ...y without flow control set uart mode mask sets the UART mode register where mask is a hex number masking a bit mapped value as shown below Bit Position Function 0 NOECHO disables echo of RX data while...

Страница 22: ...for all the channels set in the channel mask The flag is the optional character i meaning immediate The i flag allows you to create a temporary AP mode setup without having to reboot or save the sett...

Страница 23: ...on value sets the link monitor timeout threshold If set to 1 or more WiSnap will scan once per second for the AP it is associated with The value is the threshold of failed scans before the WiSnap decl...

Страница 24: ...lue sets the IP maximum buffer window size Default is 1460 bytes set wlan tx value sets the Wi Fi transmit power where value is a decimal number from 1 to 12 that corresponds to 1 to 12 dBm The defaul...

Страница 25: ...apAAA show connection displays connection status in this HEX format 8XYZ Bit Location Function Value 0 3 TCP status 0 Idle 1 Connected 3 NOIP 4 Connecting 4 Associate 1 OK 5 Authenticate 1 OK 6 DNS se...

Страница 26: ...file After this command the module then needs to be rebooted for settings to take effect join ssid joins the network ssid If network is security enabled you must set the pass phrase with the set wlan...

Страница 27: ...the UART or by using the wake timer time sets the Real time clock by synchronizing with the time server specified with the time server parameters This command sends a UDP time server request packet 9...

Страница 28: ...ablebelow Method Interface Description RTS transition RTS pin Once the WiSnap module wakes up the RTS line goes HIGH Once the system is ready the RTS is driven LOW This can be monitored by the micro c...

Страница 29: ...wake is a 32 bit number of seconds so it can be as high as 1 19 million hours The wake timer which is the time the WiSnap is asleep is a 22 bit number of seconds so the maximum sleeping time is 1165 h...

Страница 30: ...empt to auto connect upon power up If set to 2 or greater auto connect will re open the connection after the connection is closed Default 0 disables For auto connect timer to work the remote host s IP...

Страница 31: ...jumper from pin 3 on the Evaluation board header to pin 2 on the sensor header To wake on UART CTS place a jumper from pin 10 on the Evaluation board header to pin 3 on the sensor header To enable wak...

Страница 32: ...h the set uart flow 1 command It is possible to operate higher baud rates greater than 115K without flow control if packets are uniform and an application protocol is used to ensure that each packet d...

Страница 33: ...A The Blue LED is not connected to GPIO7 on the WiSnap SuRFBoard M1 It is not possible to power off the Blue LED on the SuRFBoard because it is connected directly to power 10 5 1 Setting the alternate...

Страница 34: ...ule will connect to the stored remote host IP address and port when GPIO 5 is driven high and disconnect when driven low The TCP IP connection status can be monitored by reading GPIO 6 high connected...

Страница 35: ...Channel 2 character decimal RSSI 2 character decimal negative number Security mode 2 bytes see Table Security Modes below Capabilities Bit mapped 4 hex bytes see Table Capabilities Bit Mask Values bel...

Страница 36: ...3104 00 16 b6 45 63 98 CoolBox 04 11 50 02 3100 00 18 02 70 7e e8 airlink 11 05 11 69 04 3100 00 14 6c 1f f7 5e ap ssid change me The security mode field for this scan format is described below Secur...

Страница 37: ...value command The default sNTP server is ADDR 129 6 15 28 123 ZONE 7 GMT 7 Use the show time command to see the current time and uptime as shown below 2 23 show t Time 08 43 10 UpTime 10 s To set the...

Страница 38: ...e UDP with the module you must enable the UDP protocol using the set ip proto 1 command You must also specify the remote host s IP address and the local and remote port number that you will use for UD...

Страница 39: ...st informs the AP that WiSnap is alive and wants to stay associated 2 This feature can be used by application programs to auto discover and auto configure the WiSnap module If an application is listen...

Страница 40: ...odule to make connections is a two set process First you need to associate with an access point AP and second you need to open a connection To configure the module over the Wi Fi link is a chicken and...

Страница 41: ...associated to the network the access point SSID is stored This along with the pass phrase can be saved to the config file so the module can associate with the network each time it is booted up 12 2 Ma...

Страница 42: ...ip host address set up the remote machine s IP address set ip remote_port value set up the remote machine s IP port set sys autoconn 1 automatically connect when ready set com idle 5 disconnect after...

Страница 43: ...cations such as GPS units remote sensors weather station etc Example User wants to retrieve data from web server with this format http www webserver com ob php obvar WEATHER Settings set ip proto 18 e...

Страница 44: ...etup the string 2 set sys auto 30 auto connect every 30 seconds 3 set option format 1 auto send header once connection is opened 4 set ip proto 18 turn on HTTP mode 0x10 TCP mode 0x2 Note 1 when HTTP...

Страница 45: ...binary data with hex values 0x01 0xAB 0x03 0xFF 0x05 0x06 WiSnap will send this string to the web server GET userprog php DATA 01AB03FF0506 n n 13 5 Auto posting sensor data WiSnap module can send the...

Страница 46: ...ion sensor 0xFF sets sensor mask to sample all channels 9 save save the configurations in config file 10 reboot reboot so that the settings take effect Result You will receive a 200 OK returned from t...

Страница 47: ...0 config 190 Free Boot 11 Backup 0 Multiple firmware images and config files can be stored on the module file system NOTE The Flash File system is used only to store firmware and configuration files C...

Страница 48: ...to the other networks and the internet It is also very common for the access point to run a DHCP server which tracks and assigns IP addresses Ad hoc networks are point to point networks in that each W...

Страница 49: ...e command If DHCP is enabled the WiSnap device obtains IP address automatically when it associates with the ad hoc network By definition auto IP sets the first two bytes of the subnet to 169 254 xxx x...

Страница 50: ...hoc mode In Access Point mode The module creates a soft AP network to which Android devices smartphones and tablets can join At the time this document was authored android devices do not fully suppor...

Страница 51: ...s the SSID channel and IP address in software to create a custom AP mode For example the following commands create a custom AP mode in software 1 set wlan join 7 enable AP mode 2 set wlan channel valu...

Страница 52: ...se the show z command This command does not survive a power cycle or reboot Upon power up if no device is connected over TCP the show z command returns 0 0 0 0 View Associated Devices To see a list of...

Страница 53: ...s a standard for easy and secure establishment of a wireless home network This standard was created by the Wi Fi Alliance launched on January 8 2007 The goal of WPS protocol is to simplify the process...

Страница 54: ...RN 134 and RN 174 boards When the LED flashes indicating the module is scanning for a WPS enabled access point you should drive GPIO9 low By default the WPS code prints messages on the UART as it sca...

Страница 55: ...es at 400mV Resolution 14 bits 12uV Sampling frequency 35us Accuracy 5 un calibrated The accuracy of each analog sensor reading can be offset by up to 5 due to variation from chip to chip To improve a...

Страница 56: ...puts use the set q sensor 0xff command Using the Built In Sensor Power WiSnap modules contain an onboard Sensor power pin which is controlled by the set q sensor mask command mask is a bit mask value...

Страница 57: ...lt Close string OPEN Open string CLOS Remote string HELLO Flush size 1420 Match character 0 Flush timer 10 milliseconds Idle timer 0 Cmd char DNS PARAMETERS Parameter Default IP address 0 0 0 0 dns1 N...

Страница 58: ...value 0x0 Print level 0x1 Print enabled Debug Register 0x0 Unused parameter for future development Leave at default value LaunchString web_app TIME SERVER PARAMETERS Parameter Default Enable 0 disable...

Страница 59: ...and executes a save command Next send the reboot command so that the module reboots with the default configuration Hardware Set GPIO9 high on power up to arm the factory reset function Then toggle GP...

Страница 60: ...ing channel 0 primary channel scan mask 0x421 Associate using channel X fixed channel 80 15 5 20 Authentication Authenticate using WPA1 or WPA2 highly dependent on access point response 50 250 Acquire...

Страница 61: ...e value 5 Sets the flush timer set dhcp lease value 86400 Sets the soft AP mode DHCP lease time in seconds set dns address address 0 0 0 0 Sets the IP address of the DNC server set dns backup string r...

Страница 62: ...value 0 Sets the sleep timer set sys trigger flag or mask 0x1 With this parameter setting the module wakes from sleep state using the sensor input 0 1 2 and 3 set sys value mask 0x0 Sets the default v...

Страница 63: ...s get option Displays the optional settings such as the device ID get sys Displays the system settings sleep and wake timers etc get time Displays the time server UDP address and port number get wlan...

Страница 64: ...ge value Makes a file represented by value the new boot image ftp update string Deletes the backup image file retrieves a new image file and updates the boot pointer to the new image ftp option filena...

Страница 65: ...t would occasionally cause the module to watchdog reset during the FTP firmware update process Fixed an issue that would occasionally cause an ERR Malformed error message during the FTP update process...

Страница 66: ...RESET command while telnet session was in progress Fixed a bug in soft AP mode wherein the module would close the TCP connection upon another client being deauthorized Fixed an issue with the link mon...

Страница 67: ...is set extra data would be added to FTP put file data This has been fixed in version 2 28 Fixed a bug where if the TCP_CLIENT mode is set the module would randomly attempt outgoing connections Fixed a...

Страница 68: ...P connection based on received UART data Set uart mode 2 to enable this mode Added time stamping option to both UDP and TCP packets 8 byte RTC counter is appended DHCP client now inserts the DEVICEID...

Страница 69: ...oot Such as Linksys WRT160NL Fixed problem with send on match character i e set comm match char Match char is now operational During an open TCP session a second incoming connection would be accepted...

Страница 70: ...lude a much better description of this functionality See section 10 5 As of firmware version 2 08 6 08 2009 Connecting out an IP address does not use the DNS and backup DNS if the connection to the pr...

Страница 71: ...eters Copyright 2011 SerialIO com All rights reserved The Bluetooth trademark and logo are registered trademarks and are owned by the Bluetooth SIG Inc All other trademarks are property of their respe...

Отзывы: