Home
UC-7112/7110 User`s Manual v2
Contents
1. Flash Context Flash Address Size Access control Boot loader 0 Ox3ffff 256K Read ONLY 0x40000 0x3 fffff 4M Read ONLY JFFS2 User Directory 0x400000 Ox7fffff 4M 256K Read Write JFFS2 Developers should only save their own programs in partitions etc home tmp and usr bin We also advise users to store executable files in usr bin since doing so will allow developers to use hotkeys In addition to the flash file systems a RAM based file system is mounted in var There are fundamental differences between programming an embedded computer and programming a PC When programming your embedded computer you should follow two important programming guidelines to ensure that your applications run smoothly 1 Install your executable programs in the on board flash 2 Use the external SD card for data storage Following these guidelines will help to ensure that your applications run smoothly and trouble free Journaling Flash File System JFFS2 The flash user directory is 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 li
2. csssseeceessseeeeeeeseeeeeeesseneeeessseeeeeeenseeneeeeees 4 1 Enabling and Disabling Daemons seseseseseeseeeeeeeeeenen nennen eene ener 4 2 Adding Web Page tegere dte unb Db PU ie 4 3 IPTABEES 5er oie rib e ae re ade eee e Utd eee e ode ere HET ege 4 3 TAG dr eee tet o e esee toot oett M ee due a EE RP rU qoe E 4 7 Chapter 5 Chapter 6 Appendix A Appendix B Appendix C Enabling NAT 3t BootUp sene beo se gie ilte e dee e i anus 4 7 Configuring Dial in Dial out Service sse eee enne 4 8 Dial out Service nasien ERU Rete err E Or eee te tees RE de eed 4 8 Dial imn Service oie trie ace e TH peace ie e er etes 4 8 Configuring PPPOE nte eere eate aah ae ean ene 4 8 How to Mount a Remote NFS Server esssssssseseeeeeeeeene enne enne nene nennen enne 4 9 Dynamic Driver Module Load Unload sese 4 9 Upgrading the Kernel eee eee et iei ee ee Re Res 4 10 Upgrading the Root File System amp User Directory sss 4 11 User Directory Backup UC 7112 7110 to PC ssssssssssssseseseeeeeenenn ens 4 12 Loading Factory Defaults nec ee Rt Ie ER ae e ER SURE de AR RET ies 4 12 Mirroring the Application Program and Configuration 4 12 Autostarting User Applications on Bootup ccccesceescessseesceeeeeeecesecnaeeaecseecaeeeaeeeeeeeeeseeses 4 13 Checking the Kernel and Root File System Versions sse 4 13
3. r Local Package Directory ie Ns j mes Step 4 Click Next to begin the package installation A progress bar appears to check the MD5 status of each software package Click Next to finish the installation ATTENTION You can download the Tool Chain software from Moxa s website Navigate to the UC 7112 7110 product page click the Documentation amp Drivers link and then click Go under Driver amp Software Downloads Compiling Hello c The Tool Chain path is PATH usr local arm elf bin PATH The UC 7112 7110 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 r 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 UC 7112 7110 Software User s Manual Getting Started root localt y nPuW nuy 1 j 00 root localhost hello s Bi Uploading Hello to the UC 7112 7110 pipe o hel elf2flt ld hello hello c hello gdb hello o Makefile Issue the following commands from the PC to use FTP to upload hello to UC 7112 7110 ftp 192 168 3 127 ftp cd home ftp bin ftp put hello ftp quit telnet 192 168 3 127 C C C C C C de ws M 4 C dr Q g C 0 C 0 IRR RRR Re e e e Ce co nplet
4. 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 7112 7110 OUTPUT For locally generated packets FORWARD For packets routed out through the UC 7112 7110 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 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 packets Append or delete rules 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 X Destination port number j Jump target Specifies the tar
5. UC 7112 7110 Device AP c ccecsseesssesseeeee eene nnne n nhan anas ara n aaa aaa naa 5 1 RIC Real Time Clock esseri de eed te eio edades Qe TERES 5 2 lal 5 2 UART Interface 55er eer Ua PR ER Eee s BR pen teg ea toot yet ea 5 2 exl ge ct 6 1 UC Finder for Windows intr e e ceteri redet ee egeat 6 2 UG Finder for Linux uo eter Rea e ae D e ERU e DRE 6 5 System CORimalrds x eite bett ehem ticis ete ee eee A 1 busybox uClinux normal command utility collection sese A 1 File manager nn n E RR E A e ER RET GUT R E A 1 EditoE s ume tette a e E o ta Tecos aa ee eat Ghote N A 1 Network ronin ro ee eb been e Pe DH ete EDU RR ERE ae A 2 lunc d kee ats A 2 Other E t i bee m E ed STR di mh edad ERE OR eee A 2 Moxa Special Utilities aede e e RR DR ERG RET ER te en A 2 SNMP Agent with MIB Il amp RS 232 Like Group B 1 j eec C 1 1 Introduction The Moxa UC 7112 7110 Series of mini RISC based ready to run embedded computers feature dual 10 100 Mbps Ethernet ports and two RS 232 422 485 serial ports in a built in wClinux ARM9 box In addition the UC 7112 provides an internal SD socket for storage expansion offers high performance communication and unlimited storage in a super compact palm s
6. 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 Windows Tool Chain Arm elf gcc V2 95 3 C C PC Cross Compiler uClibc V0 9 26 POSIX standard C library UC Finder UC s LAN IP broadcast searching utility for Windows and Linux UC 7112 7110 Software User s Manual Introduction Hardware Block Diagram Ethernet ayant 16 MB Circuit d I Watchdog i RS 232 422 485 RS 232 Appearance The top view of the UC 7112 is shown in the following figure The UC 7110 looks similar except that the UC 7110 does not have an internal SD slot Ethernet x 2 10 100BaseTx 12t048 VDC RS 232 Console Terminal UC 7112 Universal Communicator Ey Jam Socket Inside a i T RS 232 422 485 Internal SD Slot for Pi P2 Storage Expansion i T remove cover to access Serial Port 1 Serial Port 2 RS 232 422 485 RS 232 422 485 ry Card UC 7112 7110 Software User s Manual Introduction Dimensions The dimensions of the UC 7112 and UC 7110 are shown in the following figure a bi 6 0 24 4 0 16 MOXA 12 5 0 49 ex I Kx P2 UC 7110 Universal Communicator 111 4 31 O RS 232 422 485 3 1
7. if you want to change then you need modify following rc line 1 of 34 2 Ji di Got Break Signa UC 7112 7110 Software User s Manual Getting Started ATTENTION Use the following command to reset the IP address immediately 3 You may also configure the UC 7112 7110 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 use the following commands to add the dhcpcd setting to the rc file dhepcd p a eth amp dhepcd p a eth1 amp Note that the UC 7112 7110 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 T190 DER m i bin sh hostname moxa com tw cat etc motd RTS 3 config lo 127 0 0 1 ethO 192 168 3 127 netmask 255 255 255 0 ethl 192 168 4 127 netmask 255 255 255 0 a eth0 amp gif you want CHCE please set this a ethl amp if you want DHCP please set this default gw 192 168 3 254 dev eth0 rtc clock to system clock nfs portmap IDortmap amp factory amp broadcast version Inecid amp simple snmp daemon snmpd amp Loading your driver here uart driver for dev ttyMO dev ttyM1 insmod lib modules 2 6 9 MoXaRt kernel drivers char mxser ko etc rc modified line 1 of 36 2 State DPEN m mm Got Break Signal 4 Issue the vi write command to save the file and the
8. This program is enabled by default in the etc re file Use the following command to mount the remote NFS server mount t nfs remote ip remote export directory local directory Dynamic Driver Module Load Unload In addition to supporting traditional static drivers the UC 7110 7112 also supports 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 insmod module directory module file name 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 rmmod module name listed by lsmod command For example to unload the UART driver type the following command 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 ko lib modules 2 6 9 MoXaRt kernel drivers mmc mmc block ko lib modules 2 6 9 MoXaRt kernel drivers mmc moxasd ko 4 9 UC 7112 7110 Softwa
9. xxxx ftp bin ftp get uc7110 3 x dsk ftp gt quit ramdisk gt upkernel ramdisk uc7110 3 x dsk reboot 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 C upkernel uc7112 1 8 dsk e context The firmware source file is OK The version is 1 80 This step will destory your old kernel Do you want to continue it V N V Erased 2560 Kibyte 0 100 complete Format OK Now update the root filesystem Please wait asia the root file system OK Please push the reset button UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 User Directory Backup UC 7112 7110 to PC Use the following commands to enable the RAM disk gt upramdisk cd ramdisk Use the backupfs command to backup the file system ramdisk gt backupfs ramdisk usrdisk backup backupfs ramdisk usrdisk backup Sync the file system Now backup the user directory Please wait ackup the user directory CK gt v The file system will be backed up Use FTP commands to transfer usrdisk backup to the FTP server on the PC cd ramdisk ramdisk 1s al 10 0 419430 drwxr xr x 10 0 3 _ 2 usrdisk backup Name 192 168 3 11 root 331 Password required for root Password ftp put usrdisk backup ALL usrdisk back 00 Port com
10. OBJS hello core gdb Change these if necessary LDFLAGS e 3 Software Package This chapter includes information about the software that is used with UC 7112 7110 Series products This chapter covers the following topics Q UC 7112 7110 Software Architecture gt Journaling Flash File System JFFS2 Q UC 7112 7110 Software Package UC 7112 7110 Software User s Manual Software Package UC 7112 7110 Software Architecture The UC 7112 7110 embedded computers come with the uClinux operating system pre installed The operating system follows the standard uClinux architecture The GNU Tool Chain provided by www uClinux org can be used to port programs that follow the POSIX standard to the UC 7112 7110 In addition to the Standard POSIX API device drivers for the serial ports buzzers and UARTs are also included User Application API Application Interface POSIX Socket Factory Default Configuration etc home Protected System Configuration MAZAI 9 Iu alee Configuration Parameters Inittab inetd cont boa cont a 3 5 u i D User Directory JFFS2 Read Write ARP ICMP IPV4 TCP UDP FTP 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 Ethemet The UC 7112 7110 s Flash ROM has multiple smaller partitions for the Boot Loader Linux Kernel am
11. P ce pud CUD command successful mnt home is ent directory 2 10 home ELL 7 tmp gt ramdisk _home UC 7112 7110 Software User s Manual Getting Started Running Hello on the UC 7112 7110 Issue the following commands on UC 7112 7110 to run the Hello program chmod 755 hello hello The words hello world will be printed on the screen cx Telnet 192 168 3127 Ht HHH fH HH HH E HHH 8d i uM MEI MEGUIUMEMII LEID ME I For fu informat ion check http noxa com ATTENTION Be sure to calculate the amount of Flash Memory used by the User File System in the Flash ROM Use one of the following two commands to determine the amount of memory being used df k or 4 d lk blocks Used Available Use Mounted on 1525 1825 0 100 1525 1525 0 100 4096 688 3408 17 mnt 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 UC 7112 7110 s serial console terminal and then delete files from the Flash ROM UC 7112 7110 Software User s Manual Getting Started Sample Makefile Code The following Makefile example codes are copied from the Hello example on the UC 7112 7110 s CD ROM srcdir LIBS CFLAGS LDFLAGS Wl elf2flt CC arm elf gcc CPP arm elf gcc E all hello hello CC o 8 S CFLAGS clean rm f
12. P2 47 3 1 56 me o 77 3 03 88 3 46 unit mm inch 100 4 18 UC 7112 7110 Software User s Manual Introduction UC 7112 7110 Schematic The UC 7110 schematic is shown in the following figure The layout of the UC 7112 is identical Top End View mmm Terminal Block Power Input RJ45 10 100 Mbps Ethernet Ports Nameplate View V V RESET LAN1 2 48V DIN Rail screw hole UC 7110 Universal Communicator Wallmount screw hole L RS 232 422 485 34 P1 P2 Bottom End View ooooo ooooo oooo oooo DB9 male Serial Ports UC 7112 7110 Software User s Manual Introduction LED Indicators The following table explains the function of the five LED indicators located on the UC 7112 7110 s top panel LED Name LED Color LED Function Ready Green Power is on and functioning normally P1 P2 Tx Green Serial port 1 or 2 is transmitting data Off Serial port 1 or 2 is not transmitting data P1 P2 Rx Yellow Serial port 1 or 2 is receiving data Off Serial port 1 or 2 is not receiving data Wiring Requirements This section describes how to connect the UC 7112 7110 to serial devices You should heed the following common safety precautions before proceeding with the installation of any electronic device e Use sepa
13. 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
14. 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 e Create the Connection gt pppd pty pppoe I ETHERNET INTERFACE m 1412 user USER NAME password USER PASSWORD amp ETHERNET INTERFACE Ethernet card connected to ADSL modem for example ethO USER NAME User account for example moxa adsl net 4 8 UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 lt USER_PASSWORD gt Password for user account To check if PPPOE is successfully connected use the command ifconfig ppp0 How to Mount a Remote NFS Server Currently the UC 7112 7110 only supports NFS Network File System clients Users can open NFS service on a Linux PC to enable the UC 7112 7110 to push data to it The UC 7112 7110 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 7112 7110 must run the portmap utility
15. conf etc motd etc protocols SR monaco sp p jp Se etc rc etc services home httpd index html S B ATTENTION This function only takes effect when the user directory 1s working correctly If the user directory has crashed the kernel will automatically load the factory defaults UC 7112 7110 Software User s Manual Introduction Real Time Clock UC 7112 7110 s real time clock is powered by a lithium battery We strongly recommend that you do not replace the lithium battery without the help of Moxa s support team If the battery needs to be changed contact the Moxa RMA service team for RMA service ATTENTION The battery may explode if replaced by an incorrect type To avoid this potential danger always be sure to use the correct type of battery 2 Getting Started In this chapter we explain the basic procedure for getting UC 7112 7110 connected and ready to use This chapter covers the following topics Q Powering on the UC 7112 7110 Q Connecting the UC 7112 7110 to a PC gt Console Port gt Telnet Configuring the Ethernet Interface Installing an SD Card UC 7112 only Developing Your Applications Installing the UC 71 12 7110 Tool Chain Compiling Hello c Uploading Hello to the UC 7112 7110 Running Hello on the UC 7112 7110 Sample Makefile Code Ooo VVVV V UC 7112 7110 Software User s Manual Getting Started Powering on the UC 7112 7110 C
16. help for a list of built in commands Welcome to Product UC 7110 Series For further information check 2 2 UC 7112 7110 Software User s Manual Getting Started Telnet ATTENTION e Serial Console Reminder Remember to choose VT100 as the terminal type Use the cable If you know the IP address and netmask Default IP Address Default Netmask of one of the UC 7112 7110 s Ethernet ports then you can use Telnet to connect LAN 1 192 168 3 127 255 255 255 0 to the UC 7112 7110 console 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 7112 7110 or by connecting to a hub or switch that connects to 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 cx Telnet 192 168 3 127 moxa com tw login root Password Welcome to m I Somme N Product UC 7110 Series For further information check http www moxa com tu Bus yBox v1 66 EQUIS NR PNE PRESS RB TEE TUER lt msh gt Enter help for a list of built in commands Hu Once you open the msh command shell you can proceed to configure the UC 7112 7110 s network settings as described in the next section CBL RJ45F9 150 that comes with the UC 7112 7110 to connect to the serial console port If you are not able to c
17. http developer axis com software jffs http www linux mtd infradead org UC 7112 7110 Software Package bin dev upkernel mtdblock1 ptype passwd gt tinylogin mtdr1 ptypd login gt tinylogin mtd1 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 ptypO necid ttypd ppp eraseall ttypc pio kversion ttypb rtc init ttypa ram1 expand ttyp9 ram0 inetd ttyp8 null hwclock ttyp7 kmem ftpd ttyp6 mem ftp ttyp5 cua mke2fs ttyp4 console e2fsck ttyp3 tty discard ttyp2 dheped ttypl cpu ttypO busybox ttySO boa tty3 bf tty2 backupfs tty downramdisk ttyO upramdisk roml rom0 ptypf 4 Configuring the UC 7112 7110 In this chapter we describe how to configure the UC 7112 7110 embedded computers The following topics are covered in this chapter Oooo m OOOOOCOCOOCD Enabling and Disabling Daemons Adding a Web Page IPTABLES NAT gt NAT Example gt Enabling NAT at Bootp 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 User Directory Backup UC 7112 7110 to PC Loading Factory Defaults Mirroring the Applic
18. 2 7110 Software User s Manual Configuring the UC 7112 7110 upramdisk upkernel uc7112 1 0 bin The kernel source file is OK The version is 1 0 This step will destory your old kernel Do you want to continue it V N V Formating disk Erased 2048 Kibyte 0 180 complete Format OK Now update the kernel Please wait ipdate the kernel OK Please restart system Upgrading the Root File System amp User Directory The UC 7112 7110 uses JFFS2 for the root file system and user directory By default the root file system is pre set to READ only The UC 7112 7110 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 7112 7110 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 7112 7110 You can save this file to the UC 7112 7110 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 cd ramdisk Use the built in FTP client to download the uc7110 3 x dsk file from the PC ramdisk gt ftp destination PC s IP Login Name xxxx Login Password
19. 2 7110 Software User s Manual Introduction The 10 100 Mbps Ethernet LAN 1 and LAN 2 ports use 8 pin RJ45 connectors Pinouts for these ports are given in the following diagram 8 pin RJ45 10 Mbps 100 Mbps Pin Signal indicator indicator 1 ETx 1 2 ETx 3 ERx 4 Em 5 m 1 8 6 ERx 7 ET 8 m Connecting to a Serial Device Connect the serial cable between the UC 7112 7110 and the serial device s Serial ports P1 and P2 use male DB9 connectors and can be configured for RS 232 422 485 by software The pin assignments are shown in the following table DB9 Male Port RS 232 422 485 Pinouts 12345 RS 485 RS 485 RS 232 RS 422 4 wire 2 wire n 5 1 DCD TxDA TxDA S 2 RxD TxDB TxDB m 3 TxD RxDB RxDB DataB 4 DTR RxDA RxDA DataA 6789 5 GND GND GND GND 6 DSR Em ae 7 RTS m mS 8 CTS Be Serial Console Port The serial console port is a 4 pin pin header RS 232 port It is designed for serial console terminals which are useful for identifying the UC 7112 7110 s boot up message Serial Console Port amp Pinouts Serial Console Cable p Pin Signal 5 1 TxD 2 RxD 3 NC 1 4 GND UC 7112 7110 Software User s Manual Introduction Internal SD Socket The UC 7112 has an internal SD socket for storage expansion Users can plug
20. M give you enough storage capacity and an additional SD socket provides you with flexible storage expansion to run a wide range of applications The dual LAN ports built into the ARM9 make the UC 7112 7110 an ideal communication platform for data acquisition and protocol conversion applications and the two 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 7112 7110 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 7112 7110 s Flash memory Package Checklist The UC 7112 7110 Series models currently available are UC 7112 LX Mini RISC based Ready to Run Embedded Computer with 2 Serial Ports Dual Ethernet SD uClinux OS UC 7110 LX Mini RISC based Ready to Run Embedded Computer with 2 Serial Ports Dual Ethernet wClinux OS UC 7112 7110 Series products are shipped with the following items 1 UC 7112 or UC 7110 UC 7112 7110 Quick Installation Guide Document and Software CD Ethernet cross over cable RJ45 to RJ45 100 cm Console port cable CBL 4PINDB9F 100 4 pin header to female DB9 cable 100 cm Universal Power Adaptor e Product Warranty Statement Optional Accessories e DK 35A DIN R
21. P 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 no 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 if 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 4 5 UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 Define policy for chain rules Usage
22. Secure Digital SD memory cards compliant with the SD 1 0 standard into the slot for up to 1 GB of additional memory space To install an additional SD card you must first remove the UC 7112 s outer cover to access the slot The internal SD socket is located at the backside of the UC 7112 s bottom board the SD plug in slot is located on the UC 7112 s right side lower than the cover screw Plug the SD card directly into the socket and remember to press the SD card first if you want to remove it Additional Functions Reset Button Press the RESET button continuously for more than 5 seconds to load the factory default configuration After loading the factory defaults the system will reboot automatically The System Ready LED will blink for the first 5 seconds We recommend that you only use this function if the software is not working properly To reset the uClinux system software always use the software reboot command reboot to protect the integrity of data that is in the process of being transmitted The reset button is NOT designed to hard reboot the UC 7112 7110 LY ENTION Resetting to factory defaults will not format the user directory and erase all of the user s data Loading factory defaults will only load the configuration file The files in the UC 7112 7110 that will be replaced include etc boa conf etc hosts etc inittab etc password etc ramfs img etc resolv conf etc version etc group etc inetd
23. 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 340 mA 12 VDC 4 5W 1 3 UC 7112 7110 Software User s Manual Introduction Software Operating temperature 10 to 60 C 14 to 140 F 5 to 95 RH Storage temperature 20 to 80 C 4 to 176 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 9 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
24. UC 7112 7110 User s Manual Fifth Edition June 2008 www moxa com product MOXA 2008 Moxa Inc all rights reserved Reproduction without permission is prohibited UC 7112 7110 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 2008 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 its 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 are inc
25. able 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 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 7112 7110 supports 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 7112 7110 Software User s Manual Configuring the UC 7112 7110 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 routi
26. ail Mounting Kit 35 mm NOTE Please notify your sales representative if any of the above items are missing or damaged UC 7112 7110 Software User s Manual Introduction Product Features UC 7112 7110 Series products 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 Dual 10 100 Mbps Ethernet SD expansion slot for storage expansion UC 7112 only uClinux ready communication platform DIN Rail or wall mounting installation Robust fanless design Product Specifications Hardware Specifications CPU Moxa ARMO9 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 only for UC 7112 LAN Auto sensing 10 100 Mbps x 2 LAN Protection Built in 1 5 KV magnetic isolation Serial Ports Both 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
27. ation Program and Configuration Autostarting User Applications on Bootup Checking the Kernel and User Directory Versions UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 Enabling and Disabling Daemons The following daemons are enabled when the UC 7112 7110 boots 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 7112 7110 plays 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 hwclock systohc Visit http www ntp org for a list o
28. ew 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 output 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 7112 7110 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 tracerout trace route tftp tftp protocol telnet user interface to TELNET protocol ftp file transfer protocol iptables restore restore iptables configuration file to network iptables iptables command iptables save save recent iptables configuration to file 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 ser
29. f Moxa embedded computers connected to the network UC Finder cannot be used to configure your embedded computers over the network If you need to configure IP address or other parameters of an embedded computer connect to the embedded computer s console utility by Telnet over the network or through the serial console using the serial console cable that came with the product Note that you can launch UC finder by double clicking the UC Finder icon located on your PC s desktop e UC Finder 6 4 UC 7112 7110 Software User s Manual UC Finder UC Finder for Linux To use the Linux ucfinder utility copy ucfinder from the CD ROM to your Linux PC and then use the following command to start ucfinder The ucfinder utility will automatically broadcast a message over your LAN network to find the IP addresses of all UC s connected to the LAN ucfinder A System Commands busybox 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 n
30. f recommended public NTP servers How to update the system time periodically with Network Time Protocol 1 Create a shell script file that includes the following description bin sh ntpdate ntp server ip hwclock systohc 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 shell script name UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 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 gt vi boa conf n A minimal config that makes the home page an unauthenticated CGI Alias fing 70 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 t
31. fe keeps the flash directory 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 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 jffs2 jffs2 pdf 3 3 UC 7112 7110 Software User s Manual Software Package
32. get 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 Accept TCP packets from 192 168 0 24 to UC 7112 7110 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 7112 7110 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 4 6 UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 NAT 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 7112 7110 connects several devices on a netw
33. ibed below to install the UC 7112 7110 Windows Tool Chain Step 1 Double click the tool chain windows setup exe on the UC 7112 7110 CD to begin the installation and then click Next UC 7112 7110 Software User s Manual Getting Started P Moxa Linux Tool Chain Setup Welcome 1ni x r Moxa UC 71XX Series Linux Tool Chain V1 0 Thank you for selecting Moxa Linux Tool Chain y AEN Moxa Linux Tool Chain Copyright 2006 Moxa Systems Co Ltd hitp www moxa com Step 2 Click Browse to select your installation location The default location is C Moxa Tool Chain F Moxa Linux Tool Chain Setup Choose Installation Directory Select Root Install Directory n Select the directory where you want to install Also choose a few installation UND parameters r Root Directory c Moxa Tool Chain Browse r Install For Default Text File Type All Users Recommend C DOS C Just Me Unix Recommend 2 8 UC 7112 7110 Software User s Manual Getting Started Step 3 Click Next to select the local package file directory and then click Browse to select where your installation source file is located The default path is to the location of the file setup exe Moxa Linux Tool Chain Setup Select Local Package Directory 1 lol x Select Local Package Directory Select the directory where the package files of Tool Chain exist
34. ity broadcasts messages over the LAN to determine the IP addresses of Moxa embedded computers connected to the LAN UC Finder does this by searching for the class of MAC addresses assigned to Universal Communicators The UC 7112 7110 supports the GUI style Windows UC Finder and a command line utility for Linux environments In this chapter we discuss the following UC Finder topics L UC Finder for Windows L UC Finder for Linux UC 7112 7110 Software User s Manual UC Finder UC Finder for Windows In this section we describe how to install UC Finder on a Windows PC 1 Double click the UC Finder installation program Setup exe to start the installation 2 When the Welcome to the UC Finder Setup Wizard window opens click Next to continue 15 xl Welcome to the UC Finder Setup Wizard i Setup UC Finder This will install UC Finder on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup 3 Select the Create a desktop icon option and then click Next to continue i Setup UC Finder ioj xl Select Additional Tasks ly Which additional tasks should be performed Q M Select the additional tasks you would like Setup to perform while installing UC Finder then click Next Additional icons lt Back Cancel 6 2 UC 7112 7110 Software User s Manual UC Finder 4 Check the La
35. ize box The UC 7112 and UC 7110 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 Oooo Product Specifications Hardware Specifications gt Software Specifications Hardware Block Diagram Appearance Dimensions Installing the UC 7112 7110 LED Indicators Wiring Requirements OOOOODL gt Connecting the Power gt Grounding the UC 7112 7110 Connecting Data Transmission Cables gt Connecting to the Network gt Connecting to a Serial Device gt Serial Console Port L Internal SD Socket Q Additional Functions gt Reset Button gt Real Time Clock m UC 7112 7110 Software User s Manual Introduction Overview The UC 7112 7110 Series of mini RISC based communication platforms are ideal for your embedded applications The UC 7112 7110 comes with 2 RS 232 422 485 serial ports and dual 10 100 Mbps Ethernet LAN ports to provide users with a versatile communication platform The UC 7112 7110 embedded computers 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 7112 7110 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 SDRA
36. mand successful 50 Cpening data connection for usrdisk backup 226 File received complete 4195224 bytes sent in 37 secs 113 Kbytes sec ftp v usrdisk backup 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 Mirroring the Application Program and Configuration For some applications you may need to Mirror or sometimes Ghost one UC 7112 7110 s user directory and duplicate it to other UC 7112 7110 embedded computers We recommend using the following procedure to do this 1 Backup the user directory to a PC ramdisk gt backupfs ramdisk lt user defined file name gt Refer to the previous topic User Directory Backup UC 7112 7110 to PC 2 Download the backed up user directory to the other UC 7112 7110 4 12 UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 ramdisk gt bf ramdisk lt User directory file name gt Refer to the previous topic Upgrading the Root File System amp User Directory Autostarting User Applications on Bootup To autostart user applications on bootup edit the etc rc file by adding your applicati
37. n reboot Since the UC 7112 7110 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 LAN1 However issuing this command will NOT update the re file in the UC 7112 7110 s flash memory For this reason the next time you reboot the IP address will revert to its previous value 2 5 UC 7112 7110 Software User s Manual Getting Started Installing an SD Card UC 7112 only the UC 7112 has an internal SD socket for storage expansion To access the socket perform the following steps to install the SD memory card Step 1 Loosen the screws of the UC 7112 s casing Step 3 The SD socket is located on the back side of the bottom board Insert the SD memory card as shown below Step 4 Before using SD card check the etc rc file to ensure that the driver module for controlling the SD card is loaded The loading sequence is shown below insmod lib modules 2 6 9 MoXaRt kernel drivers mmc mmc core ko insmod lib modules 2 6 9 MoXaRt kernel drivers mmc mmc_block ko insmod lib modules 2 6 9 MoXaRt kernel drivers mmc moxasd ko Step 5 To remove the SD memory card first press it in and then release The card will pop out partially You may now grasp the card and pull it out of the slot UC 7112 7110 Software User s Manual Getting Started Developing Your Applications S
38. nal block If the power is properly supplied the Ready LED will glow a solid green after a 25 to 30 second delay Grounding the UC 7112 7110 Grounding and wire routing help limit the effects of noise due to electromagnetic interference EMI Run the ground wire from the ground screw to the grounding surface prior to connecting devices ATTENTION This product should be mounted to a well grounded mounting surface such as a metal panel SG it SG The Shielded Ground sometimes called Protected Ground contact is the left most contact of the 3 pin power terminal block connector when viewed from the angle shown here Connect the SG wire to an appropriate grounded metal surface V V 12 48V Connecting Data Transmission Cables This section describes how to connect the UC 7112 7110 to the network serial devices and serial COM terminal Connecting to the Network Connect one end of the Ethernet cable to the UC 7112 7110 s 10 100M Ethernet port and the other end of the cable to the Ethernet network If the cable is properly connected the UC 7112 7110 will indicate a valid connection to the Ethernet in the following ways e Thetop right LED on the connector glows a solid green when connected to a 100 Mbps Ethernet network e The top left LED on the connector glows a solid orange when connected to a 10 Mbps Ethernet network e The LEDs will flash when Ethernet packets are being transmitted or received UC 711
39. ng process It has three extensions TTL MARK TOS The following figure shows the IPTABLES hierarchy Incoming Packets Mangle 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 Mangle Table POSTROUTING Chain Filter Table INPUT Chain Local Process Mangle Table OUTPUT Chain NAT Table OUTPUT Chain Filter Table OUTPUT Chain NAT Table POSTROUTING Chain Outgoing Packets UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 The UC 7112 7110 supports the following sub modules Be sure to use the module that matches your application ip_conntrack ipt MARK ipt_ah ipt_state ip conntrack ftp ipt MASQUERADE ipt esp ipt tcpmss ipt conntrack irc ipt MIRROT ipt length ipt tos ip nat ftp ipt REDIRECT ipt limit ipt ttl ip nat irc ipt REJECT ipt mac ipt unclean ip nat snmp basic ipt TCPMSS ipt mark ip queue ipt TOS ipt multiport ipt owner NOTE The UC 7112 7110 does NOT support IPV6 and ipchains Use iptables iptables restore iptables save to maintain the database NOTE 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 PP
40. oMedialfIndex B 2 UC 7112 7110 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 snmpInTraps 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 rs232OutSigTable rs232OutSigPortIndex rs2320utSigName rs232OutSigState B 3 FAQ FAQ 1 Answer 1 FAQ 2 Answer 2 FAQ 3 Answer 3 Why am I only able to use vfork and 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
41. on program For example you might add the following line to the file ap directory ap program 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 se the following command to check the root file system firmware version of the U UC 7112 7110 gt fsversion Use the following command to check the user directory version of the UC 7112 7110 gt cat etc version 4 13 5 UC 7112 7110 Device API In this chapter we discuss the Device API for the UC 7112 7110 Series We introduce the APIs for the following functions L RTC Real Time Clock L Buzzer U UART Interface UC 7112 7110 Software User s Manual UC 7112 7110 Device API RTC Real Time Clock The device node is located at dev rtc The UC 7112 7110 supports Clinux standard simple RTC control You must include lt linux rtc h gt to use these functions 1 Function RTC_RD_TIME int ioctl fd RTC RD TIME struct rtc time time Description Reads time information from RTC 2 Function RTC SET TIME int ioctl fd RTC SET TIME struct rtc time time Description Sets RTC time Buzzer The device node is located at dev console The UC 7112 7110 supports wClinux standard buzzer control The UC 7112 7110 s buzzer runs at a fixed frequency of 100 Hz You must include lt s
42. onnect on the first try unplug and then re plug the UC 7112 7110 s power cord e Telnet Reminder When connecting to the UC 7112 7110 over a LAN configure your PC s Ethernet card to be on the same subnet as the UC 7112 7110 you wish to contact 2 3 UC 7112 7110 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 7112 7110 s network settings 1 Change directories by issuing the command cd etc Product UC 7110 Series For further information check ttp www moxa com tw m EE 2 Type the command vi rc to use VI Editor to edit the configuration file Use the following commands to modify the IP addresses for the UC 7112 7110 s LANI and LAN2 ports ifconfig eth0 192 168 3 127 ifconfig ethl 192 168 4 127 Edit these two lines to modify the static IP addresses E COM8 19200 None 8 1 T100 m bin sh hostname moxa com tw org cat etc motd i ig lo 127 0 0 1 i config ethO 192 168 3 127 netmask ifconfig ethl 192 168 4 127 netmask zoute add default gw 192 168 3 254 dev eth0 Ertc clock to system clock nfs portmap Dortmap amp factory amp broadcast version necid amp 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
43. onnect the SG wire to the Shielded Contact located on the upper left corner of the UC 7112 7110 and then power on UC 7112 7110 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 7112 7110 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 7112 7110 to a PC You may connect the UC 7112 7110 to a PC through the UC 7112 7110 s console port or by Telnet over the network Console Port The serial console port offers users a Serial Console Port Settings convenient means of connecting to the UC 7112 7110 This method is particularly Baudrate 19200 bps useful when using the UC 7112 7110 for the first time Since the communication is over a direct serial connection you do not need to Data bits 8 know either of the IP addresses in order to Stop bits 1 make contact Parity None Use the serial console port settings shown on Flow Control None the right Once the connection is established Terminal VT100 the window below will open E COM8 19200 None 8 1 T100 DER INET Registered protocol family 17 VES Mounted root j s2 filesystem OTR Freeing init memory 56K IBusyBox v1 00 2005 12 08 07 21 0000 Built in shell msh Enter
44. ork 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 NOTE Click the following link for more information about iptables and NAT http www netfilter org documentation HOWTO NAT HOWTO html 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 IP Netmask 192 168 3 100 24 Gateway 192 168 3 127 PCI Linux or Windows LANI LANI ethO 192 168 3 127 24 UC 7110 LAN2 ethl 192 168 4 127 24 LAN2 PC2 Linux or Windows IP Netmask 192 168 4 100 24 Gateway 192 168 4 127 NAT Area Private IP 1 echo 1 gt proc sys net ipv4 ip forward 2 iptables t nat A POSTROUTING o eth0 j SNAT to source 192 168 3 127 or 3 iptables t nat A POSTROUTING o eth0 j MASQUERADE Enabling NAT at Bootup In most real world situations you should use a simple shell script to enable NAT when the UC 7112 7110 boots 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 ipv4 ip_ forward Append iptables restore home xxx file xxx file is the user defined file name emo par 4 7 UC 7112 7110 Software User s Manual Configuring the UC 7112 7110 Configu
45. orporated 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 Table of Contents Introductio Bep 1 1 OVVIE Wiss ccieviein ibe D Hive ist O A a atl iin a Ri coa Eee egt He ERR reed een tige cedit 1 2 Package Check list ocn eee eee ee cose tdi fess Geib e peers 1 2 Product Eeatutes 5 ugue erre egeo eit Pepe Eros ente E ee eeere debaters 1 3 Product Speeificatiohs etes neben ptuis ie t Abs 1 3 Hardware Specifications eee Se HER GI ER 1 3 Software Specifications cccececsseesseesceesceesceeeceeceseeeaeceaecsaecaeecaeeesecaeecaeeeneeeeeeneeeeneees 1 4 HardWare Block Di gram eie E ERR ERREUR RENE IRURE rS 1 5 APPEAL ANC so eie e gister gie Aene uet tete tete ie UAR MUS 1 5 Dimensions onde e RAH Pe eese aise Ue preset ete rel reiten des 1 6 UC 7112 7110 Schematic aA Aa E a E aA aA a A EAA ARA 1 7 IB Palin e m 1 8 Wiring Requirements REM 1 8 Connecting the POWet zones ett ea REA a 1 9 Grounding the UC 7112 7110 ssssssssessesseeeer eene 1 9 Connecting Data Transmission Cables s
46. p Root File System Image and User Directory Protocol Stack OS Kerner 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 UC 7112 7110 is specially design to partition a configuration parameters Linux Kernel amp Root The UC 7112 7110 has a built in mechanism that prevents system crashes and improves system reliability The procedure is described below 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 when the User Directory crashes The UC 7112 7110 uses ROMFS for the Linux kernel image Root File System and Protected configuration and uses JFFS2 for the User Directory 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 3 2 UC 7112 7110 Software User s Manual Software Package
47. rate paths to route wiring for power and devices If power wiring and device wiring paths must cross make sure the wires are perpendicular at the intersection point NOTE Do not run signal or communication wiring and power wiring in the same wire conduit To avoid interference wires with different signal characteristics should be routed separately Usethe 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 e Keep input wiring and output wiring separate e We advise users to label the wiring to all devices in the system ATTENTION Safety First Be sure to disconnect the power cord before installing and or wiring your UC 7112 7110 Wiring Caution Calculate the maximum possible current in each power wire and common wire Observe all electrical codes dictating the maximum current allowable for each wire size If the current goes above the maximum ratings the wiring could overheat causing serious damage to your equipment Temperature Caution Be careful when handling the UC 7112 7110 When plugged in the UC 7112 7110 s internal components generate heat and consequently the outer casing may feel hot to the touch 1 8 UC 7112 7110 Software User s Manual Introduction Connecting the Power Connect the live wire end of the 12 48 VDC power adaptor to the UC 7112 7110 s termi
48. re User s Manual Configuring the UC 7112 7110 Upgrading the Kernel The UC 7112 7110 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 7112 7110 You can save this file to the UC 7112 7110 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 jf fs2 ro noatime prac on proc type proc rw nodiratime dev ram0 on var type ext2 rw dev mtdblock3 on var tmp type jf s2 rw noatime dev mtdblock3 on home type j s2 rw ncatime dev mtdblock3 on etc type jf f s2 rw noatime dev mtdblock3 on usr bin type j s2 rw noatime dev ram0 on ramdisk type ramf s rw E To navigate to the device node use the following command 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 Login Name xxxx Login Password xxxx ftp bin ftp get uc7110 3 x bin Use the upkernel command to upgrade the kernel and root file system ramdisk gt upkernel uc7110 3 x bin ramdisk gt reboot 4 10 UC 711
49. ring 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 lt phone_number gt 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 lt Local_IP_Address gt lt Remote_IP_Address gt dev ttyM1 38400 local crtscts or gt pppd lt Local_IP_Address gt lt Remote_IP_Address gt dev ttyM0 38400 local crtscts login auth Connect Using a Modem Use gt pppd connect chat v AT CONNECT local IP Address Remote IP Address dev ttyMO 38400 crtscts login auth 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 an Ethernet to the Internet through a common broadband medium such as
50. s iflinNUcastPkts icmpOutErrors ifInDiscards icmpOutDestUnreachs iffnErrors icmpOutTimeExcds iffnUnknownProtos icmpOutParmProbs ifOutOctets icmpOutSrcQuenchs ifOutUcastPkts icmpOutRedirects ifOutNUcastPkts icmpOutEchos ifOutDiscards icmpOutEchoReps ifOutErrors icmpOutTimestamps ifOutQLen icmpOutAddrMasks ifSpecific icmpOutAddrmaskReps ipNetToMediaPhysAddress ipNetToMediaNetAddress ipNetToMediaType ipRoutingDiscards UC 7112 7110 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 tepCurrEstab 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 ipNetT
51. sessseseeseeeeeeenee nennen eene 1 9 Connecting to the Network ener nennen 1 9 Connecting toa Serial Device Re egt eie te ec Ae deed 1 10 Serial Console Port n nem duse ner E eet ted 1 10 Internal SD Socket Ec eere te tre MEER ected esto EP teen 1 11 Additional Eunctions mE ree eret bo E Rete Delete Pun 1 11 Reset Button ces d eei iei eec dre tti iet ite ipee eet 1 11 R al Time Glock 4 coe s ex eee 1 12 Getting Start d rone toto dae eeu e ene 2 1 Powering onthe UC 71TT12 TA 0 a eee te Ra C E ele td et 2 2 Connecting the UC 7112 7110 to a PC eene eene enne enne 2 2 Console Port deo e te edere Pete Eoo ate E eene aes 2 2 EA TA dT EE 2 3 Configuring the Ethernet Interface cerne a A E N enne nnne 2 4 Installing an SD Card UC 7112 only sees 2 6 Developing Your Applications erae eI Cn RE TREE SIE actos 2 7 Installing the UC 7112 7110 Tool Chain sese 2 7 Compiline Hello 6 4 uctor t eye itt egest ee IE ea 2 9 Uploading Hello to the UC 7112 7110 essere 2 10 Running Hello on the UC 7112 7110 sse 2 11 Sample Makefile Code sse ener enne 2 12 Software Package orte eee toten eae a ea 3 1 UC 7112 7110 Software Architecture sssssssssseseeeeeneeene nene 3 2 Journaling Flash File System JFFS2 essen 3 3 UC 7112 7110 Software Package eee Renee ee teme ie dente oe vas E 3 4 Configuring the UC 7112 7110
52. tep 1 Connect the UC 71 12 7110 to a Linux PC Step 2 Install the Tool Chain GNU Cross Compiler amp 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 7112 7110 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 7112 7110 units Installing the UC 7112 7110 Tool Chain Linux Cross Compiler A The PC must have the Linux operating system pre installed to install the UC 7112 7110 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 7112 7110 Tool Chain can be found on the UC 7112 7110 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 Windows In addition to the Linux Tool Chain the Windows Tool Chain for the UC 7112 7110 is on the UC 7112 7110 CD Use the installation procedure descr
53. unch UC Finder checkbox to use UC Finder immediately after the installation has finished and then click Finish to complete the installation i Setup UC Finder Completing the UC Finder Setup Wizard Setup has finished installing UC Finder on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup 5 When the UC Finder window opens click Broadcast Search to search for all Moxa embedded computers connected to the LAN Hix File Function About Broadcast Search No Model MAC Address IP Address Search Result 0 UC s 7 6 3 UC 7112 7110 Software User s Manual UC Finder 6 The Searching window will show the embedded computers that have been located You may click Stop as soon as the computer you are searching for is listed CTI ee Searching for UC Stop Found 1 UC s remain timeout 3 second s MAC Address IP Address uc 7110 00 90 E8 00 00 83 132 168 4 127 7 When the search is complete the Broadcast Search window closes and the Model MAC Address and IP Address of all embedded computers that were located will be listed in the UC Finder window iix File Function About Broadcast Search No Model MAC Address IP Address uc 7110 00 90 E8 00 00 83 182 168 4 127 Search Result 1 UCs ATTENTION UC Finder is designed solely to locate the IP addresses o
54. ver halt halt the server gzip gunzip zcat_ compress or expand files hostname show system s host name tar tar archiving utility Moxa Special Utilities backupfs backup file system user directory bf build file system user directory cat etc version show user directory version upramdisk mount ramdisk downramdisk unmount ramdisk kversion show kernel version setinterface set UART interfaces program A 2 B SNMP Agent with MIB Il amp RS 232 Like Group The UC 7112 7110 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 7112 7110 The full SNMP object ID of the UC 7112 7110 is iso 3 6 1 4 1 8691 12 7112 and iso 3 6 1 4 1 8691 12 7110 Note that the UC 7112 7110 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 ifPhysA ddress icmpInEchos ifAdminStatus icmpInEchoReps ifOperStatus icmpInTimestamps ifLastChange icmpInAddrMasks ifInOctets icmpInAddrMaskReps ifinUcastPkts icmpOutMsg
55. ys kd h gt to use these functions 1 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 7112 7110 Series supports uClinux standard termios control The Moxa UART Device API supports the configuration of ttyMO to ttyM1 as RS 232 422 485 To use these functions after the Tool Chain package is installed copy the file CDROM libuc7110 uc71 10 h to the directory usr local arm elf include on your Linux PC and then include lt uc7110 h gt in your application define RS232 MODE 0 define RSA485 2WIRE MODE 1 define RS422 MODE 2 define RS485 AWIRE MODE 3 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 2 Function MOXA GET OP MODE int mode int ioctl fd MOXA GET OP MODE amp mode Description Gets the interface mode 5 2 6 UC Finder The UC 7112 7110 comes with a UC Finder utility which is used to search the LAN or intranet for UC 7112 7110 embedded computers For most applications it is not easy to remember the IP addresses of embedded computers connected to the LAN This is especially true for troubleshooting and or testing in the field The UC Finder util
Download Pdf Manuals
Related Search
Related Contents
Samsung M197DF Instrukcja obsługi rétablir la démocratie et sauver la République Copyright © All rights reserved.
Failed to retrieve file