WR1: Wireless RS232 data transfer ("Device Server")
Description
This script transfers data from the RS232 port wirelessly to a computer or to another Avisaro 2.0 product. Data transfer is bi-directional. To set up a “wireless rs232 cable” with a Windows based PC there is only one Avisaro 2.0 product needed. A “virtual serial port” software runs on the PC to redirect all data going to the RS232 port over the LAN/WLAN to the Avisaro 2.0 product.
Download
Version history
| Script name: |
wr1-14.txt |
| Current version: |
v 1.14 , dated from 10.04.2009 |
| Firmware: |
v3.28 or higher required |
| Hardware: |
Logger wlan cube or logger wlan module |
| History: |
v1.14: v1.13: fixed problem with port setting v1.8: changed IP adresse on website v1.0: Initial release |
1. Initial Setup
1.1. Load Script (if necessary)
If purchased a WLAN "Box" or "Cube" product, the application script is usually preloaded. Check shipping documents to verify. If not, or the script should be changed or updated, load the script as described
here.
1.2. Connect and Power Up
Power Up and Connect to your device as described
here in the User Manual section "First Steps".
Configure the RS232 port as described
here using the Web interface.
1.3. Default settings
To summarize, the default settings of the data and WLAN / TCP interface are:
RS232 default settings
Baudrate: 9600
No of bits: 8
Parity bits: none
Stop bits: 1
Flow control: none
WLAN settings
SSID: avisaro
Channel: 11
Mode: adhoc
Encryption: none
TCP/IP settings for WLAN interface
IP: 192.168.0.74
Subnet: 255.255.255.0
DHCP: off
Login user: admin, pass: 1234
2. Configure Avisaro device
2.1. Listen for incomming connection ("TCP Server")
Listen status - Click to enlarge
The Avisaro 2.0 product can either wait (listen) to an incoming connection, or actively try to connect to a other device such as a PC. The later one is more common, but this decision depends on the application. Consult your network admin to get help on this decision.
Set-up to have the module wait for an incoming connection: Enter a “0” in the field “Connect to (Ip, =0 for listen). Enter the desired port number in the field “Connect to / Listen (Port). Press the “Submit” button to store the changes. After reloading the page, the Status should state “listening”. The green LED flashes to indicate ongoing listening.
2.2. Initiate connection ("TCP Client")
Setting "TCP Client" - click to enlarge
Set-up to have the module actively connect to a PC: Enter the IP address of the target PC (or other device) in the field “Connect to (Ip, =0 for listen). Instead of IP address, the internet name can be also entered (such as yourname.dyndns.org) Enter the port number of the target in the field “Connect to / Listen (Port). Press the “Submit” button to store the changes. After reloading the page, the Status should state “try to connect”. The green LED flashes to indicate connection trials.
2.3. Connection established
Connected status - click to enlarge
Once configured, the Avisaro 2.0 tries to connect to a PC or listen to an incoming connection after start-up. As soon as the TCP/IP connection was established, the red and green LED light constantly. The status field with the scripting menu shows “connected”.
When the connection was reset – i.e. due to a shut down of the PC – the module will try to connect again (flashing green light). The push button can be used to terminate the current IP connection. The module immediately tries to reconnect.
3. Connect to a Windows PC
3.1. Virtual Serial Port software
To create a wireless connection to a PC, a 'virtual serial port' can be used. This piece of software installs a serial port such as COM3. All data send to this COM port is redirected to the wireless connection and finaly send out on the Avisaro device. All that works bidirectional.
Thus, there is no extra hardware required on the PC. The PC only needs a regular Wifi interface or needs access to the network the Avisaro device is associated with.
See
here for download and a installation guide for this "Virtual Serial Port" software.
3.2. Any other TCP software
This application transports the data without any modifications over Wifi. Thus, any TCP client can be used on the PC to communicate with the Avisaro device. Examples are the 'good old' Hyperterminal available in Windows XP and older (use 'TCP Socket' instead of serial port during connection setup).
4. Connect to another Avisaro WLAN Device
To connect two Avisaro WLAN Devices, configure one as 'client' the other as 'server' as described above. At the 'client' configuration, enter the IP adress of the 'server'. That's it.
5. More details
5.1. LEDs and Key
Key:
Is used to stop a TCP connection.
Green LED:
Indicates power up. Flashing: Waiting for TCP connection to be established
Red LED:
Indicates a successfull established TCP connection
5.2. Reset to default values
If the module is configured in such a way that it can not be reached via web site or via RS232 connection, there is a back-door:
Power down the module. Press the push button and hold it pressed. Power up the module. Both LEDs will flicker for about 2 minutes and than light up solid. The module is set to above stated default values. Release the button and power down / up the module. If the module with no push button is used, the IO-pin tied to ground can be used.
There is a second way to recover a module
more
5.3. Technical details
Data are transferred without any additional protocols over TCP/IP. Thus, a user can easily write his own host software by simply using direct socket communication.