Home

UC-7101/7110/7112 User`s Manual v8

image

Contents

1. CPU Moxa ARMO based 32 bit RISC CPU 192 MHz RAM 16 MB 12 MB of user programmable space Flash 8 MB 4 MB of user programmable space Storage Expansion Internal SD socket x 1 for SD memory card UC 7101 7112 LAN Auto sensing 10 100 Mbps x 2 LAN Protection Built in 1 5 KV magnetic isolation Serial Ports RS 232 422 485 ports support RS 232 signals TxD RxD DTR DSR RTS CTS DCD GND RS 422 signals TxD TxD RxD RxD GND 4 wire RS 485 signals TxD TxD RxD RxD GND 2 wire RS 485 signals Data Data GND Serial Protection 15 KV ESD for all signals Data bits 5 6 7 8 Stop bit s 1 1 5 2 Parity None Even Odd Space Mark Flow Control RTC CTS XON XOFF RS 485 ADDCTM Speed 50 bps to 921 6 Kbps Any Baudrate supported Watchdog Timer Yes Real Time Clock Yes Buzzer Yes Console Port 3 wire RS 232 Tx Rx GND 19200 n 8 1 LEDs Ready Serial Tx Rx 2 of each LAN 10 100 one on each LAN connector Dimensions WxDxH 77x 111 x 26 mm 3 03 x 4 37 x 1 02 in Gross Weight 190g Power input 12 48 VDC Power Consumption 300 mA 12 VDC UC 7101 1 3 UC 7101 7110 7112 Software User s Manual Introduction Software 340 mA 12 VDC 4 5W UC 7110 7112 Operating temperature 10 to 60 C 14 to 140 F 5 to 95 RH Storage temperature 20 to 80 C 4 to 176
2. static int swtdfd static int stopflag 0 static void stop _swatchdog stopflag 1 static void do swatchdog void swtd enable swtdfd 500 while stopflag 0 mydelay 250 swtd_ack swtdfd swtd_disable swtdfd int main int argc char argv pid t sonpid Signal SIGUSR1 stop swatchdog swtdfd swtd open if swtdfd lt O printf Open sWatchDog device fail n exit 1 if sonpid fork 0 do swatchdog do user application main function end user application kill sonpid SIGUSR1 swtd close swtdfd exit 1 The makefile is shown below All arm elf gcc WI elf2flt o xxxx xxxx c Imoxalib 5 6 A System Commands uClinux normal command utility collection File manager Editor cp copy file Is list file In make symbolic link file mount mount and check file system rm delete file chmod change file owner amp group amp user chown change file owner chgrp change file group sync sync file system save system file buffer to hardware mv move file pwd display active file directly df list active file system space du estimate file space usage mkdir make new directory rmdir delete directory head print the first 10 lines of each file to standard output tail print the last 10 lines of each file to standard outpu
3. a 3 S H i D User Directory JFFS2 Read Write ARP ICMP IPV4 TCP UDP FTP Protocol Stack Telnet NTP SNMP V1 HTTP PPP Device Driver Ethernet UART RTC Buzzer GPIO Microkernel Memory control Schedule Process Hardware ARMS CPU SDRAM FlashROM RS 232 422 485 Ethernet The UC 7101 7110 7112 s Flash ROM has multiple smaller partitions for the Boot Loader Linux Kernel amp Root File System Image and User Directory OS Kernel amp Root File System ROMES Read ONLY For most applications users need to spend a lot time maintaining the operating system and modifying the User AP system configuration In order to save on the total User Direcioiy Mini Root File System cost of development and maintenance the User Configuration Configuration User Directory for storing the user s system configuration parameters The UC 7101 7110 7112 have a built in mechanism that prevents system crashes and improves system reliability The procedure is described below UC 7101 7110 7112 is specially design to partition a f Linux Kernel amp Root Boot Loader HW When the Linux kernel boots up the kernel mounts the root file system and then enables services and daemons The kernel also looks for the system configuration parameters using rc or inittab Normally the kernel uses the User Directory to boot up the system The kernel will only use the default configuration etc amp home wh
4. l Function KDMKTONE ioctl fd KDMKTONE unsigned int arg Description Buzzer will beep as stipulated by the function arguments UART Interface The normal tty device node is located at dev ttyM0 ttyM1 and modem tty device node is located at dev com0 com1 The UC 7101 7110 7112 Series support uClinux standard termios control The Moxa UART Device API supports the configuration of ttyMO to ttyMl as RS 232 422 485 To use these functions after the Tool Chain package is installed then include lt moxadevice h gt in your application define RS232 MODE 0 define RS485 2WIRE MODE 1 define RS422 MODE 2 define RS485 4WIRE MODE 3 1 Function MOXA SET OP MODE int mode mode which mode you want to set int ioctl fd MOXA SET OP MODE amp mode Description Sets the interface mode Function MOXA GET OP MODE int mode int ioctl fd MOXA GET OP MODE amp mode Description Gets the interface mode UC 7101 7110 7112 Software User s Manual UC 7101 7110 7112 Device API WDT Watch Dog Timer 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 disabled when the system boots up The user application can also enable ack When the user does not
5. Sample Makefile Code The following Makefile example codes are copied from the Hello example on the UC 7101 7110 7112 s CD ROM srcdir LDFLAGS Wl elf2flt 2 9 UC 7101 7110 7112 Software User s Manual Getting Started LIBS CFLAGS f Change these if necessary CC arm elf gcc CPP arm elf gcc E all hello hello CC o 80 CFLAGS S LDFLAGS LIBS Q c clean rm f OBJS hello core gdb 2 10 3 Software Package This chapter includes information about the software that is used with the UC 7101 7110 7112 Series of embedded computers This chapter covers the following topics a UC 7101 7110 7112 Software Architecture gt Journaling Flash File System JFFS2 LY UC 7101 7110 7112 Software Package UC 7101 7110 7112 Software User s Manual Software Package UC 7101 7110 7112 Software Architecture The pre installed uClinux operating system used by the UC 7101 7110 7112 follows the standard uClinux architecture making programs that follow the POSIX standard easily ported to the UC 7101 7110 7112 by using the GNU Tool Chain provided by www uClinux org In addition to the Standard POSIX API device drivers for the buzzer and UART for the serial ports are also included User Application API Application Interface POSIX Socket Factory Default Configuration etc home Protected System Configuration MULTI E Iu eI Configuration Parameters Inittab inetd conf boa conf
6. kill the application with 9 or kill without option or Ctrl c the kernel will change to auto ack the sWatchDog When your application enables the sWatchDog and does not ack your application may have a logical error or your application has made a core dump The kernel will not change to auto ack This can cause a serious problem causing your system to reboot again and again 5 User application example Example 1 include lt stdio h gt include lt stdlib h gt include lt string h gt include lt moxadevice h gt int main int argc char argv int fd fd swtd open if fa lt O0 printf Open sWatchDog device fail n exit 1 swtd enable fd 5000 enable it and set it 5 seconds while 1 do user application want to do swtd ack fd swtd_close fd exit 0 The makefile is shown below all arm elf gcc WI elf2flt o xxxx xxxx c Imoxalib Example 2 include lt stdio h gt include lt stdlib h gt include lt signal h gt include lt string h gt include lt sys stat h gt include lt sys ioctl h gt include lt sys select h gt include lt sys time h gt include lt moxadevice h gt static void mydelay unsigned long msec 5 5 UC 7101 7110 7112 Software User s Manual UC 7101 7110 7112 Device API struct timeval time time tv_sec msec 1000 time tv_usec msec 1000 1000 select 1 NULL NULL NULL amp time
7. 7101 7110 7112 Software User s Manual Software Package UC 7101 7110 7112 Software Package bin dev upkernel mtdblock1 ptype passwd gt tinylogin mtdr1 ptypd login gt tinylogin mtdl ptypc tinylogin mtdblock0 ptypb telnetd mtdr0 ptypa snmpd mtd0 ptyp9 mail cuml ptyp8 sh cum0 ptyp7 routed ttyMI ptyp6 netstat ttyMO ptyp5 arp urandom ptyp4 chat random ptyp3 pppd Zero ptyp2 portmap ttypf ptypl ntpdate ttype ptyp0 necid ttypd ppp eraseall ttypc pio kversion ttypb rtc init ttypa ram expand ttyp9 ram0 inetd ttyp8 null hwclock ttyp7 kmem ftpd ttyp6 mem ftp ttyp5 cua mke2fs ttyp4 console discard ttyp3 tty dhcpcd ttyp2 cpu ttypl busybox ttypO boa ttySO downramdisk tty3 upramdisk ttyO roml rom0 ptypf 4 Configuring UC 7101 7110 7112 In this chapter we describe how to configure the UC 7101 7110 7112 embedded computers The following topics are covered in this chapter DODO O OUOOCOOOD Enabling and Disabling Daemons Adding a Web Page IPTABLES NAT gt NAT Example gt Enabling NAT at Bootup Configuring Dial in Dial out Service gt Dial out Service gt Dial in Service Configuring PPPoE How to Mount a Remote NFS Server Dynamic Driver Module Load Unload Upgrading the Kernel Upgrading the Root File System amp User Directory Loading Factory Defaults Autostarting User Applications on Bootup Checking the Kernel and Root File System Versions UC 7101 7110 7
8. F 5 to 95 RH Regulatory Approvals EMC FCC Class A CE Class A Safety UL CUL TUV Warranty 5 years Specifications Kernel uClinux Kernel 2 6 Support for dynamic driver module load unload Protocol Stack ARP ICMP IPV4 TCP UDP FTP Telnet SNMP V1 V2c HTTP CHAP PAP DHCP NTP NFS V2 V3 SMTP Telnet FTP PPP PPPoE File System JFFS2 for Kernel Root File System Read Only and User Directory Read Write Msh Minix shell command pppd Dial in out over serial port daemon PPPoE Point to Point over Ethernet daemon snmpd SNMP V1 V2c Agent daemon busybox Linux normal command utility Tinylogin login and user manager utility Telnetd Telnet server daemon telnet Telnet client program inetd TCP server manager program ftpd FTP server program ftp FTP client program boa Web server daemon ntpdate Network Time Protocol client utility Tool Chain Linux Tool Chain Arm elf gec V2 95 3 C C PC Cross Compiler uClibc V0 9 26 POSIX standard C library 1 4 2 Getting Started In this chapter we explain the basic procedure for getting the UC 7101 7110 7112 connected and ready to use This chapter covers the following topics a a Powering on the UC 7101 7110 7112 Connecting the UC 7101 7110 7112 to a PC gt Console Port gt Telnet Configuring the Ethernet Interface Developing Your Applications I
9. shell you can proceed to configure the UC 7101 7110 7112 s network settings as described in the next section CBL RJ45F9 150 that comes with the UC 7101 7110 7112 to connect to the serial console port If you are not able to connect on the first try unplug and then re plug the UC 7101 7110 7112 s power cord e Telnet Reminder When connecting to the UC 7101 7110 7112 over a LAN configure your PC s Ethernet card to be on the same subnet as the UC 7101 7110 7112 you wish to contact 2 3 UC 7101 7110 7112 Software User s Manual Getting Started Configuring the Ethernet Interface In this section we use the serial console to explain how to modify the UC 7101 7110 7112 s network settings 1 Change directories by issuing the command cd etc Product UC 7110 Series For further information check ttp www moxa caom tw 2 Type the command vi rc to use VI Editor to edit the configuration file The IP addresses for the UC 7101 7110 7112 s LANI and LANG are given as ifconfig eth0 192 168 3 127 ifconfig eth1 192 168 4 127 as shown in the following figure Edit these two lines to modify the static IP addresses E COM8 19200 None 8 1 Y T100 ma bin sh hostname moxa com tw org cat etc motd ig lo 127 0 0 1 ifconfig ethO 192 168 3 127 netmask li Ecaonfig ethl 192 168 4 127 netmask route add default gw 192 168 3 254 dev eth0 Ertc clock to system clock nfs portmap POrtrap amp factory amp broadcast vers
10. the portmap utility This program is enabled by default in the etc rc file Use the following command to mount the remote NFS server mount t nfs lt remote ip gt lt remote export directory gt lt local directory gt Dynamic Driver Module Load Unload In addition to supporting traditional static drivers the UC 7101 7110 7112 also support the dynamic driver module load unload mechanism It allows user to load a special driver into the kernel to enable hardware features for specific applications To load unload a dynamic driver module use the following commands Load module gt insmod lt module directory gt lt module file name gt For example to load the UART driver type the following command gt insmod lib modules 2 6 9 MoXaRt kernel drivers char mxser ko Show module list gt 1smod Unload module gt rmmod lt module name listed by lsmod command 4 9 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 For example to unload the UART driver type the following command gt rmmod mxser For the UC 7110 the factory default is to load the UART driver mxser ko The additional driver module to control the SD MMC memory card is loaded for the UC 7112 Please see the information below for the locations and file names of these driver modules UART lib modules 2 6 9 MoXaRt kernel drivers char mxser ko SD MMC lib modules 2 6 9 MoXaRt kernel drivers mmc mmc core k
11. your embedded applications The UC 7101 7110 7112 come with RS 232 422 485 serial ports and 10 100 Mbps Ethernet LAN ports to provide users with a versatile communication platform The UC 7101 7110 7112 use the ARM9 RISC CPU Unlike the X86 CPU which uses a CISC design the ARM9 s RISC design architecture and modern semiconductor technology provide the UC 7101 7110 7112 with a powerful computing engine and communication functions but without generating too much heat The built in 8 MB NOR Flash ROM and 16 MB SDRAM give you enough storage capacity and an additional SD socket provides you with flexible storage expansion to run a wide range of applications The LAN ports built into the ARM9 make the UC 7101 7110 7112 ideal communication platforms for data acquisition and protocol conversion applications and the RS 232 422 485 serial ports allow you to connect a variety of serial devices The pre installed uClinux operating system provides an open software operating system for software program development Software written for desktop PCs is easily ported to the UC 7101 7110 7112 with a GNU cross complier so that you will not need to spend time modifying existing software code The operating system device drivers and your own software can all be stored in the UC 7101 7110 7112 Flash memory Package Checklist The following models of the UC 7101 7110 7112 Series are currently available UC 7101 LX Mini RISC based Ready to Run Embedded Computer w
12. 112 Software User s Manual Configuring UC 7101 7110 7112 Enabling and Disabling Daemons The following daemons are enabled when the UC 7101 7110 7112 boot up for the first time e SNMP Agent daemon snmpd e Telnet Server Client daemon telnetd Internet Daemons inetd e FTP Server Client daemon ftpd e WWW Server daemon boa ATTENTION How to enable disable telnet ftp server a Edit the file etc inetd conf Example default enable discard dgram udp wait root bin discard discard stream tcp nowait root bin discard telnet stream tcp nowait root bin telnetd ftp stream tcp nowait root bin ftpd 1 b Disable the daemon by typing in front of the first character of the row How to enable disable etc inittab www server a Edit the file etc inittab b Disable the www service by typing in front of the first character of the row How to enable Network Time Protocol ntpdate is a time adjusting client utility The UC 7101 7110 7112 play the role of Time client and sends requests to the Network Time Server to request the correct time Set the time server address for adjusting the system time with the command gt ntpdate ntp_server ip Save the system time to the hardware s real time clock with the command gt hwclock w Visit http www ntp org for a list of recommended public NTP servers How to update the system time periodically with Network Time Protocol 1 Create a shell script
13. 7110 7112 Use the upkernel command to upgrade the kernel and root file system ramdisk gt upkernel uc7110 3 x bin ramdisk gt reboot H upramdisk E upkernel uc 7110 3 x bin o GEN The kernel source file is OK The version is 1 This step will destory your old kernel Do you want to continue it Y N Erased 2048 Kibyte 8 0 100 complete Format OK Now update the kernel Please wait Update the kernel 0K Please restart system H Upgrading the Root File System amp User Directory The UC 7101 7110 7112 uses JFFS2 for the root file system and user directory By default the root file system is pre set to READ only The UC 7101 7110 7112 provides a read write user s directory in the JFFS2 file system Use this user s directory to store the system configuration file and user s programs on the disk You can search the UC 7101 7110 7112 s CD ROM for the latest user directory file or download the file from www moxa com The format of the file is uc7110 3 x dsk uc7112 1 x dsk for UC 7112 You must download this file to a PC first and then use the console terminal or Telnet console to copy the file to the UC 7101 7110 7112 You can save this file to the UC 7101 7110 7112 s RAM disk and then upgrade the user directory A step by step example is shown below Use the following commands to enable the RAM disk gt upramdisk gt cd ramdisk Use the built in FTP client to download the uc7110 3 x dsk
14. Makefile Code teet e ee e Eus 2 9 Software PACKAGE iiie ar Dan Rabe iE reda as ica 3 1 UC 7101 7110 7112 Software Architecture 3 2 Journaling Flash File System JFFS2 sss 3 3 UC 7101 7110 7112 Software Package 3 4 Configuring UC 7101 7110 7112 eene 4 1 Enabling and Disabling Daemons nono ncon nono nono nono nono ron nan n narra nn nnne 4 2 Addins A e ms 4 3 FIABLE uite RE VERFU DU ERU ER ER UE ERE VERTU 4 3 DW 4 6 NAM Example os 4 7 Enabling NATA Boot p utt eee et ds 4 8 Configuring Dial in Dial out Service esses enne 4 8 Dial out Serviette en s 4 8 Dial VIE ae e eene 4 8 Configuring PPPOE eene enee eer b ee 4 9 How to Mount a Remote NES Server 4 9 Dynamic Driver Module Load Unload essere 4 9 Upgrading the Kerala RU SUN NR en 4 10 Upgrading the Root File System amp User Directory sssssssseseeeeees 4 11 Loading Factory Defaults essen nennen rre 4 12 Autostarting User Applications on Bootup sese enne 4 12 Checking the Kernel and Root File System Version 4 12 UC 7101 7110 7112 Device API 1c ceeeeeeeee enne enne nennen nennt 5 1 RTC Real Time Clock ert tiet rbd ee tua 5 2 nv ETE 5 2 WDT Wate h DOE Tim deleita dem 5 3 Appendix A System Commands cccccceeeeeee eee e seen eeee tense eneeeneeeneeeeeeeeneeeneeeneeeeeeeeeeeeeeees A 1 uClinux normal command utility c
15. UC 7101 7110 7112 User s Manual Ninth Edition July 2010 www moxa com product MOXA 2009 Moxa Inc All rights reserved Reproduction without permission is prohibited UC 7101 7110 7112 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 O 2009 Moxa Inc All rights reserved Reproduction without permission is prohibited Trademarks MOXA is a registered trademark of Moxa Inc All other trademarks or registered marks in this manual belong to their respective manufacturers Disclaimer Information in this document is subject to change without notice and does not represent a commitment on the part of Moxa Moxa provides this document as is without warranty of any kind either expressed or implied including but not limited to its particular purpose Moxa reserves the right to make improvements and or changes to this manual or to the products and or the programs described in this manual at any time Information provided in this manual is intended to be accurate and reliable However Moxa assumes no responsibility for 1ts use or for any infringements on the rights of third parties that may result from its use This product might include unintentional technical or typographical errors Changes are periodically made to the information herein to correct such errors and these changes a
16. ack it will let the system reboot Kernel boot User application running and enable user ack 3 The user API The user application must include lt moxadevic h gt and link moxalib a A makefile example is shown below all arm elf gcc WI elf2flt o xxxx xxxx c Imoxalib int swtd open void Description Open the file handle to control the sWatchDog If you want to do something you must first do this and keep the file handle for other uses Input None Output The return value is the file handle If there is an error it will return a negative value Use errno to retrieve errors int swtd enable int fd unsigned long time Description Enable application sWatchDog You must do an 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 periodically You must ack the sWatchDog before timeout If you do not ack the system will be reboot automatically The minimum time is 50 msec the maximum time is 60 seconds The time unit is msec 5 3 UC 7101 7110 7112 Software User s Manual UC 7101 7110 7112 Device API Output 0 zero for no error Any other number indicates an error You can get the error code from errno int swtd disable int fd Description Disable the application to ack sWatchDog The kernel will auto ack it Users does not to do it periodically Input int fd the file handle from swtd_open retu
17. ading Hello to the UC 7101 7110 7112 To use FTP to upload hello to UC 7101 7110 7112 issue the following commands on the PC ftp 192 168 3 127 ftp cd home ftp gt bin ftp gt put hello ftp gt quit telnet 192 168 3 127 2 7 UC 7101 7110 7112 Software User s Manual Getting Started mode data conne 0 O 0 ramdisk 0 _home 0 Ey etc 0 n 0 J proc OU mnt 0 Y O O cd h 250 CUD command successful pud mnt home i is current directory Running Hello on the UC 7101 7110 7112 To run the Hello program issue the following commands on the UC 7101 7110 7112 chmod 755 hello hello The words hello world will be printed on the screen UC 7101 7110 7112 Software User s Manual Getting Started ATTENTION Be sure to calculate the amount of Flash Memory used by the User File System in the Flash c Telnet 192 168 3 127 EE HERE HE HH HH E HEE HH LM EMEGuEMEI IEEE informat ion check noxa com hel lo root ht t pd ROM Use one of the following two commands to determine the amount of memory being used df k or d lk blocks Used Available Use Mounted on 1525 1525 0 100 1525 1525 0 100 4096 68388 3408 17 If the flash memory is full you will no longer be able to save data in Flash ROM To free up some memory use the console cable to connect to the UC 7101 7110 7112 s serial console terminal and then delete files from the Flash ROM
18. am amp Checking the Kernel and Root File System Versions Use the following commands to check the version of the kernel and root file system Use the following command to check the kernel version gt kversion Use the following command to check the root file system firmware version of the UC 7101 7110 7112 gt fsversion Use the following command to check the user directory version of the UC 7101 7110 7112 gt cat etc version 9 UC 7101 7110 7112 Device API In this chapter we discuss the Device API for the UC 7101 7110 7112 Series We introduce the APIs for the following functions RTC Real Time Clock Buzzer UART Interface WDT Watch Dog Timer DODO UC 7101 7110 7112 Software User s Manual UC 7101 7110 7112 Device API RTC Real Time Clock The device node is located at dev rtc The UC 7101 7110 7112 support uClinux standard simple RTC control You must include lt 1inux rtc h gt to use these functions L Buzzer Function RTC_RD_TIME int ioctl fd RTC RD TIME struct rtc time time Description Reads time information from RTC Function RTC SET TIME int ioctl fd RTC SET TIME struct rtc time time Description Sets RTC time The device node is located at dev console The UC 7101 7110 7112 support wClinux standard buzzer control The UC 7101 7110 7112 s buzzer runs at a fixed frequency of 100 Hz You must include lt sys kd h gt to use these functions
19. an Ethernet to the Internet through a common broadband medium such as a single DSL line wireless device or cable modem used by many ADSL service providers All users on the Ethernet share a common connection so the Ethernet principles that support multiple users on a LAN combine with the PPP principles which apply to serial connections Create the Connection gt pppd pty pppoe I ETHERNET INTERFACE m 1412 user USER NAME password lt USER_PASSWORD gt amp lt ETHERNET_INTERFACE gt Ethernet card connected to ADSL modem for example eth0 lt USER_NAME gt User account for example moxa adsl net lt USER_PASSWORD gt Password for user account To check if PPPOE is successfully connected use the command gt ifconfig ppp0 How to Mount a Remote NFS Server Currently the UC 7101 7110 7112 only supports NFS Network File System clients Users can open NFS service on a Linux PC to enable the UC 7101 7110 7112 to push data to it The UC 7101 7110 7112 can use NFS to mount a remote disk as a local disk for data or log purposes 1 First the NFS server must open an export directory and allow access to the IP address Edit the file etc exports on your Linux PC and then run the NFS daemon The following example gives one possibility refer to the NFS HOWTO document at http nfs sourceforge net nfs howto server html home usr 192 168 3 1 rw no root squash no all squash 2 TheUC 7101 7110 7112 must run
20. cept TCP packets from 192 168 0 24 to UC 7101 7110 7112 s port 137 138 139 iptables A INPUT i eth0 p tcp s 192 168 0 24 dport 137 139 j ACCEPT Example 7 Log TCP packets that visit UC 7101 7110 7112 s port 25 iptables A INPUT i eth0 p tcp dport 25 j LOG Example 8 Drop all packets from MAC address 01 02 03 04 05 06 iptables A INPUT i eth0 p all m mac mac source 01 02 03 04 05 06 j DROP NAT Network Address Translation protocol translates IP addresses used on one network into different IP addresses used on another network One network is designated the inside network and the other is the outside network Typically the UC 7101 7110 7112 connects several devices on a network and maps local inside network addresses to one or more global outside IP addresses and remaps the global IP addresses on incoming packets back into local IP addresses Click the following link for more information about iptables and NAT http www netfilter org documentation gHOWTO NAT HOWTO html 4 6 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 NAT Example The IP addresses of all packets leaving LANI are changed to 192 168 3 127 you will need to load the module ipt MASQUERADE 10 11 12 IP Netmask 192 168 3 100 24 Gateway 192 168 3 127 PC1 Linux or Windows LANI LANI eth0 192 168 3 127 24 UC 7110 LANZ eh 192 168 4 127 24 PC2 Linux o
21. ctory structure in the RAM at all times and implements a log structured file system that is always consistent even if the system crashes or unexpectedly powers down It does not require fsck on boot up JFFS2 a newer version of JFFS provides improved wear leveling and garbage collection performance an improved RAM footprint and response to system memory pressure improved concurrency and support for suspending flash erases marking of bad sectors with continued use of the remaining good sectors to enhance the write life of the devices native data compression inside the file system design and support for hard links Key features of JFFS2 are Directly targeted to Flash ROM e Robust Consistent across power failure No integrity scan fsck is required at boot time after normal or abnormal shutdown Explicit wear leveling e Transparent compression Although JFFS2 is a journaling file system this does not ensure that data will not be lost The file system will remain in a consistent state across power failures and will always be mountable However if the board is powered down during a write then the incomplete write will be rolled back on the next boot Any writes that were already completed will not be affected Additional information about JFFS2 is available on the following websites http sources redhat com ffs2 ffs2 pdf http developer axis com software jffs http www linux mtd infradead org 3 3 UC
22. ecifies the action to be taken with a matching packet A rule such as a jump to a user defined chain in the same table is called a target The UC 7101 7110 7112 support three types of IPTABLES tables Filter tables NAT tables and Mangle tables A Filter Table includes three chains INPUT chain OUTPUT chain FORWARD chain B NAT Table includes three chains PREROUTING chain transfers the destination IP address DNAT POSTROUTING chain works after the routing process and before the Ethernet device process to transfer the source IP address SNAT OUTPUT chain produces local packets sub tables 4 3 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 Source NAT SNAT changes the first source packet IP address Destination NAT DNAT changes the first destination packet IP address MASQUERADE a special form for SNAT If one host can connect to the Internet then other computers that connect to this host can connect to the Internet when the computer does not have an actual IP address REDIRECT a special form of DNAT that re sends packets to a local host independent of the destination IP address C Mangle Table includes two chains PREROUTING chain pre processes packets before the routing process OUTPUT chain processes packets after the routing process It has three extensions TTL MARK TOS The following figure shows the IPTABLES hierarchy Incoming Packets Mang
23. em pre installed to install the UC 7101 7110 7112 Linux GNU Tool Chain Debian 3 0R Woody Redhat 7 3 8 0 and compatible versions are recommended The Tool Chain requires about 100 MB of hard disk space on your PC The UC 7101 7110 7112 Tool Chain can be found on the UC 7101 7110 7112 CD To install the Tool Chain insert the CD into your PC and then issue the following command mount t iso9660 dev cdrom mnt cdrom Next run the following script as root to install the compilers linkers and libraries in the usr local directory sh mnt cdrom tool chain linux installer arm elf moxa toolchain 1 1 sh The Tool Chain installation will take a few minutes to complete ATTENTION You can download the Tool Chain software from Moxa s website Go to the UC 7101 7110 7112 product page click the Documentation amp Drivers link and then click Go under Driver amp Software Downloads UC 7101 7110 7112 Software User s Manual Getting Started Compiling Hello c The Tool Chain path is PATH usr local bin PATH The UC 7101 7110 7112 CD includes several example programs We use Hello c to illustrate how to compile and run applications Issue the following commands from your PC to compile Hello c cd tmp mkdir example cp mnt cdrom example tmp example Go to the Hello subdirectory and issue the command make to compile Hello c Finally execute the program to generate hello and hello gdb 1 root 1 ro Uplo
24. en the User Directory crashes The UC 7101 7110 7112 uses ROMFS for the Linux kernel image Root File System and Protected configuration and uses JFFS2 for the User Directory UC 7101 7110 7112 Software User s Manual Software Package The partition sizes are hard coded into the kernel binary You must rebuild the kernel to change the partition sizes The flash memory map is shown in the following table Flash Context Flash Address Size Access control Boot loader 0 Ox3ffff 256K Read ONLY Kernet amp 0x40000 0x3 fffff 4M Read ONLY Root File System JFFS2 User Directory 0x400000 Ox7fffff 4M 256K Read Write JFFS2 Developers write their own programs only on partitions etc home tmp and usr bin It is advised the executed file be put in usr bin as this will allow developers to use hotkeys In addition to the flash file systems a RAM based file system is mounted on var Journaling Flash File System JFFS2 The flash User Directory 1s formatted by the Journaling Flash File System JFFS2 which places a compressed file system on the flash transparent to the user Axis Communications in Sweden developed the Journaling Flash File System JFFS2 JFFS2 provides a file system directly on flash rather than emulating a block device designed for use on flash ROM chips It recognizes flash ROM chips special write requirements does wear leveling to extend flash life keeps the flash dire
25. file from the PC ramdisk gt ftp lt destination PC s IP gt Login Name xxxx Login Password xxxx ftp gt bin ftp gt get uc7110 3 x dsk ftp gt quit ramdisk gt upkernel ramdisk uc7110 3 x dsk reboot UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 You will also need to restore factory defaults to load the new settings To do this either press the RESET button for more than 5 seconds or input the command stdef from the Telnet console upkernel uc7118 3 x dsk The 1rmm r The version is 1 D This step will destory your old kernel Do you want to continue it 7 Y N Y Formating disk In Erased 2560 Kibyte gg 100 complete Format OK Now update the root filesystem Please wait esta the root file system OK Please push the reset button Loading Factory Defaults The easiest way to Load Factory Defaults is with the Upgrade User directory operation Refer to the previous section Upgrading the Root File Sysem amp User Directory for an introduction You may also press the RESET button for more than 5 seconds to load the factory default configuration or input the command stdef from the Telnet console to restore the factory defaults Autostarting User Applications on Bootup To autostart user applications on bootup edit the ete re file by adding your application program For example you might add the following line to the file ap directory ap progr
26. file that includes the following description bin sh ntpdate ntp server ip hwclock w Sleep 100 The min time is 100ms 2 Saveand make this shell script executable by typing chmod 755 shell script name Edit the file etc inittab by adding the following line ntp unknown directory Xshell script name UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 Adding a Web Page Default Home Page address home httpd index html You may change the default home page directory by editing the web server s configuration file located at etc boa conf Type the following command to edit the boa conf file etc vi boa conf n A minimal config that makes the home page an unauthenticated CGI Alias fing 20 T Auth cgi bin cgi demo etc config config lAddType text plain txt JAddTyne image gif gif lhddType text html html lhddType text html htm laddType text xml xml laddType image jpeg jpe laddType image jpeg jpeg laddType image jpeg jpg laddType image x icon ico To add your web page place your home page in the following directory home httpd 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 sp
27. ion mecid simple snmp daemon isnmpd amp Loading your driver here uart driver for dev ttyMO dev ttyM1 insmod lib modules 2 6 9 MoXaRt kernel drivers char mxser ko set the serial port interface now default set to RS232 if you want to change then you need modify following rc line 1 of 34 2 StateOPEN Em m mm mm ETERNI RE 2 4 UC 7101 7110 7112 Software User s Manual Getting Started ATTENTION You may reset the IP address immediately by issuing the command 3 You may also configure the UC 7101 7110 7112 to request IP addresses from a DHCP server In this case use the sharp sign to comment out one or both ifconfig lines and then add the setting about the dhcpcd into the rc file as below dhepcd p a eth0 amp dhepcd p a eth1 amp Note that the UC 7101 7110 7112 will send out DHCP broadcast packets and then get the IP addresses from the first DHCP server that responds E COM8 19200 None 8 1 Y 1190 ma bin sh hostname moxa com tw org cat etc motd RTS lizconfia lo 127 0 0 1 eth0 192 168 3 127 netmask 255 255 255 0 ethl 192 168 4 127 netmask 255 255 255 0 a eth0 if you want CHCE please set this a ethl amp if you want CHCE please set this default gw 192 168 3 254 dev eth0 rtc clock to system clock Ihwclock s nfs portmap Dortmap amp factory amp broadcast version mecid amp simple snmp daemon snmpd amp loading your d
28. ith 1 Serial Port 1 Ethernet port SD and uClinux operating system UC 7110 LX Mini RISC based Ready to Run Embedded Computer with 2 Serial Ports Dual Ethernet wClinux OS UC 7112 LX Mini RISC based Ready to Run Embedded Computer with 2 Serial Ports Dual Ethernet SD uClinux OS The UC 7101 7110 7112 embedded computers are shipped with the following items e UC 7101 7110 7112 e UC 7101 7110 7112 Quick Installation Guide e Document and Software CD e Ethernet cross over cable RJ45 to RJ45 100 cm e Console port cable CBL 4PINDB9F 100 4 pin header to female DB9 cable 100 cm e Universal Power Adaptor e Product Warranty Statement Optional Accessories e DK 35A DIN Rail Mounting Kit 35 mm NOTE Please notify your sales representative if any of the above items are missing or damaged 1 2 UC 7101 7110 7112 Software User s Manual Introduction Product Features The UC 7101 7110 7112 embedded computers have the following features Mini controller with ready to run platform for customized applications 32 bit ARM9 RISC microcontroller On board 16 MB RAM 8 MB Flash ROM Two RS 232 422 485 serial ports one RS 232 422 485 serieal port for UC 7101 Dual 10 100 Mbps Ethernet one 10 100 Mbps ethernet for UC 7101 SD expansion slot for storage expansion UC 7101 7112 only uClinux ready communication platform Wall mounting installation Robust fanless design Product Specifications Hardware Specifications
29. le Table PREROUTING Chain NAT Table PREROUTING Chain Local Host Packets Mangle Table INPUT Chain Other Host Packets Mangle Table FORWARD Chain Filter Table FORWARD Chain Filter Table INPUT Chain Local Process Mangle Table OUTPUT Chain Mangle Table POSTROUTING Chain NAT Table OUTPUT Chain Filter Table OUTPUT Chain NAT Table POSTROUTING Chain Outgoing Packets UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 NOTE The UC 7101 7110 7112 do NOT support IPV6 and ipchains IPTABLES supports packet filtering or NAT Take care when setting up the IPTABLES rules If the rules are not correct remote hosts that connect via a LAN or PPP may be denied access We recommend using the Serial Console to set up IPTABLES Click on the following links for more information about iptables http www linuxguruz com iptables http www netfilter org documentation HOW TO packet filtering HOW TO html Since the IPTABLES command is very complex to illustrate the IPTABLES syntax we have divided our discussion of the various rules into three categories Observe and erase chain rules Define policy rules and Append or delete rules Observe and erase chain rules Usage iptables t tables L n t tables Table to manipulate default filter example nat or filter L chain List List all rules in selected chains If n
30. nmpInTraps snmpOutTooBigs snmpOutNoSuchNames snmpOutBadValues snmpOutGenErrs snmpOutGetRequests snmpOutGetNexts snmpOutSetRequests snmpOutTraps snmpEnableAuthenTraps RFC1317 RS 232 like group supported variables rs232 MIB rs232Number rs232PortTable rs232PortIndex rs232PortType rs232PortInSigNumber rs232PortOutSigNumber rs232PortInSpeed rs232PortOutSpeed rs232AsyncPortTable rs232AsyncPortIndex rs232AsyncPortBits rs232AsyncPortStopBits rs232AsyncPortParity rs232InSigTable rs232InSigPortIndex rs232InSigName rs232InSigState rs2320utSigTable rs2320utSigPortIndex rs2320utSigName rs2320utSigState B 3 FAQ FAQ 1 Answer 1 FAQ 2 Answer 2 FAQ 3 Answer 3 Why am I only able to use vfork Land cannot use fork uClinux only supports vfork It does not support fork Note that when using vfork the parent process will hang until the child process calls an exec group API or exits When using a pthread group API why can I not use SIGUSRI and SIGUSR2 We cannot use the SIGUSRI and SIGUSR2 signals since a pthread group API uses SIGUSRI and SIGUSR2 to do a pthread control suspend restart exit function You will get the same result if you link the pthread This means that you cannot use 1pthread to add an option to the linker What is the correct format for linking to an API arm elf gcc W1 elf2flt In this example the API converts elf format to flat format
31. nstalling the UC 7101 7110 7112 Tool Chain Compiling Hello c Uploading Hello to the UC 7101 7110 7112 Running Hello on the UC 7101 7110 7112 Sample Makefile Code VVVV WV UC 7101 7110 7112 Software User s Manual Getting Started Powering on the UC 7101 7110 7112 Connect the SG wire to the Shielded Contact located on the upper left corner of the UC 7101 7110 7112 and then power on the UC 7101 7110 7112 by connecting the power adaptor It takes about 16 seconds for the system to boot up Once the system is ready the Ready LED will light up ATTENTION After connecting the UC 7101 7110 7112 to the power supply it will take about 16 seconds for the operating system to boot up The green Ready LED will not turn on until the operating system is ready Connecting the UC 7101 7110 7112 to a PC There are two ways to connect the UC 7101 7110 7112 to a PC Console Port The serial console port offers users a convenient means of connecting to the UC 7101 7110 7112 This method is particularly useful when using the UC 7101 7110 7112 for the first time Since the communication is over a direct serial connection you do not need to know either of the IP addresses in order to make contact Use the serial console port settings shown on the right Once the connection is established the window below will open E COM8 19200 None 8 1 Y 1100 Te INET Registered protocol family 17 VES Mounted root jf s2 files
32. o lib modules 2 6 9 MoXaRt kernel drivers mmc mmc block ko lib modules 2 6 9 MoXaRt kernel drivers mmc moxasd ko Upgrading the Kernel The UC 7101 7110 7112 kernel is uc7110 3 x bin uc7112 1 x bin for UC 7112 which can be downloaded from www moxa com You must first download this file to your PC and then use the Console Terminal or Telnet Console to copy the file to the UC 7101 7110 7112 You can save this file to the UC 7101 7110 7112 s RAM disk and then upgrade the kernel The following is a step by step example To enable the RAM disk use the following command gt upramdisk After executing upramdisk you may use mount to find out if the new ramdisk has been created successfully upramdisk mount dev mtdblock2 on type jffs2 ro noatime proc on proc type proc rw nodiratime dev ram0 on var type ext2 rw dev mtdblock3 on var tmp type jffs2 rw noatime dev mtdblock3 on home type j s2 rw noatime dev mtdblock3 on etc type jffs2 rw noatime dev mtdblock3 on usr bin type j f s2 rw noatime y dev ram0 on ramdisk type ramf s rw To navigate to the device node use the following command gt cd ramdisk Use the built in FTP client to download the uc7110 3 x bin file from the PC ramdisk gt ftp destination PC s IP gt Login Name xxxx Login Password xxxx ftp bin ftp gt get uc7110 3 x bin 4 10 UC 7101 7110 7112 Software User s Manual Configuring UC 7101
33. o chain is selected all chains are listed n Numeric output of addresses and ports iptables t tables FXZ F Flush the selected chain all the chains in the table 1f none is listed X Delete the specified user defined chain Z Set the packet and byte counters in all chains to zero 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 included INPUT OUTPUT and FORWARD INPUT chains are accepted automatically and all connections are accepted without being filtered iptables F iptables X iptables Z Define policy for chain rules Usage iptables t tables P INPUT OUTPUT FORWARD PREROUTING OUTPUT POSTROUTING ACCEPT DROP P Set the policy for the chain to the given target INPUT For packets coming into the UC 7101 7110 7112 OUTPUT For locally generated packets FORWARD For packets routed out through the UC 7101 7110 7112 PREROUTING To alter packets as soon as they come in POSTROUTING To alter packets as they are about to be sent out Examples iptables P INPUT DROP iptables P OUTPUT ACCEPT iptables P FORWARD ACCEPT 4 5 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 iptables t nat P PREROUTING ACCEPT iptables t nat P OUTPUT ACCEPT iptables t nat P POSTROUTING ACCEPT In this example the policy accepts outgoing packets and denies incoming
34. ollection ccceeceeseesceeseeeceesceesceeeceecesecesecnseeeeeaeeeneeess A 1 NI ett ege e euin seite A 1 D0 U0 A 1 Network da lets ld A 2 PLOCESS aote p di A ie RD A 2 Eu A 2 Moxa Special Util ere A 2 Appendix B SNMP Agent with MIB Il 8 RS 232 Like Group suse B 1 Appendix C TAG iiic aa daa C 1 1 Introduction The Moxa UC 7101 7110 7112 Series of mini RISC based ready to run embedded computers are ideal for your embedded applications The UC 7110 and UC 7112 feature dual 10 100 Mbps Ethernet ports and two RS 232 422 485 serial ports in a built in uClinux ARM9 box The UC 7101 features one 10 100 Mbps Ethernet port and one RS 232 422 425 serial port In addition the UC 7101 and UC 7112 provide an internal SD socket for storage expansion offer high performance communication and unlimited storage in a super compact palm size box The UC 7101 7110 7112 embedded computers are the right solutions for embedded applications that use a lot of memory but that must be housed in a small physical space without sacrificing performance This chapter covers the following topics Overview Package Checklist Product Features Product Specifications gt Hardware Specifications Oooo gt Software Specifications UC 7101 7110 7112 Software User s Manual Introduction Overview The UC 7101 7110 7112 Series of mini RISC based communication platforms are ideal for
35. packets Append or delete rules NAT NOTE Usage iptables t table AI INPUT OUTPUT FORWARD io interface p tcp udp icmp all s IP network sport ports d IP network dport ports j ACCEPT DROP A Append one or more rules to the end of the selected chain I Insert one or more rules in the selected chain as the given rule number i Name of an interface through which a packet will be received 0 Name of an interface through which a packet will be sent p The protocol of the rule or of the packet to check Source address network name host name network IP address or plain IP address sport Source port number d Destination address dport Destination port number Bb Jump target Specifies the target of the rules 1 e how to handle matched packets For example ACCEPT the packet DROP the packet or LOG the packet Examples Example 1 Accept all packets from lo interface iptables A INPUT i lo j ACCEPT Example 2 Accept TCP packets from 192 168 0 1 iptables A INPUT i eth0 p tcp s 192 168 0 1 j ACCEPT Example 3 Accept TCP packets from Class C network 192 168 1 0 24 iptables A INPUT i eth0 p tcp s 192 168 1 0 24 j ACCEPT Example 4 Drop TCP packets from 192 168 1 25 iptables A INPUT i eth0 p tcp s 192 168 1 25 j DROP Example 5 Drop TCP packets addressed for port 21 iptables A INPUT i eth0 p tcp dport 21 j DROP Example 6 Ac
36. r Windows IP Netmask 192 168 4 100 24 Gateway 192 168 4 127 NAT Area Private IP ttecho 1 gt proc sys net ipv4 ip forward insmod lib modules 2 6 19 uclMoXaRt kernel net netfilter x tables ko insmod lib modules 2 6 19 uclMoXaRt kernel net netfilter xt multiport ko insmod lib modules 2 6 19 uclMoXaRt kernel net netfilter xt MARK ko insmod lib modules 2 6 19 uclMoXaRt kernel net netfilter xt tcpudp ko insmod lib modules 2 6 19 uclMoXaRt kernel net ipv4 netfilter ip tables ko insmod lib modules 2 6 19 uclMoXaRt kernel net ipv4 netfilter ip nat ko insmod lib modules 2 6 19 uclMoXaRt kernel net ipv4 netfilter iptable nat ko insmod lib modules 2 6 19 uclMoXaRt kernel net ipv4 netfilter ipt MASQUERADE ko insmod lib modules 2 6 19 uclMoXaRt kernel net ipv4 netfilter ip_nat_ftp ko iptables t nat A POSTROUTING o eth0 j SNAT to source 192 168 3 127 or iptables t nat A POSTROUTING o eth0 j MASQUERADE 4 7 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 Enabling NAT at Bootup In most real world situations you should use a simple shell script to enable NAT when the UC 7101 7110 7112 boot up as indicated by the following setting iptables iptables save gt home xxx file xxx file is the user defined file name vi etc rc Append echo 1 gt proc sys net ipvA ip forward Append iptables restore home xxx file xxx file is the user defined file name Si ge eS Config
37. re incorporated into new editions of the publication Technical Support Contact Information www moxa com support Moxa Americas Moxa China Shanghai office Toll free 1 888 669 2872 Toll free 800 820 5036 Tel 1 714 528 6777 Tel 86 21 5258 9955 Fax 1 714 528 6778 Fax 86 10 6872 3958 Moxa Europe Moxa Asia Pacific Tel 49 89 3 70 03 99 0 Tel 886 2 8919 1230 Fax 49 89 3 70 03 99 99 Fax 886 2 8919 1231 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Table of Contents d geet EE 1 1 OVAs AI a 1 2 Package Checklist ung orte edt eem centem tnde 1 2 Product Eeatutes ue A 1 3 Product Specifications sse eee eene nennen nnne nennen nnn 1 3 Hardware Specifications eene S ie Re ep ud 1 3 Software Specifications ccccececssessseeeceesceeeceeeceeceseceaeceaecsaecseeeaeeeaecaeecaeeeseeeeeeeseeeeeees 1 4 Getting Started eere ii ree dna aii aa Ea dvi Fh Rage dua 2 1 Powering on the UC 7101 7T IO TTI2 x p tse eee rette eee ete tete e teda 2 2 Connecting the UC 7101 7110 7112 to a bt 2 2 Console Port dee eee ced pee eed Eat pe 2 2 ipd dp 2 3 Configuring the Ethernet Interface 2 4 Developing Your Applications sese 2 6 Installing the UC 7101 7110 7112 Tool Chain eene 2 6 Compiling Hello 2 7 Uploading Hello to the UC 7101 7110 7112 ieioea a e 2 7 Running Hello on the UC 7101 7110 7112 sssseeseeeenenennne 2 8 Sample
38. ress ipNetToMediaType ipRoutingDiscards UC 7101 7110 7112 Software User s Manual SNMP Agent ip MIB tcp MIB udp MIB ipForwarding tcpRtoAlgorithm udpInDatagrams ipDefaultTTL tcpRtoMin udpNoPorts ipInReceives tcpRtoMax udpInErrors ipInHdrErrors tepMaxConn udpOutDatagrams ipInAddrErrors tcpActiveOpens udpTable ipForwDatagrams tcpPassiveOpens udpLocalAddress ipInUnknownProtos tcpAttemptFails udpLocalPort ipInDiscards tcpEstabResets ipInDelivers tcpCurrEstab ipOutRequests tcpInSegs ipOutDiscards tcpOutSegs ipOutNoRoutes tcpRetransSegs ipReasmTimeout tepConnTable ipReasmReqds tepConnState ipReasmFails tepConnLocalAddress ipFragOKs tcpConnLocalPort ipFragFails tcpConnRemA ddress ipFragCreates tepConnRemPort ipAddrTable tcpInErrs ipAdEntAddr tcpOutRsts ipAdEntlIfIndex ipAdEntNetMask ipAdEntBcastAddr ipAdEntReasmMaxSize ipRouteTable ipRouteDest ipRoutelfIndex ipRouteMetricl ipRouteMetric2 ipRouteMetric3 ipRouteMetric4 ipRouteNextHop ipRouteType ipRouteProto ipRouteAge ipRouteMask ipRouteMetric5 ipRouteInfo ipNetToMediaTable ipNetToMedialfIndex UC 7101 7110 7112 Software User s Manual SNMP Agent snmp MIB snmpInPkts snmpOutPkts snmpInBad Versions snmpInBadCommunityNames snmpInBadCommunityUses snmpInASNParseErrs snmpInTooBigs snmpInNoSuchNames snmpInBad Values snmpInReadOnlys snmpInGenErrs snmpInTotalReq Vars snmpInTotalSetVars snmpInGetRequests snmpInGetNexts snmpInSetRequests snmpInGetResponses s
39. river here uart driver for dev ttyMO dev ttyM1 insmod lib modules 2 9 MoXaRt kernel drivers char mxser ko etc rc modified line 1 ct 36 2 State OPEN mmm Got Break Signal 4 Issue the vi write command to save the file and then reboot Since the UC 7101 7110 7112 only reads the rc file when booting up you must reboot e g by issuing the vi reboot command for the changes to take affect ifconfig eth0 192 168 5 127 This will change the IP address of LANI Issuing this command will however NOT update the re file in the UC 7101 7110 7112 s flash memory so the next time you reboot the IP address will revert to its previous value 2 5 UC 7101 7110 7112 Software User s Manual Getting Started Developing Your Applications Step 1 Connect the UC 7101 7110 7112 to a Linux PC Step 2 Install the Tool Chain GNU Cross Compiler uClibc Step 3 Configure the cross compiler and uClibc environment variables Step 4 Code and compile your program Step 5 Download the program to the UC 7101 7110 7112 by FTP or NFS Step 6 Debug the program If the program is OK proceed to Step 7 If the program needs to be modified go back to Step 4 Step 7 Back up the user directory and then if needed distribute the code to additional UC 7101 7110 7112 units Installing the UC 7101 7110 7112 Tool Chain Linux Cross Compiler A The PC must have the Linux operating syst
40. rn value Output 0 zero for no error Any other number indicates an error You can get the 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 0 for user application disable sWatchdog does not need to do ack time The time period to ack sWatchDog Input int fd the file handle from swtd_open return value int mode the function will be return the status enable or disable user application need to do ack unsigned long time the function will return the current time period Output 0 zero for no error Any other number indicates an error You can get the error code from errno int swtd ack int fd Description Acknowledge sWatchDog When the user application has enabled sWatchDog it will call this function periodically with a user predefined time in the application program Input int fd the file handle from swtd_open return value Output 0 zero for no error Any other number indicates an error You can get the error code from errno int swtd close int fd Description Close the file handle Input int fd the file handle from swtd_open return value Output 0 zero for no error Any other number indicates an error You can get the error code from errno UC 7101 7110 7112 Software User s Manual UC 7101 7110 7112 Device API 4 Special Note When you
41. t touch update the access and modification times of each file to the current time vi text editor cat dump file context grep print lines matching a pattern cut remove sections from each line of files find search for files in a directory hierarchy more dump file by one page test test if file exists or not echo echo string UC 7101 7110 7112 Software User s Manual System Commands Network Process Other ping ping to test network route routing table manager netstat display network status ifconfig set network IP address tftp tftp protocol telnet user interface to TELNET protocol ftp file transfer protocol iptables iptables command kill kill process killall kill process by name ps report process status sleep suspend command on time dmesg dump kernel log message stty set serial port mknod make device node free display system memory usage date print or set the system date and time env run a program in a modified environment clear clear the terminal screen reboot reboot power off on the server halt halt the server gzip gunzip zcat compress or expand files hostname show system s host name tar tar archiving utility Moxa Special Utilities cat etc version show user directory version upramdisk mount ramdisk downramdisk unmount ramdisk kversion show kernel version setin
42. terface set UART interfaces program SNMP Agent with MIB II amp RS 232 Like Group The UC 7101 7110 7112 has a built in SNMP Simple Network Management Protocol agent that supports RFC1317 RS 232 like group and RFC 1213 MIB II The following table lists the variable implementation for the UC 7101 7110 7112 The full SNMP object ID of the UC 7101 7110 7112 is iso 3 6 1 4 1 8691 12 7112 and iso 3 6 1 4 1 8691 12 7110 Note that the UC 7101 7110 7112 does not support SNMP trap RFC1213 MIB II supported SNMP variables system MIB interface MIB at MIB icmp MIB sysDescr ifNumber atTable icmpInMsgs sysObjectID ifTable atIfIndex icmpInErrors sysUpTime ifIndex icmpInDestUnreachs sysContact ifDescr atPhysAddress icmpInTimeExcds sysName ifType atNetAddress icmpInParmProbs sysLocation ifMtu icmpInSrcQuenchs sysServices ifSpeed icmpInRedirects 1fPhysAddress icmpInEchos ifAdminStatus icmpInEchoReps ifOperStatus icmpInTimestamps ifLastChange icmpInAddrMasks ifInOctets icmpInAddrMaskReps 1fInUcastPkts icmpOutMsgs 1fInNUcastPkts icmpOutErrors ifInDiscards icmpOutDestUnreachs iffnErrors icmpOutTimeExcds iffnUnknownProtos icmpOutParmProbs ifOutOctets icmpOutSrcQuenchs ifOutUcastPkts icmpOutRedirects ifOutNUcastPkts icmpOutEchos ifOutDiscards icmpOutEchoReps ifOutErrors icmpOutTimestamps ifOutQLen icmpOutAddrMasks ifSpecific icmpOutAddrmaskReps ipNetToMediaPhysA ddress ipNetToMediaNetA dd
43. uring Dial in Dial out Service Dial out Service Direct cable connection e Without username and password use gt pppd connect chat v dev ttyMO 38400 crtscts amp e With username and password use gt pppd connect chat v user xxxxx password xxxxx dev ttyMO 38400 crtscts amp Connect Using a Modem e Use gt pppd connect chat v ATDT phone number CONNECT user xxxxx password xxxxx dev ttyMO 38400 crtscts amp ATTENTION If dial out fails the pppd connection will be blocked and the users will need to shut down pppd and re dial Since the return value is always OK regardless of whether or not the connection is blocked the API must be set up to check the network status to determine if the connection is complete Dial in Service Direct cable connection e Use either of the following gt pppd Local IP Address Remote IP Address dev ttyM1 38400 local crtscts or gt pppd lt Local_ IP Address gt lt Remote IP Address dev ttyM0 38400 local crtscts login auth Connect Using a Modem e Use gt pppd connect chat v AT CONNECT local IP Address Remote IP Address dev ttyMO 38400 crtscts login auth 4 8 UC 7101 7110 7112 Software User s Manual Configuring UC 7101 7110 7112 Configuring PPPoE PPPoE relies on two widely accepted standards PPP and Ethernet which permit the use of PPPoE Point to Point Over Ethernet PPPoE is a specification for connecting users on
44. ystem OTR Freeing init memory 56K IBusyBox v1 00 2005 12 08 07 21 0000 Built in shell msh Serial Console Port Settings Baudrate 19200 bps Parity None Data bits 8 Stop bits 1 Flow Control None Terminal VT100 Enter help for a list of built in commands Welcome to l l l l l Product UC 7110 Series For further information check 2 2 ales UC 7101 7110 7112 Software User s Manual Getting Started Telnet A ATTENTION e Serial Console Reminder Remember to choose VT100 as the terminal type Use the cable If you know at least one of the two IP Default IP Address Default Netmask addresses and netmasks then you can use Telnet to connect to the LAN 1 192 168 3 127 255 255 255 0 LE corola LAN 2 192 168 4 127 255 255 255 0 Telnet can be used locally by using a crossover Ethernet cable to connect your computer to the UC 7101 7110 7112 or over a LAN or the Internet The default IP addresses and netmasks are shown above To login type the Login name and password as requested The defaults are Login root Password root cs Telnet 192 168 3 127 moxa com tw login root Password Welcome to Product UC 7110 Series For further information check http 7 uwvw moxa com tw BusyBox vi BB 2805 12 08 07 21 0080 5 Built in shell lt msh gt Enter help for a list of built in commands Hu Once you open the msh command

Download Pdf Manuals

image

Related Search

Related Contents

ND 1200 QUADRA-CHEK  RMC-RX62G 取扱説明書第2.02版  INSTALLATION and OPERATION MANUAL 10K SCISSOR LIFT  Goodram PRO 4GB DDR3  HKTS 5 - Harman Kardon  Emerson 2625NS Data Sheet    Kathrein UFS 922sw/250GB  GK9 USER MANUAL - Discount Scooters  ASUS (WI500Q) User's Manual  

Copyright © All rights reserved.
Failed to retrieve file