Moxa Tech Note

Fixed TTY Driver for NPort

Fixed TTY Driver for NPort
Moxa Technical Support Teamsupport@moxa.com

This Tech Note applies to the following NPort device server models:
••
•
•••
•
••
•
•
•
••

NPort DE-211
NPort DE-311
NPort DE-311M
NPort 5100 series
NPort 5200 series
NPort 5400 series
NPort 5600 series
NPort IA5150
NPort IA5250
NPort 6000 series
NPort W2150
NPort W2150 Plus
NPort W2250
NPort W2250 Plus

All of these products support the following UNIX operating systems:
••••
•
•
••
•

SCO UNIXSCO OpenServer 5
SCO OpenServer 6UnixWare 7Solaris 10
QNX4.25QNX6FreeBSD 5.x
FreeBSD 6Copyright © 2008 Moxa Inc.

Released on July 15, 2008

About Moxa
Moxa manufactures one of the world’s leading brands of device networking solutions. Products include serialboards, USB-to-serial hubs, media converters, device servers, embedded computers, Ethernet I/O products,terminal servers, Modbus gateways, industrial switches, and Ethernet-to-fiber converters. Our products are key
components of many networking applications, including industrial automation, manufacturing, POS, and medical
treatment facilities.

How to Contact Moxa
Tel:1-714-528-6777
Fax: 1-714-528-6778

Web: www.moxa.com
Email: info@moxa.com

This document was produced by the Moxa Technical Writing Center (TWC). Please send your comments orsuggestions about this or other Moxa documents to twc@moxa.com.

Moxa Tech Note

Fixed TTY Driver for NPort

What is the Fixed TTY Driver for NPort?
After installing the fixed TTY driver on your UNIX machine, a UNIX TTY device canbe redirected to an NPort serial port. In other words, a device attached to theNPort can be treated as a local TTY device on the UNIX PC.
Ethernet

PC with TTY(termio) program

SerialNPortDevice

Installing the Fixed TTY Driver for NPort
Before performing the following steps, restore the NPort's default settings byholding down the reset button for 10 seconds.
1.

Make sure that DIP switch 1 is set to OFF (applies to DE-211 and DE-311).

2.

Modify the DIP switch settings for serial communication as required for yourdevice.

3.

Turn on the NPort. The Ready LED should turn green.

4.

Make sure that the NPort and the host PC are properly connected to thenetwork.

5.

Adjust the NPort's IP settings so that it is on the same subnet as your PC.
You may also need to modify the host PC's IP configuration. Ping from thePC to the NPort to verify that they are on the same subnet.
Note: The IP addresses of the NPort and the PC must be on the same subnet.
If one IP address is modified, you may need to modify the other IP address
as well.

6.

Configure the NPort for Real COM Mode and then configure the serialinterface and communication parameters. Refer to instructions in theNPort's Quick Installation Guide or User's Manual for details.

7.

Log into UNIX and create a directory for the Moxa fixed TTY driver. For
example, execute the following command to create the directory/user/etc:# mkdir /usr/etc

8.

Use the following commands to copy moxattyd.tar to the new directory:# cp moxattyd.tar /usr
# cd /usr/etc

Copyright © 2008 Moxa Inc.

Page 2 of 4

Moxa Tech Note

9.

Fixed TTY Driver for NPort

Use the following commands to extract the source files:# tar xvf moxattyd.tar# cd /usr/etc/moxattyd

10.

Follow your operating system's instructions for compiling and linking thesource files:
QNX4
QNX6
SCO OpenServer 6
SCO OpenServer 5
SolarisFreeBSD
UnixWare 711.

Verify that the configuration is correct by using a text editor (vi, for example)
to open the text file moxattyd.cf, which is located in the directory that
contains the moxattyd deamon. The IP:port mapping for TTY devices willappear as shown below:
ttyp1112.

# make qnx4
# make qnx6
# make sco6
# make sco# make sun# make freebsd# make svr5

192.168.127.254

950

Use the following command to start the moxattyd daemon:# /usr/etc/moxattyd/moxattyd –t 1
The optional "-t" parameter is used to indicate the connection timeout value,measured in minutes.

13.

To start the moxattyd daemon automatically on system bootup, add anentry to the appropriate system file. For SCO OpenServer 5 and 6, Solaris,
and UnixWare 7, add the following entry to the file /etc/inittab:
ts:234:respawn:/usr/etc/moxattyd/moxattyd -t 1
For QNX4, QNX6, and FreeBSD, add an entry to the appropriate system fileas follows:
OSQNX4QNX6FreeBSD

Copyright © 2008 Moxa Inc.

File/etc/Config/sysinit.1/etc/rc.d/rc.local/etc/rc.local

Add this entry/usr/etc/moxattyd/moxattyd –t 1

Page 3 of 4

Moxa Tech Note

Fixed TTY Driver for NPort

Testing Fixed TTY Ports
1.

After installing the Fixed TTY driver as described above, enter the following
command to verify that a TTY port is available:# sty –a < /dev/ttyp1

2.

If the system responds with some serial parameter(s), the TTY port isavailable and can be accessed by other programs.

Cable Wiring

Copyright © 2008 Moxa Inc.

Page 4 of 4