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 support@moxa.com.tw Worldwide: The Americas support@moxa.
UC-7420/7410 User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms of that agreement. Copyright Notice Copyright © 2005 Moxa Technologies Co., Ltd. All rights reserved. Reproduction without permission is prohibited. Trademarks MOXA is a registered trademark of The Moxa Group. All other trademarks or registered marks in this manual belong to their respective manufacturers.
Table of Contents Chapter 1 Introduction ..................................................................................................1-1 Overview.................................................................................................................................. 1-2 Package Checklist....................................................................................................... 1-2 Product Features ...................................................................................
Compiling tcps2.c..................................................................................................... 2-16 Uploading tcps2-release and Running the Program ................................................. 2-17 Testing Procedure Summary .................................................................................... 2-19 Chapter 3 Managing Embedded Linux ........................................................................3-1 System Version Information...............................
Windows UC Finder ................................................................................................................ 6-2 Installing the Software................................................................................................ 6-2 Broadcast Search ........................................................................................................ 6-4 Linux ucfinder.................................................................................................................
1 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.
UC-7420/7410 User’s Manual Introduction Overview UC-7420/7410 RISC-based Communication Platforms are ideal for embedded applications. UC-7420/7410 has eight RS-232/422/485 serial ports, dual 10/100 Mbps Ethernet ports, a PCMCIA interface for wireless LAN communication, and CompactFlash and USB port for mass storage flash disk expansion. UC-7420/7410 uses an Intel XScale IXP-422 266 Mhz RISC CPU.
UC-7420/7410 User’s Manual y y y y y y Introduction 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 CPU RAM Flash LAN LAN Protection Serial Ports Serial Protection Data bits Stop bits Parity Flow Control Speed Serial Console/PPP USB 2.0 Host USB 1.
UC-7420/7410 User’s Manual Introduction Hardware Introduction Appearance and Dimensions Appearance UC-7410/7420 Rear View 12-48 VDC Power Input 10/100 Mbps Ethernet x 2 DC 12-48V PCMCIA LAN1 USB LAN2 Console USB 2.0 Host x 2, A Type Connector CF V+ V- CF x 1 RS-232 PPP/Console PCMCIA x 1 USB 1.
UC-7420/7410 User’s Manual Introduction 44 mm [1.73"] 125 mm [4.92"] Dimensions 197 mm [7.
UC-7420/7410 User’s Manual Introduction Hardware Block Diagram The following block diagram shows the layout of UC-7420’s internal components (the layout for UC-7410 is slightly different).
UC-7420/7410 User’s Manual Introduction Reset-type Buttons UC-7420/7410 has two reset-type buttons. The button labeled Reset has the same effect as unplugging the power and then plugging the power back in. The button labeled Reset to default returns UC-7420/7410 to the factory default parameter configuration. Reset Button Pressing the Reset button initiates a hardware reboot. The button plays the same role as a desktop PC’s reset button. In normal use, you should NOT use the Reset Button.
UC-7420/7410 User’s Manual Introduction Placement Options Wall or Cabinet The two metal brackets that come standard with UC-7420/7410 are used to attach UC-7420/7410 to a wall, or the inside of a cabinet. 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).
UC-7420/7410 User’s Manual Introduction 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. 1. Insert the top of the DIN-Rail into the slot just below the stiff metal spring. 2. The DIN-Rail attachment unit will snap into place as shown below.
UC-7420/7410 User’s Manual Introduction You can use the type of signal transmitted through a wire to determine which wires should be kept separate. The rule of thumb is that wiring that shares similar electrical characteristics can be bundled together. Keep input wiring and output wiring separate. Where necessary, it is strongly advised that you label wiring to all devices in the system. y y y Connecting the Power Connect the 12-48 VDC power line with UC-7420/7410’s terminal block.
UC-7420/7410 User’s Manual Introduction Connecting to a Serial Device Use properly wired serial cables to connect UC-7420/7410 to serial devices. UC-7420/7410’s serial ports (P1 to P8) use 8-pin RJ45 connectors. The ports can be configured by software for RS-232, RS-422, or 2-wire RS-485.
UC-7420/7410 User’s Manual Introduction Software Introduction Software Architecture The Linux operating system that is pre-installed in UC-7420/7410 follows the standard Linux architecture, making it easy to port programs that follow the POSIX standard to UC-7420/7410. Porting is done with the GNU Tool Chain provided by Moxa.
UC-7420/7410 User’s Manual Introduction 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” zone. The kernel will only use the Mini Root File System when the User Root File System crashes.
UC-7420/7410 User’s Manual Introduction OS shell command bash Busybox Linux normal command utility collection Utilities tinylogin login and user manager utility telnet telnet client program ftp FTP client program smtpclient email utility scp Secure file transfer Client Program Daemons pppd dial in/out over serial port daemon snmpd snmpd agent daemon telnetd telnet server daemon inetd TCP server manager program ftpd ftp server daemon apache web server daemon sshd secure shell server nfs-user-server network
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 Introduction N/A N/A N/A N/A N/A N/A N/A Yes Yes User File System /usr/html 1-15 Yes N/A N/A N/A N/A N/A N/A Yes Yes Yes Yes Yes Yes Yes Yes Yes N/A Replace by tip User File System Change to ramdisk /usr/html /usr/www
2 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.
UC-7420/7410 User’s Manual Getting Started 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.
UC-7420/7410 User’s Manual Getting Started Telnet Console If you know at least one of the two IP addresses and netmasks, then you can use Telnet to connect to UC-7420/7410’s console utility. The default IP address and Netmask for each of the two ports are given below: Default IP Address Netmask 192.168.3.127 255.255.255.0 LAN 1 192.168.4.127 255.255.255.0 LAN 2 Use a cross-over Ethernet cable to connect directly from your PC to UC-7420/7410.
UC-7420/7410 User’s Manual Getting Started ATTENTION Serial Console Reminder Remember to choose VT100 as the terminal type. Use cable CBL-RJ45F9-150, which comes with UC-7420/7410, to connect to the serial console port. Telnet Reminder 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.
UC-7420/7410 User’s Manual Getting Started 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. RSA key fingerprint is 8b:ee:ff:84:41:25:fc:cd:2a:f2:92:8f:cb:1f:6b:2f.
UC-7420/7410 User’s Manual Getting Started 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. Default Setting for LAN1 iface ixp0 inet static address 192.168.3.127 network: 192.168.3.0 netmask 255.255.255.0 broadcast 192.168.3.255 3.
UC-7420/7410 User’s Manual NOTE Getting Started 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.
UC-7420/7410 User’s Manual 3. Getting Started 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. #cp /etc/wlan/wlancfg-DEFAULT /etc/wlan/wlancfg-any // Copy configuration profile “DEFAULT” to new configuration profile “any”// 5.
UC-7420/7410 User’s Manual Getting Started IEEE802.11g The following IEEE802.11g wireless modules are supported: y y y y y y 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. 2. Use the command #vi /etc/networking/interfaces to open the “interfaces” configuration file with vi editor, and then edit the 802.
UC-7420/7410 User’s Manual 3. Getting Started 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.
UC-7420/7410 User’s Manual Getting Started NetworkType—Sets the wireless operation mode Setting Explanation Infra Infrastructure mode (uses access points to transmit data) Adhoc Adhoc mode (transmits data from host to host) Channel—Sets the channel Setting Explanation 0 auto 1 to 14 the channel you want to use AuthMode—Sets the authentication mode Setting OPEN SHARED WPAPSK WPANONE EncrypType—Sets encryption type Setting NONE WEP TKIP AES DefaultKeyID—Sets default key ID Setting 1 to 4 Key1Str, Ke
UC-7420/7410 User’s Manual Getting Started TurboRate—Enables or disables TurboRate Setting Explanation 0 disable 1 enable BGProtection—Sets 11b/11g protection (this function is for engineering testing only) Setting Explanation 0 auto 1 always on 2 always off ShortSlot—Enables or disables the short slot time Setting Explanation 0 disable 1 enable TxRate—Sets the TxRate Setting Explanation 0 Auto 1 1 Mbps 2 2 Mbps 3 5.
UC-7420/7410 User’s Manual Getting Started Test Program—Developing Hello.c In this section, we use the standard “Hello” programming example to illustrate how to develop a program for UC-7420/7410. In general, program development involves the following seven steps. Step 1: Connect UC-7420/7410 to a Linux PC. Step 2: Install Tool Chain (GNU Cross Compiler & glibc). Step 3: Set the cross compiler and glibc environment variables. Step 4: Code and compile the program.
UC-7420/7410 User’s Manual Getting Started 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. NOTE If the flash memory is full, you will need to free up some memory space before saving files to the Flash ROM. Compiling Hello.c The UC-7420/7410 CD contains several example programs.
UC-7420/7410 User’s Manual Getting Started Uploading “Hello” to UC-7420/7410 and Running the Program Use the following command to upload hello-release to the UC-7420/7410 via FTP. 1. From the PC, type: #ftp 192.168.3.127 2. Use bin command to set the transfer mode to Binary mode, and the put command to initiate the file transfer: ftp> bin ftp> put hello-release 3. From the UC-7420/7410, type: # chmod +x hello-release # ./hello-release The word Hello will be printed on the screen. root@Moxa:~# .
UC-7420/7410 User’s Manual Getting Started Compiling tcps2.c The source code for the tcps2 example is located on the CD-ROM at CD-ROM://example/TCPServer2/tcps2.c. Use the following commands to copy the file to a specific directory on your PC. We use the direrctory /home/uc7400/1st_application/. Note that you need to copy 3 files—Makefile, tcps2.c, tcpsp.c—from the CD-ROM to the target directory. #mount –t iso9660 /dev/cdrom /mnt/cdrom #cp /mnt/cdrom/example/TCPServer2/tcps2.
UC-7420/7410 User’s Manual Getting Started 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> bin ftp> put tcps2-release root@server11:/home/uc7400/1st_application [root@server11 1st_application]# ftp 192.168.3.127 Connected to 192.168.3.
UC-7420/7410 User’s Manual 4. Getting Started 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.
UC-7420/7410 User’s Manual 158 root 162 root 163 root 169 root 187 root 188 root root@Moxa:~# NOTE Getting Started 1532 3652 2208 2192 1264 1592 S S S S S S /sbin/getty 115200 ttyS1 /usr/sbin/sshd -bash ftpd: 192.168.3.110: root: IDLE ./tcps2-release ps -ef Use the kill -9 command for PID 187 to terminate this program: #kill -9 %187 Testing Procedure Summary 1. 2. 3. 4. 5. 6. 7. 8. 9. Compile tcps2.c (#make). Upload and run tcps2-release in the background (#./tcps2-release &).
UC-7420/7410 User’s Manual NOTE Getting Started 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. 1. 2. The serial port is in canonical mode and block mode, making it impossible to send data from the Ethernet side to the serial side (i.e.
3 Chapter 3 Managing Embedded Linux This chapter includes information about version control, deployment, updates, and peripherals. The information in this chapter will be particularly useful when you need to run the same application on several UC-7420/7410 units.
UC-7420/7410 User’s Manual Managing Embedded Linux System Version Information To determine the hardware capability of your UC-7420/7410, and what kind of software functions are supported, check the version numbers of your UC-7420/7410’s hardware, kernel, and user file system. Contact Moxa to determine the hardware version. You will need the Production S/N (Serial number), which is located on UC-7420/7410’s bottom label.
UC-7420/7410 User’s Manual Managing Embedded Linux Since different Flash disks have different sizes, it’s a good idea to check the size of your Flash disk before upgrading the firmware, or before using the disk to store your application and data files. Use the #df –h command to list the size of each memory block, and how much free space is available in each block. 192.168.3.127 – PuTTY root@Moxa:~# df -h Filesystem Size Used Available Use% Mounted on /dev/mtdblock3 26.0M 8.9M 17.
UC-7420/7410 User’s Manual Managing Embedded Linux 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 192.168.3.127 – PuTTY root@Moxa:/mnt/ramdisk# upfirm UC7420-1.5.frm Upgrade firmware utility version 1.0.
UC-7420/7410 User’s Manual Managing Embedded Linux Backing Up the User File System 1. Create a backup file. The specific commands used to back up the user file system depend on whether the firmware version is earlier or later than version V1.5. Firmware versions earlier than V1.5 (not including V1.5) #upramdisk #backupfs /mnt/ramdisk/usrdisk Firmware version V1.
UC-7420/7410 User’s Manual Managing Embedded Linux Back up the user file system to a PC (refer to the previous subsection, “Backing Up the User File System,” for instructions), and then type the following commands to copy the backup to additional UC-7420/7410 units. #upramdisk #cd /mnt/ramdisk #upfirm usrfs-backup 192.168.3.
UC-7420/7410 User’s Manual Managing Embedded Linux 192.168.3.
UC-7420/7410 User’s Manual Managing Embedded Linux 192.168.3.
UC-7420/7410 User’s Manual Managing Embedded Linux SxxRUNFILE stands for S: start the run file while linux boots up. xx: a number between 00-99. The smaller number has a higher priority. RUNFILE: the file name. 192.168.3.127 – PuTTY root@Moxa:/ect/rc.d/rc3.d# ls S19nfs-common S25nfs-user-server S99showreadyled S20snmpd S55ssh S24pcmcia S99rmnologin root@Moxa:/ect/rc.d/rc3.d# ln –s /root/tcps2-release S60tcps2 root@Moxa:/ect/rc.d/rc3.
UC-7420/7410 User’s Manual Managing Embedded Linux 192.168.3.127 – PuTTY root@Moxa:~# date Fri Jun 23 23:30:31 CST 2000 root@Moxa:~# hwclock Fri Jun 23 23:30:35 2000 -0.557748 seconds root@Moxa:~# date 120910002004 Thu Dec 9 10:00:00 CST 2004 root@Moxa:~# hwclock –w root@Moxa:~# date ; hwclock Thu Dec 9 10:01:07 CST 2004 Thu Dec 9 10:01:08 2004 -0.
UC-7420/7410 User’s Manual Managing Embedded Linux 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. Add the following line to the bottom of the file: ntp : 2345 : respawn : /etc/init.d/fixtime Use the command #init q to re-init the kernel.
UC-7420/7410 User’s Manual Managing Embedded Linux Connecting Peripherals USB Mass Storage This function is only available for firmware version V1.5 (and later versions). The UC-7420/7410 supports PNP (plug-n-play), and hot pluggability for connecting USB mass storage devices. UC-7420/7410 has a built-in auto mount utility that eases the mount procedure.
4 Chapter 4 Managing Communications In this chapter, we explain how to configure UC-7420/7410’s various communication functions.
UC-7420/7410 User’s Manual Managing Communication Telnet / FTP In addition to supporting Telnet client/server and FTP client/server, the UC-7420/7410 system also supports SSH and sftp client/server. To enable or disable the Telnet/ftp server, you first need to edit the file /etc/inetd.conf. Enabling the Telnet/ftp server The following example shows the default content of the file /etc/inetd.conf.
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. E.g., if the default IP address is still active, type http://192.168.3.127 in address box. To open the default CGI page, type http://192.168.3.127/cgi-bin/printenv in your browser’s address box.
UC-7420/7410 User’s Manual Managing Communication 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. 192.168.3.
UC-7420/7410 User’s Manual Managing Communication Step 2: Use the following commands to configure the Apache web server’s DocumentRoot: #cd /etc/apache #vi httpd.conf …… DocumentRoot “/mnt/hda” //Change the document root directory //to your CF card. …… 192.168.3.127 – PuTTY ServerRoot “/etc/apache” PidFile /var/run/httpd.pid ScoreBoardFile /var/run/httpd.
UC-7420/7410 User’s Manual Managing Communication IPTABLES IPTABLES is an administrative tool for setting up, maintaining, and inspecting the Linux kernel’s IP packet filter rule tables. Several different tables are defined, with each table containing built-in chains and user-defined chains. Each chain is a list of rules that apply to a certain type of packet. Each rule specifies what to do with a matching packet. A rule (such as a jump to a user-defined chain in the same table) is called a “target.
UC-7420/7410 User’s Manual Managing Communication Incoming Packets Mangle Table PREROUTING Chain NAT Table PREROUTING Chain Local Host Packets Other Host Packets Mangle Table INPUT Chain Mangle Table FORWARD Chain Filter Table INPUT Chain Filter Table FORWARD Chain Local Process Mangle Table POSTROUTING Chain Mangle Table OUTPUT Chain NAT Table OUTPUT Chain Filter Table OUTPUT Chain NAT Table POSTROUTING Chain Outgoing Packets UC-7420/7410 supports the following sub-modules.
UC-7420/7410 User’s Manual Managing Communication The basic syntax to enable and load an IPTABLES module is as follows: #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.
UC-7420/7410 User’s Manual Managing Communication OUTPUT: For locally-generated packets. FORWARD: For packets routed out through the UC-7420/7410. PREROUTING: To alter packets as soon as they come in. POSTROUTING: To alter packets as they are about to be sent out.
UC-7420/7410 User’s Manual Managing Communication NAT NAT (Network Address Translation) protocol translates IP addresses used on one network different 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.
UC-7420/7410 User’s Manual Managing Communication # Step 1. Insert modules. # Here 2> /dev/null means the standard error messages will be dump to null device. modprobe ip_tables 2> /dev/null modprobe ip_nat_ftp 2> /dev/null modprobe ip_nat_irc 2> /dev/null modprobe ip_conntrack 2> /dev/null modprobe ip_conntrack_ftp 2> /dev/null modprobe ip_conntrack_irc 2> /dev/null # Step 2. Define variables, enable routing and erase default rules.
UC-7420/7410 User’s Manual Managing Communication 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’ option. The options for ‘chat’ are given below: -v verbose mode; log what we do to syslog “ “ Double quotes—don’t wait for a prompt, but instead do ...
UC-7420/7410 User’s Manual Managing Communication 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.
UC-7420/7410 User’s Manual Managing Communication Setting up a Machine for Incoming PPP Connections This first example applies to using a modem, and requiring authorization with a username and password. pppd/dev/ttyM0 115200 crtscts modem 192.168.16.1:192.168.16.2 login auth You should also add the following line to the file /etc/ppp/pap-secrets: * * “” * The first star (*) lets everyone login. The second star (*) lets every host connect.
UC-7420/7410 User’s Manual Managing Communication no_root_squash If no_root_squash is selected, then the root on the client machine will have the same level of access to files on the system as the root on the server. This can have serious security implications, although it may be necessary if you want to do administrative work on the client machine that involves the exported directories. You should only specify this option when you have a good reason.
UC-7420/7410 User’s Manual Managing Communication Steps 2 & 3: #mkdir #mount –p –t /home/nfs/public nfs NFS_Server(IP):/directory /mount/point Example : #mount –t nfs 192.168.3.100/home/public /home/nfs/public Mail smtpclient is a minimal SMTP client that takes an email message body and passes it on to an SMTP server. It is suitable for applications that use email to send alert messages or important logs to a specific user.
UC-7420/7410 User’s Manual Managing Communication 20: system.9.1.3.4 (octet string) The MIB module for managing IP and ICMP implementations 21: system.9.1.3.5 (octet string) The MIB module for managing UDP implementations 22: system.9.1.3.6 (octet string) View-based Access Control Model for SNMP. 23: system.9.1.3.7 (octet string) The SNMP Management Architecture MIB. 24: system.9.1.3.8 (octet string) The MIB for Message Processing and Dispatching. 25: system.9.1.3.
UC-7420/7410 User’s Manual Managing Communication Setup 1: Ethernet Bridging for Private Networks on Different Subnets 1. Set up four machines, as shown in the following diagram. Host A local net eth1: 192.168.2.173 OpenVPN A eth0: 192.168.2.171 Internet eth0: 192.168.8.173 ixp0: 192.168.8.174 eth0: 192.168.4.172 Host B ixp1: 192.168.4.174 local net OpenVPN B Host A (B) represents one of the machines that belongs to OpenVPN A (B).
UC-7420/7410 User’s Manual Managing Communication fi i=`expr $i + 1` read f1 f2 case “$f1” in address ) IPADDR=$f2 ;; netmask ) NETMASK=$f2 ;; broadcast ) BROADCAST=$f2 ;; esac done break fi done < /etc/network/interfaces } # get the ip address of the specified interface mname= module_up() { oIFS=$IFS IFS=‘ ‘ FOUND=“no” for LINE in `lsmod` do TOK=`echo $LINE | cut -d’ ‘ -f1` if [ “$TOK” = “$mname” ]; then FOUND=“yes”; break; fi done IFS=$oIFS if [ “$FOUND” = “no” ]; then modprobe $mname fi } start() { ifc
UC-7420/7410 User’s Manual Managing Communication # 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 fi done # null ip address of internal interface ifconfig $iface 0.0.0.
UC-7420/7410 User’s Manual 4. Managing Communication 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 #----------------------------------Start-----------------------------#!/bin/sh # value after “-net” is the subnet behind the remote peer route add -net 192.168.4.
UC-7420/7410 User’s Manual Managing Communication 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 To create an indirect connection to Host A from Host B, you need to add the following routing item: route add –net 192.168.2.0 netmask 255.255.255.0 dev eth0 Now ping Host B from Host A by typing: ping 192.168.4.
UC-7420/7410 User’s Manual Managing Communication Setup 3: Routed IP 1. Set up four machines as shown in the following diagram: Host A local net eth1: 192.168.2.173 OpenVPN A eth0: 192.168.2.171 Internet eth0: 192.168.8.173 ixp0: 192.168.8.174 eth0: 192.168.4.172 Host B 2. ixp1: 192.168.4.174 local net OpenVPN B Create a configuration file named “A-tun.conf” and an executable script file named “A-tun.sh”. # point to the peer remote 192.168.8.174 dev tun secret /etc/openvpn/secrouter.
UC-7420/7410 User’s Manual Managing Communication 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. 3. Check the routing table after you run the OpenVPN programs, by typing the command: # route Destination Gateway Genmsk 192.168.4.174 * 255.
5 Chapter 5 Programmer’s Guide This chapter includes important information for programmers.
UC-7420/7410 User’s Manual Programmer’s Guide Flash Memory Map Partition sizes are hard coded into the kernel binary. To change the partition sizes, you will need to rebuild the kernel. The flash memory map is shown in the following table.
UC-7420/7410 User’s Manual Programmer’s Guide Obtaining help Use the Linux man utility to obtain help on many of the utilities provided by the tool chain. For example to get help on the armv5b-linux-gcc compiler, issue the command: #man armv5b-linux-gcc Cross Compiling Applications and Libraries To compile a simple C application, just use the cross compiler instead of the regular compiler: #mxscaleb-gcc –o example –Wall –g –O2 example.
UC-7420/7410 User’s Manual 2. Programmer’s Guide Use the following command on the host to change to the directory that contains hello-debug: cd /my_work_directory/myfilesystem/testprograms 3. Enter the following command: #ddd --debugger mxscaleb-gdb hello-debug & 4. Enter the following command at the GDB, DDD command prompt: Target remote 192.168.4.99:2000 The command produces another line of output on the target console, similar to the following: Remote debugging using 192.168.4.99:2000 192.168.4.
UC-7420/7410 User’s Manual Programmer’s Guide 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. 2. How the WDT works The sWatchDog is enabled when the system boots up.
UC-7420/7410 User’s Manual Programmer’s Guide 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 - the file handle from swtd_open() return value. Output: OK will be zero. The other has some error, to get error code from errno. int swtd_get(int fd, int *mode, unsigned long *time) Description: Get current setting values. mode – 1 for user application enable sWatchDog: need to do ack.
UC-7420/7410 User’s Manual Programmer’s Guide int swtd_close(int fd) Description: Close the file handle. Input : int fd - the file handle from swtd_open() return value. 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.
UC-7420/7410 User’s Manual Programmer’s Guide #include #include #include #include #include static void mydelay(unsigned long msec) { struct timeval time; time.tv_sec = msec / 1000; time.
UC-7420/7410 User’s Manual Programmer’s Guide UART The normal tty device node is located at /dev/ttyM0 … ttyM7, and the modem tty device node is located at /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. You must include . #define #define #define #define 1.
UC-7420/7410 User’s Manual Programmer’s Guide Baud rate inaccuracy Divisor = 921600/Target Baud Rate. (Only Integer part) ENUM = 8 * (921600/Targer - Divisor) ( Round up or down) Inaccuracy = (Target Baud Rate – 921600/(Divisor + (ENUM/8))) * 100% E.g., To calculate 500000 bps Divisor = 1, ENUM = 7, Inaccuracy = 1.7% *The Inaccuracy should less than 2% for work reliably. Special Note 1. If the target baud rate is not a special baudrate (e.g.
UC-7420/7410 User’s Manual Programmer’s Guide 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. 2. Currently, UC-7420/7410 does NOT support pressing more than 1 key at the same time. Make File Example The following Makefile file example codes are copied from the Hello example on UC-7420/7410’s CD-ROM.
6 Chapter 6 UC Finder The UC Finder utility is used to search the LAN or intranet for Moxa Universal Communicators. UC Finder comes in handy if you forget the IP address, for troubleshooting field problems, and for testing. 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.
UC-7420/7410 User’s Manual UC Finder 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.
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.
UC-7420/7410 User’s Manual UC Finder 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. 1. Click o n the Broadcast Search button to start searching. 2.
UC-7420/7410 User’s Manual 3. NOTE UC Finder When the search is complete, the same information is displayed in the UC Finder window. UC Finder is designed to determine the IP addresses of all UC units connected to the same LAN the host that is running UC Finder. To configure UC’s IP addresses or other configuration parameters, use Telnet over the network, or connect directly to the serial Console port to access UC-7420/7410’s Console utility.
A Appendix A System Commands busybox (V0.60.4): Linux normal command utility collection File manager 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.
UC-7420/7410 User’s Manual System Commands Process 1. 2. kill ps kill process display now running process 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. dmesg sty zcat mknod free date env clear reboot halt du gzip, gunzip hostname dump kernel log message to set serial port dump .
B Appendix B Windows Tool Chain 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 on a Windows PC. The following topics are covered in this appendix.
UC-7420/7410 User’s Manual Windows Tool Chain Introduction 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. / Your group is currently “mkpasswd”.
UC-7420/7410 User’s Manual Windows Tool Chain Introduction 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. Use this directory if you do not wish to re-install the UC windows tool chain again.
UC-7420/7410 User’s Manual 3. Windows Tool Chain Introduction 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. 4. All required package are selected by default. Click on Next to continue. y Category column: Shows a hierarchical display of packages with category name highest and package name lowest.
UC-7420/7410 User’s Manual Windows Tool Chain Introduction 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. y Packages: In the packages listing field, package names are arranged by Category/Full/Partial according to the View by button. When viewing by Category, click the plus sign (+) to open or close the packages under that category.
UC-7420/7410 User’s Manual Windows Tool Chain Introduction 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.
UC-7420/7410 User’s Manual -rwxr—xr-x -rw-r--r-drwxr—xr-x drwxr—xr-x drwxr—xr-x 1 1 2 14 6 stephen_ stephen_ stephen_ stephen_ stephen_ Windows Tool Chain Introduction mkpasswd mkpasswd mkpasswd mkpasswd mkpasswd 53 Jan 10 22:03 moxa.bat 3262 Jan 10 22:03 moxa.
UC-7420/7410 User’s Manual Windows Tool Chain Introduction B-8
C Appendix C Service Information This appendix shows you how to contact Moxa for information about this and other products, and how to report problems.
UC-7420/7410 User’s Manual Service Information 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. The following services are provided E-mail for technical support................................support@moxa.com.tw World Wide Web (WWW) Site for product information: ...................
UC-7420/7410 User’s Manual Service Information Problem Report Form MOXA UC-7420/7410 Customer name: Company: Tel: Fax: Email: Date: 1. Moxa Product: UC-7410-LX 2. Serial Number: UC-7420-LX _________________ 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.
UC-7420/7410 User’s Manual Service Information 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. Carefully pack the product in an anti-static package, and send it, pre-paid, to the dealer.