You could also have specified the roving1 access point by using the command join # 1
If the access point is security enabled you will need to set the pass phrase prior to issuing the join
command.
The RN-131G module will attempt to inquire and determine the security protocol of the
access point so you do not have to set the authentication mode. To set the pass phrase for WPA use
the command set wlan phrase <string>. For WEP set the key using the set wlan key <num>
command.
Once you have successfully 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
Making Connections
To make a connection into the module simply open a IP socket and connect to the IP address of the
module. Telnet is a simple way to test this connection. From in Telnet type open <addr> <port>.
In the example above the telnet command you look like open 10.20.20.62 2000.
can type characters into the UART window and see them on the Telnet window or visa versa.
To make a connection from the module you will need IP address and port number of your server
application. A simple program to test this functionality is a COM port redirector. This software opens
an IP port and transfers all data it receives to a specified COM port on your machine.
port redirector program is available from Pira at
After installing and starting this program, note the IP address of the machine it is running on.
can be found by running ipconfig in the Microsoft command window.
With the WiSnap module in command mode, type open <addr> <port>. The server will report the
connection is open and you can type characters into the UART window and see them on the server
window or vice versa.
12.3
Setting up Automatic Connections
Often, it is desired on power up (or wakeup) to automatically connect out to a remote server, send
data, and then disconnect.
In the following example assume the network SSID and security have been set correctly and autojoin
is set to 1. This will also work in ad-hoc mode (autojoin 4), however there will be delay in
connecting to the ad-hoc network from the remote computer so set the sleep timer large enough to
allow the network to get set up and the autoconn establish a TCP connection.
When the module wakes up or is powered on the autoconn timer will cause the module to attempt a
connection to the stored remote IP address and port. While this connection is open the sleep timer
will not decrement. While data is flowing the idle timer will not decrement. Once data stops for 5
seconds the connection will be closed. The sleep timer will the kick in and put the module in deep
sleep. Finally the wake timer will start the whole cycle again one minute later.
set ip host X.X.X.X
set ip remote_port num (set up the IP port of the remote machine )
set sys autoconn 1
set com idle
5
set sys sleep 2
(sleep 2 seconds after connection is closed )
set sys wake 60
This can be configured to happen automatically.
( set up the IP address of the remote machine )
(automatically connect out after READY )
(disconnect after 5 seconds with no data activity )
(wakeup after 1 minute of sleeping )
Page
WiSnap User Manual 2.21 04112011-JF
http://www.pira.cz/eng/piracom.htm
44
66
of
Once open you
A free com
This
Need help?
Do you have a question about the WiSNAP and is the answer not in the manual?