Moxa Technologies UC-7420/7410 User Manual

Moxa Technologies UC-7420/7410 User Manual

Risc-based communication platforms
Table of Contents

Advertisement

Quick Links

UC-7420/7410 User's Manual
Third Edition, June 2005
www.moxa.com/product
Moxa Technologies Co., Ltd.
Tel: +886-2-8919-1230
Fax: +886-2-8919-1231
Web: www.moxa.com
MOXA Technical Support
Worldwide:
support@moxa.com.tw
The Americas support@moxa.com

Advertisement

Table of Contents
loading

Summary of Contents for Moxa Technologies UC-7420/7410

  • Page 1 UC-7420/7410 User’s Manual Third Edition, June 2005 www.moxa.com/product Moxa Technologies Co., Ltd. Tel: +886-2-8919-1230 Fax: +886-2-8919-1231 Web: www.moxa.com MOXA Technical Support Worldwide: support@moxa.com.tw The Americas support@moxa.com...
  • Page 2: Copyright Notice

    Information provided in this manual is intended to be accurate and reliable. However, Moxa Technologies assumes no responsibility for its use, or for any infringements on the rights of third parties that may result from its use.
  • Page 3: Table Of Contents

    Test Program—Developing Hello.c ... 2-13 Installing the Tool Chain (Linux)... 2-13 Checking the Flash Memory Space ... 2-13 Compiling Hello.c ... 2-14 Uploading “Hello” to UC-7420/7410 and Running the Program... 2-15 Developing Your First Application ... 2-15 Testing Environment ... 2-15 Table of Contents...
  • Page 4 Upgrading the Firmware... 3-2 Loading Factory Defaults ... 3-4 Backing Up the User File System... 3-5 Deploying the User File System to Additional UC-7420/7410 Units ... 3-5 Enabling and Disabling Daemons... 3-6 Setting the Run-Level ... 3-8 Adjusting the System Time ... 3-9 Setting the Time Manually ...
  • Page 5 Windows UC Finder ... 6-2 Installing the Software... 6-2 Broadcast Search ... 6-4 Linux ucfinder... 6-5 Appendix A System Commands... A-1 busybox (V0.60.4): Linux normal command utility collection... A-1 File manager... A-1 Editor... A-1 Network... A-1 Process... A-2 Other... A-2 MOXA special utilities...
  • Page 6: Chapter 1 Introduction

    Welcome to MOXA UC-7420/7410 RISC-based Communication Platforms. Available features include eight RS-232/422/485 serial ports, dual 10/100 Mbps Ethernet ports, a PCMCIA interface for wireless LAN communication, and CompactFlash and USB ports for mass storage disk expansion, making UC-7420/7410 ideal for your embedded applications.
  • Page 7: Overview

    SDRAM give you enough memory to put your application software directly on UC-7420/7410. And since the dual LAN ports are built right into the IXP-422 CPU, UC-7420/7410 makes an ideal communication platform for Network Security applications. If your application requires placing UC-7420/7410 in a location that is not located near an Ethernet LAN connection, you can use UC-7420/7410’s PCMCIA port to attach a wireless LAN card.
  • Page 8: Product Hardware Specifications

    UC-7420/7410 User’s Manual PCMCIA/CompactFlash expansion (UC-7420 only) USB Host for mass storage device (UC-7420 only) LCM display and Keypad for HMI Linux-ready communication platform DIN-Rail or wall mounting installation Robust fanless design Product Hardware Specifications Flash LAN Protection Serial Ports...
  • Page 9: Hardware Introduction

    UC-7420/7410 User’s Manual Hardware Introduction Appearance and Dimensions Appearance UC-7410/7420 Rear View 12-48 VDC Power Input DC 12-48V PCMCIA V+ V- CF x 1 PCMCIA x 1 UC-7410/7420 Top View UC-7410/7420 Front View RS-232/422/485 LAN1 LAN2 Console RS-232 PPP/Console Reset to...
  • Page 10 UC-7420/7410 User’s Manual Introduction Dimensions 197 mm [7.76"]...
  • Page 11: Hardware Block Diagram

    PCI to cardbus controller Bridge PCI Bus Moxa UART ASIC LED Indicators UC-7420/7410 has 12 LED indicators on the top panel. Refer to the following table for information about each LED. LED Name Ready LAN1, LAN2 Console P1, P2, P3, P4,...
  • Page 12: Reset-Type Buttons

    UC-7420/7410’s bottom label. Real Time Clock UC-7420/7410’s real time clock is powered by a lithium battery. We strongly recommend that you do not replace the lithium battery without help from a qualified Moxa support engineer. If you need to change the battery, contact Moxa RMA service team.
  • Page 13: Placement Options

    Use two screws per bracket first to attach the brackets to the bottom of the UC-7420/7410 (Fig. A). Next, use two screws per bracket to attach the UC-7420/7410 to a wall or cabinet (Fig. B).
  • Page 14: Din-Rail Mounting

    DIN-Rail Mounting The aluminum DIN-Rail attachment plate is included in the package. If you need to reattach the DIN-Rail attachment plate to UC-7420/7410, make sure the stiff metal spring is situated towards the top, as shown in the figures below.
  • Page 15: Connecting The Power

    Where necessary, it is strongly advised that you label wiring to all devices in the system. Connecting the Power Connect the 12-48 VDC power line with UC-7420/7410’s terminal block. If the power is properly supplied, the Ready LED will illuminate with a solid green color after 30 to 60 seconds have passed.
  • Page 16: Connecting To A Serial Device

    Connecting to the Console Port UC-7420/7410’s console port is an 8-pin RJ45 RS-232 port. The port can be used to connect to the console utility from a remote console via a V90 or GPRS modem with PPP protocol. The pin definition is the same as for the serial ports (P1 to P8).
  • Page 17: Software Introduction

    UC-7420/7410’s Flash ROM is partitioned into Boot Loader, Linux Kernel, Mini Root File System, and User Root File System partitions. In order to prevent user applications from crashing the Root File System, UC-7420/7410 uses a specially designed Mini File System with Protected Configuration for emergency use. This Mini File System comes with serial and Ethernet communication capability for users to load the Factory Default Image file.
  • Page 18: Journaling Flash File System (Jffs2)

    UC-7420/7410 User’s Manual services and daemons. During this time, the kernel will start searching for system configuration parameters via rc or inittab. Normally, the kernel uses the User Root File System to boot up the system. The Mini Root File System is protected, and cannot be changed by the user, providing a “safe”...
  • Page 19: Software Version Comparison Table

    UC-7420/7410 User’s Manual OS shell command bash Busybox Utilities tinylogin telnet smtpclient Daemons pppd snmpd telnetd inetd ftpd apache sshd nfs-user-server openvpn openssl Linux Tool Chain Gcc (V3.3.2) GDB (V5.3) Glibc (V2.2.5) Windows Tool Chain Gcc (V3.3.2) GDB (V5.3) Glibc(V2.2.5) Insight (V60.1)
  • Page 20 UC-7420/7410 User’s Manual Protocol stacks and utilities Arp (utility) iptable Open VPN WatchDog API Crontable upfirm backupuf backupfs, bf minicom Directory Change /var Apache root document User File User File System System /usr/html /usr/html 1-15 Introduction Replace by tip Change to ramdisk...
  • Page 21: Chapter 2 Getting Started

    In this chapter, we explain how to connect UC-7420/7410, turn on the power, and then get started using the programming and other functions. The following topics are covered in this chapter: Powering on UC-7420/7410 Connecting UC-7420/7410 to a PC Serial Console...
  • Page 22: Powering On Uc-7420/7410

    Connect the SG wire to the Shielded Contact located in the upper left corner of the UC-7420/7410, and then power on UC-7420/7410 by connecting it to the power adaptor. It takes about 30 to 60 seconds for the system to boot up. Once the system is ready, the Ready LED will light up, and the Network address settings will appear on the LCM display.
  • Page 23: Telnet Console

    PC’s IP address and netmask so that your PC is on the same subnet as one of UC-7420/7410’s two LAN ports. For example, if you connect to LAN 1, you can set your PC’s IP address to 192.168.3.126 and netmask to 255.255.255.0. If you connect to LAN 2, you can set your PC’s IP address to 192.168.4.126 and netmask to 255.255.255.0.
  • Page 24: Ssh Console

    When connecting to UC-7420/7410 over a LAN, you must configure your PC’s Ethernet IP address to be on the same subnet as the UC-7420/7410 you wish to contact. If you do not get connected on the first try, re-check the serial and IP settings, and then unplug and re-plug UC-7420/7410’s power cord.
  • Page 25: Configuring The Ethernet Interface

    UC-7420/7410 User’s Manual Linux Users From a Linux machine, use the “ssh” command to access UC-7420/7410’s Console utility via SSH. #ssh 192.168.3.127 Select yes to complete the connection. [root@bee_notebook root]# ssh 192.168.3.127 The authenticity of host ‘192.168.3.127 (192.168.3.127)’ can’t be established.
  • Page 26 UC-7420/7410 User’s Manual Dynamic IP addresses: By default, UC-7420/7410 is configured for “static” IP addresses. To configure one or both LAN ports to request an IP address dynamically, replace static with dhcp and then delete the address, network, netmask, and broadcast lines.
  • Page 27: Modifying Network Settings Over The Network

    After changing the IP settings, use the networking restart command to activate the new IP address. However, the LCM display will still show the old IP address. To update the LCM display, you will need to reboot the UC-7420/7410. Modifying Network Settings over the Network IP settings can be activated over the network, but the new settings will not be saved to the flash ROM without modifying the file /etc/network/interfaces.
  • Page 28 UC-7420/7410 User’s Manual 3. Configure the Wireless LAN card’s default SSID setting profile. (Default SSID is “any”) #vi /etc/wlan/wlan.conf // Consult your network administrator for SSID required in your wireless network. For example, SSID_waln0=”any”, Enable_wlan0=y// 4. Duplicate the configuration profile to a new profile.
  • Page 29: Ieee802.11G

    UC-7420/7410 User’s Manual IEEE802.11g The following IEEE802.11g wireless modules are supported: ASUS—WL-107g CNET—CWC-854 (181D version) Edmiax—EW-7108PCg Amigo—AWP-914W GigaByte—GN-WMGK Other brands that use the Ralink RT2560 series chip set To configure the WLAN for IEEE802.11g: 1. Unplug the CardBus Wireless LAN card first.
  • Page 30 UC-7420/7410 User’s Manual Additional WLAN parameters are contained in the file RT2500STA.dat. To open the file, navigate to the RT2500STA folder and invoke vi, or type the following command #vi /etc/Wireless/RT2500STA/RT2500STA.dat to edit the file with vi editor. Setting options for the various parameters are listed below the figure.
  • Page 31 UC-7420/7410 User’s Manual NetworkType—Sets the wireless operation mode Setting Infra Adhoc Channel—Sets the channel Setting 1 to 14 AuthMode—Sets the authentication mode Setting OPEN SHARED WPAPSK WPANONE EncrypType—Sets encryption type Setting NONE TKIP DefaultKeyID—Sets default key ID Setting 1 to 4 Key1Str, Key2Str, Key3Str, Key4Str—Sets strings Key1 to Key4...
  • Page 32 UC-7420/7410 User’s Manual TurboRate—Enables or disables TurboRate Setting BGProtection—Sets 11b/11g protection (this function is for engineering testing only) Setting ShortSlot—Enables or disables the short slot time Setting TxRate—Sets the TxRate Setting RTSThreshold—Sets the RTS threshold Setting 1 to 2347 FragThreshold—Sets the fragment threshold...
  • Page 33: Test Program-Developing Hello.c

    GNU Tool Chain. Redhat 7.3/8.0, Fedora core, and compatible versions are recommended. The Tool Chain requires about 100 MB of hard disk space on your PC. The UC-7420/7410 Tool Chain software is located on the UC-7420/7410 CD. To install the Tool Chain, insert the CD into your...
  • Page 34: Compiling Hello.c

    If there isn’t enough “Available” space for your application, you will need to delete some existing files. To do this, connect your PC to the UC-7420/7410 with the console cable, and then use the console utility to delete the files from UC-7420/7410’s flash memory.
  • Page 35: Uploading "Hello" To Uc-7420/7410 And Running The Program

    Hello Developing Your First Application We use the tcps2 example to illustrate how to build an application for UC-7420/7410. The procedure outlined in the following subsections will show you how to build a TCP Server program plus serial port communication that runs on the UC-7420/7410.
  • Page 36: Compiling Tcps2.C

    -rw-r—-r-- 1 root root 6164 Nov 27 11:55 tcpsp.c [root@server11 1st_application]# Two executable files, tcps2-release and tcps2-debug, are created. tcps2-release—an IXP platform execution file (created specifically to run on UC-7420/7410) tcps2-debug—an IXP platform GDB debug server execution file (see Chapter 5 for details about the GDB debug tool).
  • Page 37: Uploading Tcps2-Release And Running The Program

    UC-7420/7410 User’s Manual Uploading tcps2-release and Running the Program Use the following commands to use FTP to upload tcps2-release to the UC-7420/7410. 1. From the PC, type: #ftp 192.168.3.127 2. Next, use the bin command to set the transfer mode to Binary, and the put command to initiate the file transfer: ftp>...
  • Page 38 UC-7420/7410 User’s Manual 4. The program should start running in the background. Use either the #jobs or #ps –ef command to check if the tcps2 program is actually running in the background. #jobs // use this command to check if the program is running 192.168.3.127 –...
  • Page 39: Testing Procedure Summary

    2. Upload and run tcps2-release in the background (#./tcps2-release &). 3. Check that the process is running (#jobs or #ps -ef). 4. Use a serial cable to connect PC1 to UC-7420/7410’s serial port 1. 5. Use an Ethernet cable to connect PC2 to UC-7420/7410.
  • Page 40 UC-7420/7410 User’s Manual NOTE The tcps2.c application is a simple example designed to give users a basic understanding of the concepts involved in combining Ethernet communication and serial port communication. However, the example program has some limitations that make it unsuitable for real-life applications.
  • Page 41: Managing Embedded Linux

    System Version Information System Image Backup Upgrating the Firmware Loading Factory Defaults Backing Up the User File System Deploying the User File System to Additional UC-7420/7410 Units Enabling and Disabling Daemons Setting the Run-Level Adjusting the System Time Setting the Time Manually...
  • Page 42: System Version Information

    Moxa’s website (www.moxa.com). The name of the file has the form uc7400-x.x.x.frm, with “x.x.x” indicating the firmware version. To upgrade the firmware, download the firmware file to a PC, and then transfer the file to the UC-7420/7410 unit via a serial Console or Telnet Console connection.
  • Page 43 /dev/ram1 29.0M root@Moxa:~# cd /mnt/ramdisk root@Moxa:/mnt/ramdisk# The following instructions give the steps required to save the firmware file to UC-7420/7410’s RAM disk, and then upgrade the firmware. 1. Type the following commands to enable the RAM disk: #upramdisk #cd /mnt/ramdisk 2.
  • Page 44: Loading Factory Defaults

    UC-7420/7410 User’s Manual 226 Transfer complete. ftp> get UC7420-1.5.frm local: UC7420-1.5.frm remote: UC7420-1.5.frm 200 Port command successful. 150 Opening data connection for UC7420-1.5.frm 226 Transfer complete. 13167772 bytes received in 2.17 secs (5925.8 kB/s) ftp> 3. Next, use the upfirm command to upgrade the kernel and root file system: #upfirm uc7400-x.x.x.frm...
  • Page 45: Backing Up The User File System

    Deploying the User File System to Additional UC-7420/7410 Units For some applications, you may need to ghost one UC-7420/7410 user file system to other UC-7420/7410 units. The specific commands used to carry out this procedure depend on whether the firmware version is earlier or later than version V1.5.
  • Page 46: Enabling And Disabling Daemons

    #bf command. 2. For V1.5 (and later versions), the user can use #upfirm command. Enabling and Disabling Daemons The following daemons are enabled when UC-7420/7410 boots up for the first time. snmpd ...SNMP Agent daemon telnetd ...Telnet Server / Client daemon inetd ...Internet Daemons...
  • Page 47 UC-7420/7410 User’s Manual 192.168.3.127 – PuTTY root@Moxa:~# cd /etc root@Moxa:/etc# ps -ef VmSize Stat Command root root root root root root root root root root root root root root root nobody nobody nobody nobody nobody 104 root 108 root 110 root...
  • Page 48: Setting The Run-Level

    UC-7420/7410 User’s Manual 192.168.3.127 – PuTTY root@Moxa:~# ps -ef VmSize Stat Command root root root root root root root root root root root root root root root nobody nobody nobody nobody nobody root 105 root 109 root 111 root 140 root...
  • Page 49: Adjusting The System Time

    Adjusting the System Time Setting the Time Manually UC-7420/7410 has two time settings. One is the system time, and the other is the RTC (Real Time Clock) time kept by the UC-7420/7410 hardware. Use the #date command to query the current system time or set a new system time.
  • Page 50: Ntp Client

    Thu Dec 9 10:01:08 2004 -0.933547 seconds root@Moxa:~# NTP Client UC-7420/7410 has a built-in NTP (Network Time Protocol) client that is used to initialize a time request to a remote NTP server. Use #ntpdate <this client utility> to update the system time.
  • Page 51: Cron-Daemon To Execute Scheduled Commands

    UC-7420/7410 User’s Manual Save the shell script using any file name. E.g., fixtime How to run the shell script automatically when the kernel boots up Copy the example shell script fixtime to directory /etc/init.d, and then use chmod 755 fixtime to change the shell script mode. Next, use vi editor to edit the file /etc/inittab.
  • Page 52: Connecting Peripherals

    The UC-7420/7410 supports PNP and hot pluggability for connecting a CF mass storage device. UC-7420/7410 has a built-in auto mount utility that eases the mount procedure. The CF mass storage device will be mounted automatically by the mount command to /mnt/hda.
  • Page 53: Chapter 4 Managing Communications

    Managing Communications Chapter 4 In this chapter, we explain how to configure UC-7420/7410’s various communication functions. The following topics are covered in this chapter: Telnet / FTP Web Service Apache — Saving a Web Page to the CF Card IPTABLES...
  • Page 54: Telnet / Ftp

    Disable the daemon by typing ‘#’ in front of the first character of the row to comment out the line. UC-7420/7410 supports DNS client (but not DNS server). To set up DNS client, you need to edit three configuration files: /etc/hosts, /etc/resolv.conf, and /etc/nsswitch.conf.
  • Page 55 UC-7420/7410 User’s Manual Managing Communication /usr/www/cgi-bin/ Before you modify the homepage, use a browser (such as Microsoft Internet Explore or Mozilla Firefox) from your PC to test if the Apache Web Server is working. Type the LAN1 IP address in the browser’s address box to open the homepage.
  • Page 56: Saving A Web Page To The Cf Card

    UC-7420/7410 User’s Manual To open the default CGI test script report page, type http://192.168.3.127/cgi-bin/test-cgi in your browser’s address box. NOTE The CGI function is enabled by default. If you want to disable the function, modify the file /etc/apache/httpd.conf. When you develop your own CGI application, make sure your CGI file is executable.
  • Page 57 Use the following commands to restart the Apache web server: #cd /etc/init.d #./apache restart Step4: Open your browser and connect to the UC-7420/7410 by typing the current LAN1 IP address in the browser’s address box. NOTE Visit the Apache website at an Apache server.
  • Page 58: Iptables

    A rule (such as a jump to a user-defined chain in the same table) is called a “target.” UC-7420/7410 supports 3 types of IPTABLES table: Filter tables, NAT tables, and Mangle tables: A. Filter Table—includes three chains:...
  • Page 59 Filter Table INPUT Chain Local Process Mangle Table OUTPUT Chain NAT Table OUTPUT Chain Filter Table OUTPUT Chain UC-7420/7410 supports the following sub-modules. Be sure to use the module that matches your application. ip_conntrack ip_conntrack_ftp ipt_conntrack_irc ip_nat_ftp ip_nat_irc ip_nat_snmp_basic ip_queue ipt_LOG NOTE UC-7420/7410 does NOT support IPV6 and ipchains.
  • Page 60 #lsmod #modprobe ip_tables #modprobe iptable_filter Use lsmod to check if the ip_tables module has already been loaded in the UC-7420/7410. Use modprobe to insert and enable the module. Use the following command to load the modules (iptable_filter, iptable_mangle, iptable_nat): #modprobe iptable_filter Use iptables, iptables-restore, iptables-save to maintain the database.
  • Page 61 Example 5: Drop TCP packets addressed for port 21. # iptables –A INPUT –i ixp0 –p tcp --dport 21 –j DROP Example 6: Accept TCP packets from 192.168.0.24 to UC-7420/7410’s port 137, 138, 139 # iptables –A INPUT –i ixp0 –p tcp –s 192.168.0.24 --dport 137:139 –j ACCEPT Example 7: Log TCP packets that visit UC-7420/7410’s port 25.
  • Page 62: Nat

    IP addresses used on another network. One network is designated the inside network and the other is the outside network. Typically, UC-7420/7410 connects several devices on a network and maps local inside network addresses to one or more global outside IP addresses, and un-maps the global IP addresses on incoming packets back into local IP addresses.
  • Page 63: Dial-Up Service-Ppp

    Modem / PPP access is almost identical to connecting directly to a network through UC-7420/7410’s Ethernet port. Since PPP is a peer-to-peer system, UC-7420/7410 can also use PPP to link two networks (or a local network to the Internet) to create a Wide Area Network (WAN).
  • Page 64 UC-7420/7410 User’s Manual The pppd options are described below: connect ‘chat etc...’ This option gives the command to contact the PPP server. The ‘chat’ program is used to dial a remote computer. The entire command is enclosed in single quotes because pppd expects a one-word argument for the ‘connect’...
  • Page 65 UC-7420/7410 User’s Manual How to check the connection Once you’ve set up a PPP connection, there are some steps you can take to test the connection. First, type: /sbin/ifconfig (The folder ifconfig may be located elsewhere, depending on your distribution.) You should be able to see all the network interfaces that are UP.
  • Page 66: Nfs (Network File System)

    NFS allows users to develop applications for UC-7420/7410, without worrying about the amount of disk space that will be available. UC-7420/7410 supports NFS protocol for both client and server.
  • Page 67: Setting Up Uc-7420/7410 As An Nfs Client

    Example 1 /tmp *(rw,no_root_squash) In this example, UC-7420/7410 shares the /tmp directory to everyone, gives everyone both read and write authority. The root user on the client machine will have the same level of access to files on the system as the root on the server.
  • Page 68: Mail

    You will need to add your hostname to the file /etc/hosts. SNMP UC-7420/7410 has built-in SNMP V1 (Simple Network Management Protocol) agent software. It supports RFC1317 RS-232 like group and RFC 1213 MIB-II. The following simple example allows you to use an SNMP browser on the host site to query the UC-7420/7410, which is the SNMP agent.
  • Page 69: Open Vpn

    UC-7420/7410 does NOT support SNMP trap. The following tables list the variables supported by UC-7420/7410. Open VPN This function is only available for firmware version V1.5 (and later versions). OpenVPN provides two types of tunnels for users to implement VPNS: Routed IP Tunnels and Bridged Ethernet Tunnels.
  • Page 70 UC-7420/7410 User’s Manual Setup 1: Ethernet Bridging for Private Networks on Different Subnets 1. Set up four machines, as shown in the following diagram. Host A eth0: 192.168.2.171 eth0: 192.168.4.172 Host B Host A (B) represents one of the machines that belongs to OpenVPN A (B). The two remote subnets are configured for a different range of IP addresses.
  • Page 71 UC-7420/7410 User’s Manual i=`expr $i + 1` read f1 f2 case “$f1” in address ) IPADDR=$f2 netmask ) NETMASK=$f2 broadcast ) BROADCAST=$f2 esac done break done < /etc/network/interfaces # get the ip address of the specified interface mname= module_up() oIFS=$IFS IFS=‘...
  • Page 72 UC-7420/7410 User’s Manual # connect tap device to the bridge brctl addif br0 tap${i} # null ip address of tap device ifconfig tap${i} 0.0.0.0 promisc up i=`expr $i + 1` if [ $i -ge $maxtap ]; then break done # null ip address of internal interface ifconfig $iface 0.0.0.0 promisc up...
  • Page 73 UC-7420/7410 User’s Manual 4. Create a configuration file named A-tap0-br.conf and an executable script file named A-tap0-br.sh on OpenVPN A. # point to the peer remote 192.168.8.174 dev tap0 secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40 up /etc/openvpn/A-tap0-br.sh...
  • Page 74 UC-7420/7410 User’s Manual virtual device, it sends the traffic to its peer. 7. To create an indirect connection to Host B from Host A, you need to add the following routing item: route add –net 192.168.4.0 netmask 255.255.255.0 dev eth0...
  • Page 75 UC-7420/7410 User’s Manual Setup 3: Routed IP 1. Set up four machines as shown in the following diagram: Host A eth0: 192.168.2.171 eth0: 192.168.4.172 Host B 2. Create a configuration file named “A-tun.conf” and an executable script file named “A-tun.sh”.
  • Page 76 UC-7420/7410 User’s Manual Note that the parameter “ifconfig” defines the first argument as the local internal interface and the second argument as the internal interface at the remote peer. Note that $5 is the argument that the OpenVPN program passes to the script file. Its value is the second argument of ifconfig in the configuration file.
  • Page 77: Chapter 5 Programmer's Guide

    This chapter includes important information for programmers. This following functions are covered in this chapter: Flash Memory Map Linux Tool Chain Introduction Debug with GDB Device API RTC (Real Time Clock) Buzzer WDT (Watch Dog Timer) UART KeyPad Make File Example Programmer’s Guide Chapter 5...
  • Page 78: Flash Memory Map

    Redhat 7.3/8.0/9.0, Fefora core 1 & 2. The Tool Chain will need about 100 MB of hard disk space on your PC. The UC-7420/7410 Tool Chain is located on the UC-7420/7410 CD. To install the Tool Chain, insert the CD into your PC...
  • Page 79: Debugging With Gdb

    In the case of x86 environments, the prefix is i386-linux- and in the case of UC-7420/7410 Xscale boards, it is mxscaleb-. For example the native C compiler is gcc and the cross C compiler for Xscale in UC-7420/7410 is mxscaleb-gcc.
  • Page 80: Device Api

    5. Set a breakpoint on main by double clicking, or entering 6. Click the cont button Device API UC-7420/7410 supports control devices with the ioctl system API. You will need to include <moxadevice.h>, and use the following ioctl function. int ioctl(int d, int request,…);...
  • Page 81: Wdt (Watch Dog Timer)

    UC-7420/7410 User’s Manual WDT (Watch Dog Timer) This function is only available for firmware version V1.5 (and later versions). 1. Introduction The WDT works like a watch dog function. You can enable it or disable it. When the user enables WDT but the application does not acknowledge it, the system will reboot. You can set the ack time from a minimum of 50 msec to a maximum of 60 seconds.
  • Page 82 UC-7420/7410 User’s Manual int swtd_disable(int fd) Description: Disable the application to ack sWatchDog. And the kernel will be auto ack it. User does not to do it at periodic. Input : int fd Output: OK will be zero. The other has some error, to get error code from errno.
  • Page 83 UC-7420/7410 User’s Manual int swtd_close(int fd) Description: Close the file handle. Input : int fd Output: OK will be zero. The other has some error, to get error code from errno(). 4. Special Note When you “kill the application with -9” or “kill without option” or “Ctrl+c” the kernel will change to auto ack the sWatchDog.
  • Page 84 UC-7420/7410 User’s Manual #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/select.h> #include <sys/time.h> #include <moxadevice.h> static void mydelay(unsigned long msec) struct timeval time; time.tv_sec = msec / 1000; time.tv_usec = (msec % 1000) * 1000; select(1, NULL, NULL, NULL, &time); static int swtdfd;...
  • Page 85: Uart

    /dev/cum0 … cum7. UC-7420/7410 supports Linux standard termios control. The Moxa UART Device API allows you to configure ttyM0 to ttyM7 as RS-232, RS-422, 4-wire RS-485, or 2-wire RS-485. UC-7420/7410 supports RS-232, RS-422, 2-wire RS-485, and 4-wire RS485.
  • Page 86: Lcm

    2. If you use stty to get the serial information, you will get speed equal to 0. UC-7420/7410 only supports text mode display, with screen size of 16 cols by 8 rows. The device node is /dev/lcm. See the examples given below. We provide a private struct defined as follows: typedef struct lcm_xy { int x;...
  • Page 87: Make File Example

    UC-7420/7410 User’s Manual Special Note 1. UC-7420/7410’s kernel will store the “pressed key history” in a buffer. The maximum buffer size is 31 keys. If the buffer overflows, the first key of the 31 that was pressed will be dropped, without sounding the buzzer.
  • Page 88: Chapter 6 Uc Finder

    UC Finder works by sending a broadcast message over the LAN to search for UC-7420/7410 MAC addresses. It will then query the UC-7420/7410’s for their IP addresses. Two versions of UC Finder are provided. The GUI version works in Windows environments, and the command line utility works in Linux environments.
  • Page 89: Windows Uc Finder

    UC-7420/7410 User’s Manual Windows UC Finder The UC Finder utility is used to search the LAN or intranet for Moxa Universal Communicators. Installing the Software 1. Once the Setup program starts running, click on Next to proceed. 2. Click on Next when the Select Additional Tools window opens to proceed with the installation.
  • Page 90 UC-7420/7410 User’s Manual UC Finder 3. Click on Next to install program files in the default directory, or select an alternative location. 4. Click on Finish to complete the installation of UC Finder.
  • Page 91: Broadcast Search

    UC-7420/7410 User’s Manual Broadcast Search The Broadcast Search function is used to locate all UC-7420/7410 units that are connected to the same LAN as your Windows computer. Since the Broadcast Search function searches by MAC address and not IP address, all UC-7420/7410s connected to the LAN will be found, regardless of whether or not they are on the same subnet as the host.
  • Page 92: Linux Ucfinder

    Linux ucfinder Copy ucfinder from the Documentation and Software CD to your Linux PC, and then use the following command to start the program. UC Finder will automatically locate all UC-7420/7410 units on the LAN, and then report their IP addresses.
  • Page 93: Appendix A System Commands

    busybox (V0.60.4): Linux normal command utility collection File manager 1. cp 2. ls 3. ln 4. mount 5. rm 6. chmod 7. chown 8. chgrp 9. sync 10. mv 11. pwd 12. df 13. mkdir 14. rmdir Editor 1. vi 2.
  • Page 94: Process

    UC-7420/7410 User’s Manual Process 1. kill 2. ps Other 1. dmesg 2. sty 3. zcat 4. mknod 5. free 6. date 7. env 8. clear 9. reboot 10. halt 11. du 12. gzip, gunzip 13. hostname MOXA special utilities 1. backupfs 2.
  • Page 95: Appendix B Windows Tool Chain Introduction

    Windows Tool Chain Introduction Appendix B UC-7420/7410’s Windows Tool Chain is a cross development environment that simulates the Linux root file system, allowing users to develop applications on a Windows PC. The following topics are covered in this appendix. Introduction...
  • Page 96: Introduction

    UC-7420/7410 User’s Manual Introduction UC-7420/7410’s Windows Tool Chain is a cross development environment that simulates the Linux root file system, allowing users to develop applications in a Windows environment. Install the Windows tool chain to set up a Linux-like environment on your Windows machine. The following figure shows an example of what the Windows Tool Chain environment looks like.
  • Page 97: Installation Procedure

    UC-7420/7410 User’s Manual Installation Procedure 1. Insert the CD into your PC’s CD-ROM drive, and run \\tool-chain\windows\compiler\setup.exe to start installation. Once the Setup program starts running, click on Next to proceed. 2. Select the Root Directory. Note If the directory C:\UC was created during a previous installation, it will be displayed as the Root Directory.
  • Page 98 UC-7420/7410 User’s Manual 3. By default, the Local Package Directory is the same as on the CD-ROM: \\tool-chain\windows\compiler. Click on Next to proceed. Note: It may take anywhere from 5 to 20 minutes to check the packages in the CD-ROM after you click on Next.
  • Page 99 UC-7420/7410 User’s Manual Base Category: List all packages that will be installed by default (along with any dependencies). If you view the Base column for the Base category, you should see every package selected for installation. Packages: In the packages listing field, package names are arranged by Category/Full/Partial according to the View by button.
  • Page 100: Using The Bash Shell

    UC-7420/7410 User’s Manual 6. Checkmark Create icon on Desktop to place a Moxa BASH Shell icon on your desktop, and then click on Finish. 7. Click on OK to close the Installation Complete window. Using the BASH Shell A command-line interface is used to develop applications with the tool chain. To access the command line, you need to launch a BASH shell window.
  • Page 101: Gdb Debug Tool-Insight

    UC-7420/7410 User’s Manual -rwxr—xr-x 1 stephen_ mkpasswd -rw-r--r-- 1 stephen_ mkpasswd drwxr—xr-x 2 stephen_ mkpasswd drwxr—xr-x 14 stephen_ mkpasswd drwxr—xr-x 6 stephen_ mkpasswd stephen_lin@abc-06d82fcbf1a / GDB debug tool—Insight Insight is a graphical user interface that accompanies GDB, the GNU Debugger written in Tcl/Tk by people working at Red Hat, Inc., and Cygnus Solutions.
  • Page 102 UC-7420/7410 User’s Manual Windows Tool Chain Introduction...
  • Page 103: Appendix C Service Information

    This appendix shows you how to contact Moxa for information about this and other products, and how to report problems. The following topics are covered in this appendix: MOXA Internet Services Problem Report Form Product Return Procedure Service Information Appendix C...
  • Page 104: Moxa Internet Services

    UC-7420/7410 User’s Manual MOXA Internet Services Customer satisfaction is our number one concern, and to ensure that customers receive the full benefit of our products, Moxa Internet Services has been set up to provide technical support, driver updates, product information, and user’s manual updates.
  • Page 105: Problem Report Form

    UC-7420/7410 User’s Manual Problem Report Form Customer name: Company: Tel: Email: 1. Moxa Product: UC-7410-LX 2. Serial Number: _________________ Problem Description: Please describe the symptoms of the problem as clearly as possible, including any error messages you see. A clearly written description of the problem will allow us to reproduce the symptoms, and expedite the repair of your product.
  • Page 106: Product Return Procedure

    UC-7420/7410 User’s Manual Product Return Procedure For product repair, exchange, or refund, the customer must: Provide evidence of original purchase. Obtain a Product Return Agreement (PRA) from the sales representative or dealer. Fill out the Problem Report Form (PRF). Include as much detail as possible for a shorter product repair time.

This manual is also suitable for:

Uc-7420Uc-7410

Table of Contents