Benutzeranleitung / Produktwartung UC-7402 des Produzenten Moxa
Zur Seite of 82
UC-7402 User ’ s Manual Fourth Edition, February 2009 www .moxa.com/product © 2009 Moxa Inc. All righ ts reserved. Reproducti on without perm ission is pr ohibited.
UC-7402 User’s Manual The software d escribed in thi s manual i s furnished u nder a license agreem ent and m ay be used only in accordance with the term s of that agreement. Copyright Notice Copyright © 2009 Moxa Inc. All rights reserved. Reproducti on without perm ission is pr ohibited.
Table of Contents Chapter 1 Introduction .................................................................................................. 1-1 Overview...................................................................................................
Loading Factor y Defa ults ........................................................................................... 3-5 Enabling and Disa bling Daem ons ............................................................................................ 3-5 Setting the Ru n-Level .
1 1 Chapter 1 Introduction Moxa UC-7402 is a web server embedd ed network computer that features dual 10/100 Mbps Ethernet ports, a PCMCIA interface for wire less LAN comm unication, and CompactFlash for mass storage disk expansi on. UC-74 02 is an excell ent choice f or embedded network ap plications and diverse M 2M soluti ons.
UC-7402 User’s Manual Introduction 1-2 Overview Moxa UC-7402, a web server embedded n etwork computer features dual 10 /100 Mbps Ethernet ports, a PCMCIA interface for wireless L AN co mmunication a nd CompactFlash for m ass storage disk expansio n.
UC-7402 User’s Manual Introduction 1-3 Product Hardware Specifications UC-7402-L X CPU Intel Xscale IXP422, 266 MHz RAM 128 MB Flash 32 MB LAN Auto-sensi ng 10/100 M bps x 2 LAN Protecti on Built-in 1.5 KV magnetic isolation Serial Console/PPP RS-232 x 1, RJ45 USB 1.
UC-7402 User’s Manual Introduction 1-4 Hardware Introduction Appearance and Dimensions Appearance UC-7402 Rear View DC 12-48V LAN1 LAN2 Console V+ V- PCMCIA CF 12-48 VDC Power Input CF x 1 PCMCIA x 1 10/100 Mbps Ethernet x 2 USB 1.
UC-7402 User’s Manual Introduction 1-5 Dimensions 197 mm [7.76"] 125 mm [4.92"] 44 mm [1.73"] Hardware Block Diagram The following block diagram shows the layou t of UC-7402’s internal componen ts.
UC-7402 User’s Manual Introduction 1-6 LED Indicators UC-7402 has 4 LED indicator s on the top pa nel. Re fer to the following table for information about each LED.
UC-7402 User’s Manual Introduction 1-7 Real Time Clock UC-7402’s real time clock is powered by a lith iu m battery. We strongly recommend that you do not replace the lithium battery without help from a qu alified Moxa support engi neer. If y ou need to change the battery, contact M oxa RMA serv ice team.
UC-7402 User’s Manual Introduction 1-8 DIN-Rail Mounting The aluminum DIN-Rail attachm ent plate is included in the package. If you need to reattach the DIN-Rail attachment plate to UC-7402, make sure t h e stiff metal spring is situated towards th e top, as shown in the figures below.
UC-7402 User’s Manual Introduction 1-9 You should al so observe the following comm on wiring rule s: y Use separate p aths to route wiring for power and devi ces. If powe r wiring and device wiri ng paths must cross, m ake sure the wires are perpendicular at t he intersection point.
UC-7402 User’s Manual Introduction 1-10 Connecting to the Network Connect one end of the Ethernet cab le to one of UC-7402’s 10/100M Ethern et ports (8-pin RJ45) and the other end of t he cable to the Ethernet ne twork.
UC-7402 User’s Manual Introduction 1-11 Software Introduction Software Architecture The Linux operating system that is pre-installed in UC-7402 follows the standard Linux architecture, making it easy to po rt programs that follow the POSIX standard to UC-7402.
UC-7402 User’s Manual Introduction 1-12 Normally, the kernel uses t he User Root File System to boot up the system. T he Mini Root File System is protected, and cannot be ch anged by the user, providing a “safe” zone. The kernel will only use t he Mini Root File System when the User Root File System crashes.
UC-7402 User’s Manual Introduction 1-13 Software Package Boot Loader Redboot (V1.92) Kernel MontaVist a embedded Linux 2. 4.18 Protocol S tack ARP, PPP, CHAP, PAP, IPv4, ICMP, TCP, UDP, DHCP, FTP, SNMP V1, HTTP, NTP, NFS, SMTP, SSH 1.
2 2 Chapter 2 Getting Started In this chapter, we explain how to connect UC-740 2, turn on the power, an d then get started using the program ming and othe r function s.
UC-7402 User’s Manual Getting Started 2-2 Powering on UC-7402 Connect the SG wire to the Shielded Con tact located in the upper left corner of the UC-7402, and then power on UC-7402 by connecting it to the power adaptor. It takes about 30 to 60 second s for the system to boot up.
UC-7402 User’s Manual Getting Started 2-3 Telnet Console If you know at least one of the tw o IP addresses an d netmasks, then you can use Telnet to connect to UC-7402’s console utility. The default IP addr ess and Netmask for each of th e two ports are given belo w: Default IP Address Netmask LAN 1 192.
UC-7402 User’s Manual Getting Started 2-4 ATTENTION Serial Console Reminder Remember to choose VT100 as the terminal type. Use cable C BL-RJ45F9-15 0, which com es with UC-7402, to connect to the serial console port.
UC-7402 User’s Manual Getting Started 2-5 Linux Users From a Linux machine, use t he “ssh” command to access UC-7402’s Co nsole utility via SSH. #ssh 192.168.3.127 Select yes to complete the connection. [root@bee_notebook root]# ssh 192.168.3.
UC-7402 User’s Manual Getting Started 2-6 Dynamic IP addresses : By default, UC-7402 is configu red for “static” IP addresses. To conf igure one or both LAN ports to request an IP a ddress dynami cally, replace static with dhcp and then delete the address, network , netmask, and broa dcast lines.
UC-7402 User’s Manual Getting Started 2-7 NOTE After changing the IP settings, use the networking restart command to activate the new IP address. Modifying Network Settings over the Network IP settings can be activated over the network, bu t the new settings will no t be saved to the flash ROM without modifying the file /etc/network/interfaces .
UC-7402 User’s Manual Getting Started 2-8 Edit network.opts with the following command to edit Wireless LAN’s default setting. #vi /etc/pcmcia/network.op ts 3. Configur e the Wireless LAN card’s default SSID setting profile. (Default SSID is “any”) #vi /etc/wlan/wlan.
UC-7402 User’s Manual Getting Started 2-9 IEEE802.11g The following I EEE802.11g wireless modules are supported: y ASUS — WL-1 07g y CNET — CWC-8 54 (181D ve rsion) y Edmiax — EW-7108PCg y Amigo — AWP-914W y GigaByte — GN-WMGK y Other brands that use the Ralin k RT2560 series chip set To configu re the WLAN for IEEE802.
UC-7402 User’s Manual Getting Started 2-10 3. Additional WLAN parameters are contained in the file RT2500STA.dat . To open the file, navigate to t he RT2500ST A folder a nd invoke vi, or type t he followi ng comma nd #vi /etc/Wireless/RT2500STA/RT2500STA.
UC-7402 User’s Manual Getting Started 2-11 SSID —Sets the softAP SSID Setting Any 32-byte string NetworkT ype —Sets the wireless operation mode Setting Explanation Infra Infrastructure mode (use.
UC-7402 User’s Manual Getting Started 2-12 WpaPsk —Enabl es or disables TxBurst Setting Explanation 0 disable 1 enable T urboR ate —Enables or disables T u rboRate Setting Explanation 0 disable .
UC-7402 User’s Manual Getting Started 2-13 R TSThr eshold —Sets the R TS threshold Setting 1 to 2347 FragThr eshol d —Sets the fragm ent threshold Setting 256 to 23 46 Test Program — Developing Hello.c In this section, we use the standard “Hello” programming example to illu strate how to develop a program for UC-7402.
UC-7402 User’s Manual Getting Started 2-14 Checking the Flash Memory Space If the flash mem ory is full, you will not be able to save data to the Flash ROM.
UC-7402 User’s Manual Getting Started 2-15 NOTE Be sure to type the #make comm and from wit hin the /tmp/example/hello directory, since UC’s tool chain p uts a specially desi gned Makefile in that directory. This special Makefile uses t he mxscale-gcc compiler to com pile th e hello.
3 3 Chapter 3 Managing Embedded Linux This chapte r includes inf ormati on about vers ion contr ol, deploym ent, upda tes, and peri pherals. The information in this chapter will be particu larly useful when you need to run the same application on several UC-7402 un its.
UC-7402 User’s Manual Managing Embedded Linux 3-2 System Version Information To determine the hardw are capability o f your UC-7402, and what kind of software fu nctions are supported, c heck the ve rsion num bers of your UC -7402’s har dware, kern el, and user fil e system .
UC-7402 User’s Manual Managing Embedded Linux 3-3 Since different Flash disks have different sizes, it’ s a good idea to check the size of your Flash disk before upgrading the firmware, o r before using the disk to store your application and data files.
UC-7402 User’s Manual Managing Embedded Linux 3-4 local: UC7402-1.5.frm remote: UC7402-1.5.frm 200 Port command successful. 150 Opening data connection for UC7402-1.5.frm 226 Transfer complete. 13167772 bytes received in 2.17 secs (5925.8 kB/s) ftp> 3.
UC-7402 User’s Manual Managing Embedded Linux 3-5 Loading Factory Default s The easiest way to load factory defaults is to up date th e firmware (follow the instructions in the previous section to u pgrade the firm ware). Note that if y our use r file is n ot working p roperly, the sy stem wi ll mount the M ini File S ystem.
UC-7402 User’s Manual Managing Embedded Linux 3-6 Type the command “ps –ef” to list all pro cesses currently running. 192.168.3.127 – PuTTY root@Moxa:~# cd /etc root@Moxa:/etc# ps -ef PID Ui.
UC-7402 User’s Manual Managing Embedded Linux 3-7 Then you will find the enab led daemons after you reboot the system. 192.168.3.127 – PuTTY root@Moxa:~# ps -ef PID Uid VmSize Stat Command 1 root .
UC-7402 User’s Manual Managing Embedded Linux 3-8 Setting the Run-Level In this section, we outline the steps you should take to set the Linux run- level and execute requests. Use the follow ing comm and to enable or disable settings: 192.168.3.127 – PuTTY root@Moxa:/ect/rc.
UC-7402 User’s Manual Managing Embedded Linux 3-9 Adjusting the System Time Setting the T ime Manually UC-7402 has two time settings. One is the syste m time, and the other is the RTC (Real Time Clock) tim e kept by the UC-7402 ha rdware. Use t he #dat e command to query t he current system time or set a ne w system time.
UC-7402 User’s Manual Managing Embedded Linux 3-10 NTP Client UC-7402 has a built-in NTP (Network Time Protocol) client that is used to initialize a time req uest to a remote NTP server. Use #ntpdate < this client utility > to update the system time.
UC-7402 User’s Manual Managing Embedded Linux 3-11 Cron—daemon to Execute Scheduled Commands Start Cron from the directory /etc/rc.d/rc.local . It will return immediately, so you don’t need to start it with ‘&’ to run th e background. The Cron daemon will search /etc/cron.
4 4 Chapter 4 Managing Communications In this chapt er, we ex plain how to configure UC -7402’s va rious comm unication functions. The following topics are covered in this chapter: Telnet / FTP .
UC-7402 User’s Manual Managing Communication 4-2 Telnet / FTP In addition to suppo rting Telnet client/server an d FTP client/server, the UC-7402 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.
UC-7402 User’s Manual Managing Communication 4-3 Web Service—Apache The Apache web server’s main co nfiguration file is /etc/apache/httpd.conf , with the default homepage loca ted at /usr/www/html/index.
UC-7402 User’s Manual Managing Communication 4-4 To open the de fault CGI te st script re port page, ty pe http://192.168.3.127 /cg i-bin/test-cgi in your browser’s address box. NOTE The CGI functi on is enabl ed by defa ult. If yo u want to di sable the functi on, modi fy the file /etc/apache/httpd.
UC-7402 User’s Manual Managing Communication 4-5 Saving a W eb Page to the CF Card Since some applications will have web pages that take up a lot of memory space, you will need to be able to r un the homepage a nd other pages from the CF ca rd.
UC-7402 User’s Manual Managing Communication 4-6 Step 3: Use the follow ing comm ands to restart the Apache web server: #cd /etc/init.d #./apache restart Step4: Open your br owser and conn ect to the UC-7 402 by typin g the current LA N1 IP address i n the browser’s address box.
UC-7402 User’s Manual Managing Communication 4-7 Source NAT (SNAT) — changes the first source packet IP address Destination NAT (DNAT) — changes the first destination packet IP a ddress MASQUERA DE — a special form for SNAT.
UC-7402 User’s Manual Managing Communication 4-8 UC-7402 s upports the following sub-modul es. Be sure to use the m odule that m atches your application.
UC-7402 User’s Manual Managing Communication 4-9 Examples: # iptables -L -n In this example, since we do not use the -t parameter, the system uses the default ‘filter’ table. Three chains are incl uded: INPUT, OUT PUT, and FORWARD. INPUT chains are acce pted automatically, and all connections ar e accepted without being filtered.
UC-7402 User’s Manual Managing Communication 4-10 Example 3: Ac cept TCP pack ets from Cl ass C network 1 92.168.1.0/24. # iptables –A INPUT –i ixp0 –p tcp –s 192.168.1.0/24 –j ACCEPT Example 4: D rop TCP pac kets from 192. 168.1.25. # iptables –A INPUT –i ixp0 –p tcp –s 192.
UC-7402 User’s Manual Managing Communication 4-11 1. #ehco 1 > /proc/sys/net/ipv4/ip_forward 2. # modprobe ip_tables 3. # modprobe ip_conntrack 4. # modprobe iptable_nat 5. # modprobe ipt_MASQUERADE 6. #iptables -t nat –A POSTROUTING –o ixp0 –j SNAT --to-source 192.
UC-7402 User’s Manual Managing Communication 4-12 The pppd daem on is used to connect to a PPP se rver from a Linux syste m. For detai led informati on about pppd see t he man page. Example 1: Connecting to a PPP server over a simple dial-up connection The followin g command is used to con nect to a PPP serve r by modem .
UC-7402 User’s Manual Managing Communication 4-13 192.1.1.17 This is a de generate case of a general option of t he form x.x.x. x:y.y.y.y . Here x.x. x.x is the local IP address and y.y.y.y is the IP address of the remote end of the PPP conn ection.
UC-7402 User’s Manual Managing Communication 4-14 Try typing: netstat -nr This should show three routes, so mething like this: Kernel routing table Destination Gateway Genmask Flags Metric Ref Use iface 129.67. 1.165 0.0. 0.0 255.255 .255.255 UH 0 0 6 ppp0 127.
UC-7402 User’s Manual Managing Communication 4-15 4. Edit the file /etc/ppp/chap-secrets and add the following: “username@hinet. net” * “password” * “username@hinet.net” is t he username obtai ned from the ISP to log in to the ISP account.
UC-7402 User’s Manual Managing Communication 4-16 6. Edit the file /etc/ppp/options and add the following line: plugin pppoe 7. Add one of two files: /etc/ppp/options.ixp0 or /etc/ppp/options.ixp1 . The choice depends on which LAN is connected to t he ADSL modem .
UC-7402 User’s Manual Managing Communication 4-17 8. Set up DNS If you are using DNS servers supplied by your ISP, edit the file /etc/resolv.con f by adding t he followi ng line s of code: nameserver ip_addr_of_first_dns _server nameserver ip_addr_o f_second_dns _server For example: nameserver 16 8.
UC-7402 User’s Manual Managing Communication 4-18 optionx x The option list for a machine descri bes the ki nd of access the machine will have . Important options are: ro Read only.
UC-7402 User’s Manual Managing Communication 4-19 Setting up UC-7402 as an NFS Client The followin g procedure is used to m ount a remote NFS Server. 1. Scan the NFS Server’s shared directory. 2. Establish a mount point on the NFS Cli ent site. 3.
UC-7402 User’s Manual Managing Communication 4-20 SNMP UC-7402 has built-in SNMP V1 (Simple Networ k Management Pro tocol) agent software. It supports RFC1317 RS-2 32 like group and RFC 1213 MI B-II. The following simple example allows you to use an SNMP browser on the host site to query the UC-7402, which is the SNMP agent.
UC-7402 User’s Manual Managing Communication 4-21 The following tables list the variables supported by UC-7402. Open VPN This function is o nly available for firm ware version V1. 5 (and later version s). OpenVPN provides two types of tunn els for users to implement VPNS: Routed IP Tu nnels and Bridged Ethernet Tunnels .
UC-7402 User’s Manual Managing Communication 4-22 3. Generate a script fil e named openvpn-bridge on each OpenVPN machine. This scri pt reconfigures interface “ixp1” as IP-less, crea tes logical bridge(s) an d TAP interfaces, loads modules, e nables IP forwa rding, etc.
UC-7402 User’s Manual Managing Communication 4-23 { ifcfg_vpn if [ ! ( -d “/dev/net” ) ]; then mkdir /dev/net fi if [ ! ( -r “/dev/net/tun” ) ]; then # create a device file if there is none .
UC-7402 User’s Manual Managing Communication 4-24 brctl delbr br0 ifconfig br0 down ifconfig $iface $IPADDR netmask $NETMASK broadcast $BROADCAST killall -TERM openvpn } case “$1” in start) star.
UC-7402 User’s Manual Managing Communication 4-25 Note: Select cipher and authentication algorithms by specifying “cipher” and “auth”. To see with algorithms are available, type : # openvpn --show-ciphers # openvpn --show—auths 5. Start both of OpenVPN peers, # openvpn --config A-tap0-br.
UC-7402 User’s Manual Managing Communication 4-26 Setup 2: Ethernet Bridging for Pr ivate Networks on the Same Subnet 1. Set up four m achines as sho wn in the following diagram: OpenVPN A OpenVPN B Host A eth0: 192.168.2.171 Host B eth0: 192.168.2.
UC-7402 User’s Manual Managing Communication 4-27 2. Creat e a configuration file nam ed “A-tun.conf” and an execut able script file nam ed “A-tun.sh”. # point to the peer remote 192.168.8.174 dev tun secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40 ifconfig 192.
5 5 Chapter 5 Programmer’s Guide This chapter includes importan t information for programmers. This following functions are covered in this chapter: Flas h Memo ry Map Linux Tool Chai n Intr.
UC-7402 User’s Manual Programmer’s Guide 5-2 Flash Memory Map Partition sizes are hard coded into th e kernel bina ry. To chang e the partition sizes, you will need to rebuild the kernel.
UC-7402 User’s Manual Programmer’s Guide 5-3 Obtaining help Use the Linux man utility to obtain help on many of the utilities provid ed by the tool chain.
UC-7402 User’s Manual Programmer’s Guide 5-4 Uninstalling the Linux Tool Chain Use the command rpm –qa|grep m xscaleb to query if the Moxa tool chain is installed on the system. Use the command rpm -e mxscal e-x.x.x-x t o uninstal l the Moxa Xscale t ool chain.
UC-7402 User’s Manual Programmer’s Guide 5-5 Debugging with GDB First compile the program must with option -ggdb. Use the following steps: 1. To de bug a pro gram called hello-debug on the target, use t he command: #gdbserver 192.
UC-7402 User’s Manual Programmer’s Guide 5-6 Buzzer The device node is located at /dev/console . UC-7402 supports Linux stan dard buzzer co ntrol, with UC-7402’s buzzer runni ng at a fixe d frequency of 100 Hz. Yo u must include <sys/kd.h> .
UC-7402 User’s Manual Programmer’s Guide 5-7 int swtd_enable(int fd, unsigned long time) Description Enable application sWatchDog. And you must do ack after this process. Input int fd - the file handle, from the swtd_open() return value. unsigned long time - The time you wish to ack sWatchDog peri odically.
UC-7402 User’s Manual Programmer’s Guide 5-8 int swtd_ack(int fd) Description: Acknowledge sWatchDog. When the user appli cation enable sWatchDog. It need to ca ll this function periodically with user predefined time in the application prog ram. Input : int fd - the file handle from swtd_open() return value.
UC-7402 User’s Manual Programmer’s Guide 5-9 ….. …. swtd_ack(fd); ….. …. } swtd_close(fd); exit(0); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmoxalib Example 2: #include <stdio.h> #include <stdlib.h> #include <signal.
UC-7402 User’s Manual Programmer’s Guide 5-10 ….. ….. ….. // end user application kill(sonpid, SIGUSR1); swtd_close(swtdfd); exit(1); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmoxalib Make File Example The following Makefile file example codes ar e copied fro m the Hello e xample on UC -7402’s CD-ROM.
A A Appendix A System Commands Linux normal command utility collection File manager 1. cp c o p y f i l e 2. ls list file 3. ln make symbolic link file 4. mount mount an d check fi le system 5. rm delete file 6. chmod change file owner & gr oup & user 7.
UC-7402 User’s Manual System Commands A-2 Process 1. kill kill process 2. ps display now running process Other 1. dmesg dump kernel log message 2. sty t o s e t s e r i a l p o r t 3. zca t dump .gz file context 4. mknod make device node 5. free display system memory usage 6.
Ein wichtiger Punkt beim Kauf des Geräts Moxa UC-7402 (oder sogar vor seinem Kauf) ist das durchlesen seiner Bedienungsanleitung. Dies sollten wir wegen ein paar einfacher Gründe machen:
Wenn Sie Moxa UC-7402 noch nicht gekauft haben, ist jetzt ein guter Moment, um sich mit den grundliegenden Daten des Produkts bekannt zu machen. Schauen Sie zuerst die ersten Seiten der Anleitung durch, die Sie oben finden. Dort finden Sie die wichtigsten technischen Daten für Moxa UC-7402 - auf diese Weise prüfen Sie, ob das Gerät Ihren Wünschen entspricht. Wenn Sie tiefer in die Benutzeranleitung von Moxa UC-7402 reinschauen, lernen Sie alle zugänglichen Produktfunktionen kennen, sowie erhalten Informationen über die Nutzung. Die Informationen, die Sie über Moxa UC-7402 erhalten, werden Ihnen bestimmt bei der Kaufentscheidung helfen.
Wenn Sie aber schon Moxa UC-7402 besitzen, und noch keine Gelegenheit dazu hatten, die Bedienungsanleitung zu lesen, sollten Sie es aufgrund der oben beschriebenen Gründe machen. Sie erfahren dann, ob Sie die zugänglichen Funktionen richtig genutzt haben, aber auch, ob Sie keine Fehler begangen haben, die den Nutzungszeitraum von Moxa UC-7402 verkürzen könnten.
Jedoch ist die eine der wichtigsten Rollen, die eine Bedienungsanleitung für den Nutzer spielt, die Hilfe bei der Lösung von Problemen mit Moxa UC-7402. Sie finden dort fast immer Troubleshooting, also die am häufigsten auftauchenden Störungen und Mängel bei Moxa UC-7402 gemeinsam mit Hinweisen bezüglich der Arten ihrer Lösung. Sogar wenn es Ihnen nicht gelingen sollte das Problem alleine zu bewältigen, die Anleitung zeigt Ihnen die weitere Vorgehensweise – den Kontakt zur Kundenberatung oder dem naheliegenden Service.