Moxa UC-7410 инструкция обслуживания

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

Идти на страницу of

Хорошее руководство по эксплуатации

Законодательство обязывает продавца передать покупателю, вместе с товаром, руководство по эксплуатации Moxa UC-7410. Отсутствие инструкции либо неправильная информация, переданная потребителю, составляют основание для рекламации в связи с несоответствием устройства с договором. В законодательстве допускается предоставлении руководства в другой, чем бумажная форме, что, в последнее время, часто используется, предоставляя графическую или электронную форму инструкции Moxa UC-7410 или обучающее видео для пользователей. Условием остается четкая и понятная форма.

Что такое руководство?

Слово происходит от латинского "instructio", тоесть привести в порядок. Следовательно в инструкции Moxa UC-7410 можно найти описание этапов поведения. Цель инструкции заключается в облегчении запуска, использования оборудования либо выполнения определенной деятельности. Инструкция является набором информации о предмете/услуге, подсказкой.

К сожалению немного пользователей находит время для чтения инструкций Moxa UC-7410, и хорошая инструкция позволяет не только узнать ряд дополнительных функций приобретенного устройства, но и позволяет избежать возникновения большинства поломок.

Из чего должно состоять идеальное руководство по эксплуатации?

Прежде всего в инструкции Moxa UC-7410 должна находится:
- информация относительно технических данных устройства Moxa UC-7410
- название производителя и год производства оборудования Moxa UC-7410
- правила обслуживания, настройки и ухода за оборудованием Moxa UC-7410
- знаки безопасности и сертификаты, подтверждающие соответствие стандартам

Почему мы не читаем инструкций?

Как правило из-за нехватки времени и уверенности в отдельных функциональностях приобретенных устройств. К сожалению само подсоединение и запуск Moxa UC-7410 это слишком мало. Инструкция заключает ряд отдельных указаний, касающихся функциональности, принципов безопасности, способов ухода (даже то, какие средства стоит использовать), возможных поломок Moxa UC-7410 и способов решения проблем, возникающих во время использования. И наконец то, в инструкции можно найти адресные данные сайта Moxa, в случае отсутствия эффективности предлагаемых решений. Сейчас очень большой популярностью пользуются инструкции в форме интересных анимаций или видео материалов, которое лучше, чем брошюра воспринимаются пользователем. Такой вид инструкции позволяет пользователю просмотреть весь фильм, не пропуская спецификацию и сложные технические описания Moxa UC-7410, как это часто бывает в случае бумажной версии.

Почему стоит читать инструкции?

Прежде всего здесь мы найдем ответы касательно конструкции, возможностей устройства Moxa UC-7410, использования отдельных аксессуаров и ряд информации, позволяющей вполне использовать все функции и упрощения.

После удачной покупки оборудования/устройства стоит посвятить несколько минут для ознакомления с каждой частью инструкции Moxa UC-7410. Сейчас их старательно готовят или переводят, чтобы они были не только понятными для пользователя, но и чтобы выполняли свою основную информационно-поддерживающую функцию.

Содержание руководства

  • Страница 1

    UC-7420/7410 User ’ s Manual Seventh Edition, February 2009 www .moxa.com/product © 2009 Moxa Inc. All righ ts reserved. Reproducti on without perm ission is pr ohibited.[...]

  • Страница 2

    UC-7420/7410 User’s Manual The software d escribed in thi s manual i s furnished u nder a license agreem ent and m ay be used only in accordance with the term s of that agreement. Copyright Notice Copyright © 2009 Moxa Inc. All rights reserved. Reproducti on without perm ission is pr ohibited. Trademarks MOXA is a re gistered tra demark of M oxa[...]

  • Страница 3

    Table of Contents Chapter 1 Introduction .................................................................................................. 1-1 Overview.................................................................................................................................. 1-2 Package Ch ecklis t............................................[...]

  • Страница 4

    Compiling tcps2.c..................................................................................................... 2-16 Uploading tcps2-release a n d Running the Pr ogram ................................................. 2- 17 Testing Procedure Summary .................................................................................... 2-19 Cha[...]

  • Страница 5

    File manager .............................................................................................................. A-1 Editor ......................................................................................................................... A-1 Network .................................................................................[...]

  • Страница 6

    1 1 Chapter 1 Introduction Welcome to M oxa UC-7420/ 7410 RISC- based Comm unication Platf orms. Availabl e features include eight RS-232/422/485 seri al ports, dual 10/100 Mbps Ethe rnet ports, a PCMCIA interface for wireless L AN communi cation, and C ompactFl ash and USB ports for mass storage disk expansion, m aking UC- 7420/7410 ideal for your[...]

  • Страница 7

    UC-7420/7410 User’s Manual Introduction 1-2 Overview UC-7420/741 0 RISC-based C ommunicati on Platfo rms are i deal for embedded applications. UC-7420/7 410 has eight RS-232/42 2/485 ser ial ports, dual 10/100 M bps Ethernet p orts, a PCMCIA interface for wireless LAN communicatio n, an d CompactFlash and USB port for m ass storage flash disk e x[...]

  • Страница 8

    UC-7420/7410 User’s Manual Introduction 1-3 Product Features y Intel XScale IXP422 266 MHz Processor y On-board 128 MB RAM, 32 MB Flash ROM y Eight RS-2 32/422/485 serial ports y Dual 10/100 Mbps Eth ernet y PCMCIA/CompactFlash expansion (UC-7420 on ly) y USB Host for mass storag e device (UC-7420 o nly) y LCM display an d Keypad for HMI y Linux-[...]

  • Страница 9

    UC-7420/7410 User’s Manual Introduction 1-4 Operating temperatur e -10 to 60 °C, (14 to 1 40°F), 5 to 95% RH S torage temperature -20 to 80 °C, (-4 to 1 85°F), 5 to 95% RH Regulatory Approvals EMC: FCC Class A, CE Class A Safety: UL, CUL, TÜV Wa r r a n t y 5 years Hardware Introduction Appearance and Dimensions Appearance UC-7410/7420 Rear [...]

  • Страница 10

    UC-7420/7410 User’s Manual Introduction 1-5 Dimensions 197 mm [7.76"] 125 mm [4.92"] 44 mm [1.73"][...]

  • Страница 11

    UC-7420/7410 User’s Manual Introduction 1-6 Hardware Block Diagram The following block diagram shows the layou t of UC-7420’s internal componen ts (the layout for UC-7410 is sl ightly di fferent). USB Host USB controller PCI to cardbus Bridge Moxa UART ASIC PCI Bus USB Client PCMCIA & CompactFlash Console LAN2 LAN1 RS-232/422/485 RS-232 Eth[...]

  • Страница 12

    UC-7420/7410 User’s Manual Introduction 1-7 Reset-type Buttons UC-7420/7410 ha s two reset-type buttons . The button labeled Reset has the sam e effect as unpluggin g the powe r and then plugging the power back in. The b utton lab eled Reset to defa ult returns UC-7420/7410 to the factory default parameter configuration. Reset Button Pressing the[...]

  • Страница 13

    UC-7420/7410 User’s Manual Introduction 1-8 Placement Options W all or Cabinet The two metal brackets that co me standard with UC-7420/7410 are used to attach UC-7420/7410 to a wall, or the inside of a cabinet. Use two scre ws per bracket first to attach the brackets to the bottom of the UC-7420/7410 (Fig. A). Next, us e two screws per bracket to[...]

  • Страница 14

    UC-7420/7410 User’s Manual Introduction 1-9 DIN-Rail Mounting The aluminum DIN-Rail attachm ent plate is included in the package. If you need to reattach the DIN-Rail attachment plate to UC-7420/7410, make sure the stiff metal spring is situated towards the top, as shown in the figures b elow. 1. Insert the top of the DIN-Rail into the slot just [...]

  • Страница 15

    UC-7420/7410 User’s Manual Introduction 1-10 You should al so observe the following comm on wiring rule s: y Use separate p aths to route wiring for power and devi ces. If powe r wiring and device wiri ng paths must cross, m ake sure the wires are perpendicular at t he intersection point. NOTE: Do not run signal o r communicati on wiring and powe[...]

  • Страница 16

    UC-7420/7410 User’s Manual Introduction 1-11 Connecting to the Network Connect one end of the Ethernet cab le to one of UC-7420/7410’s 10/100M Eth ernet ports (8-pin RJ45) and the other end of the cable to th e Ethern et network. If the ca bl e is properly connected, UC-7420/7410 will ind icate a valid connection to the Ethernet in the followin[...]

  • Страница 17

    UC-7420/7410 User’s Manual Introduction 1-12 CompactFlash UC-7420 pro vides one CompactFl ash slot that supports Com pactFlash type I/ II card expa nsion. Currently, Mo xa provides a CompactFlash disk for plug & play mass stor age expansi on. You m ay also use flash disks available from most computer su pply outlets. The CompactFlash will be [...]

  • Страница 18

    UC-7420/7410 User’s Manual Introduction 1-13 User AP User Directory (User Configuration) Mini Root File System Configuration Linux Kernel & Root HW Boot Loader To improve system reliability, UC-7420/7410 has a bu ilt-in mechanism that prevents th e system from crashing. The procedure is as follows. When the Linux kernel boots up, the kernel w[...]

  • Страница 19

    UC-7420/7410 User’s Manual Introduction 1-14 Although JFFS2 is a journaling file system, this does not preclude the loss of data. The file system will remain in a consistent state acros s power fa ilures a nd will always be m ountable. However, if the board is powered down during a write then the inco mplete write will be rolled back on the next [...]

  • Страница 20

    2 2 Chapter 2 Getting Started In this chapter, we explain how to conn ect UC-7420/7410, turn on the power, and th en get started using the programm ing and ot her functio ns. The following topics are covered in this chapter:  Powering on UC-7420/7410  Connecting UC-7420 /7410 to a PC ¾ Serial Cons ole ¾ Telnet Cons ole ¾ SSH Cons ole  C[...]

  • Страница 21

    UC-7420/7410 User’s Manual Getting Started 2-2 Powering on UC-7420/7410 Connect the SG wire to the Shielded Con tact located in the upper left corner of the UC-7420/741 0, and then power on U C-7420/7410 by connectin g it to the power adap tor. It takes about 30 to 60 seconds for the system to boo t up. Once the system is ready, the Ready LED wil[...]

  • Страница 22

    UC-7420/7410 User’s Manual Getting Started 2-3 Telnet Console If you know at least one of the tw o IP addresses an d netmasks, then you can use Telnet to connect to UC-7420/7410’s co nsole utility. The default IP a ddress and Netm ask for each of the two ports are given below: Default IP Address Netmask LAN 1 192.168.3.127 255.255.255 .0 LAN 2 [...]

  • Страница 23

    UC-7420/7410 User’s Manual Getting Started 2-4 ATTENTION Serial Console Reminder Remember to choose VT100 as the terminal type. Use cable C BL-RJ45F9-15 0, which com es with UC-7420/7410 , to connect to the serial console port. Telnet Reminder When conn ecting to UC-7420/7410 ov er a LAN, you must configur e your PC’s Ethernet IP address to be [...]

  • Страница 24

    UC-7420/7410 User’s Manual Getting Started 2-5 Linux Users From a Linux machine, use t he “ssh” command to access UC-7420/7410’s Console utility via SSH. #ssh 192.168.3.127 Select yes to complete the connection. [root@bee_notebook root]# ssh 192.168.3.127 The authenticity of host ‘192.168.3.127 (192.168.3.127)’ can’t be established. R[...]

  • Страница 25

    UC-7420/7410 User’s Manual Getting Started 2-6 Dynamic IP addresses : By default, UC-7420/7410 is configured for “static” IP addresses. To configure one or both LAN ports to request an IP address dynami cally, replace static with dhcp and then delete the address, network , netmask, and broa dcast lines. Default Setting for LAN1 Dynamic Settin[...]

  • Страница 26

    UC-7420/7410 User’s Manual Getting Started 2-7 NOTE After changing the IP settings, use the networking restart command to activate the new IP address. However, the LCM display will still sh ow the old IP address. To update the LCM display, you will need to reboot the UC-7420 /7410. Modifying Network Settings over the Network IP settings can be ac[...]

  • Страница 27

    UC-7420/7410 User’s Manual Getting Started 2-8 3. Configure the W ireless LAN card’s default SSID setting profile. (Default SSID is “any”) #vi /etc/wlan/wlan.conf // Consult your network administrator for SSID required in your wireless network. For example, SSID_waln0=” any”, Enable_w lan0=y // 4. Duplicate the configuration profile to [...]

  • Страница 28

    UC-7420/7410 User’s Manual Getting Started 2-9 IEEE802.11g The following I EEE802.11g wireless modules are supported: y ASUS — WL-1 07g y CNET — CWC-8 54 (181D ve rsion) y Edmiax — EW-7108PCg y Amigo — AWP-914W y GigaByte — GN-WMKG y Other brands that use the Ralin k RT2500 series chip set To configu re the WLAN for IEEE802. 11g: 1. Unp[...]

  • Страница 29

    UC-7420/7410 User’s Manual Getting Started 2-10 3. Additional WLAN parameters are contained in the file RT2500STA.dat . To open the file, navigate to t he RT2500ST A folder a nd invoke vi, or type t he followi ng comma nd #vi /etc/Wireless/RT2500STA/RT2500STA.dat to edit the file with vi editor. Settin g options for the various parameters are lis[...]

  • Страница 30

    UC-7420/7410 User’s Manual Getting Started 2-11 NetworkT ype —Sets the wireless operation mode Setting Explanation Infra Infrastructure mode (uses acc ess points to transmit data) Adhoc Adhoc m ode (transm its data from host to host ) Channel —Sets the channel Setting Explanation 0 auto 1 to 14 the channel yo u want to use AuthMode —Sets th[...]

  • Страница 31

    UC-7420/7410 User’s Manual Getting Started 2-12 T urboR ate —Enables or disables T u rboRate Setting Explanation 0 disable 1 enable BGProtection —Sets 1 1b/1 1g protection (t his function i s for e ngineering t esting only ) Setting Explanation 0 auto 1 always on 2 always off ShortSlot —Enables or disables t he short slot time Setting Expla[...]

  • Страница 32

    UC-7420/7410 User’s Manual Getting Started 2-13 Test Program — Developing Hello.c In this section, we use the standard “Hello” programming example to illu strate how to develop a program for UC-7420/7 410. In gene ral, prog ram developm ent involves t he followi ng seven steps . Step 1: Connect UC-7 420/7410 to a Linu x PC. Step 2: Install [...]

  • Страница 33

    UC-7420/7410 User’s Manual Getting Started 2-14 If there isn’t enough “Available” space for you r application, you will need to delete some existing files. To do this, connect your PC to the UC-7420 /7410 with the console cable, an d then use the console utility to delete the files from UC-7420/7410 ’s flash memory. NOTE If the flash me m[...]

  • Страница 34

    UC-7420/7410 User’s Manual Getting Started 2-15 Uploading “Hello” to UC-742 0/7410 and Running the Program Use the follo wing comm and to upload hello-release to the UC-7420/7410 via FTP. 1. From the PC, type: #ftp 192.168.3.127 2. Use bin command to set the transfer mode to Binary mode, and the put command to in itiate the file transfer: ftp[...]

  • Страница 35

    UC-7420/7410 User’s Manual Getting Started 2-16 Compiling tcps2.c The source code for the tcps2 exam ple is located on the CD -ROM at CD-ROM://example/TCPServer2/tcps 2.c . Use the following commands to copy the file to a specific directory on your PC. We use the direrctory /home/uc7400/1st_application/ . Note that you need to copy 3 files — Ma[...]

  • Страница 36

    UC-7420/7410 User’s Manual Getting Started 2-17 Uploading tcps2-release and Running the Program Use the following commands to use FTP to up load tcps2-release to the UC-7420/7410. 1. From the PC, type: #ftp 192.168.3.127 2. Next, use the bin command to set the transfer mode to Binary , and th e put command to initiate the file transfer: ftp> b[...]

  • Страница 37

    UC-7420/7410 User’s Manual Getting Started 2-18 4. The program should start running in the background. Use either the #jobs or #ps –ef command to check if the tc ps2 program is actually running in t he backgro und. #jobs // use this command to check if the program is running 192.168.3.127 – PuTTY root@Moxa:~# ls –al drwxr—xr-x 2 root root[...]

  • Страница 38

    UC-7420/7410 User’s Manual Getting Started 2-19 158 root 1532 S /sbin/getty 115200 ttyS1 162 root 3652 S /usr/sbin/sshd 163 root 2208 S -bash 169 root 2192 S ftpd: 192.168.3.110: root: IDLE 187 root 1264 S ./tcps2-release 188 root 1592 S ps -ef root@Moxa:~# NOTE Use the kill -9 command for PID 187 to terminate this program: #kill -9 %187 Testing [...]

  • Страница 39

    UC-7420/7410 User’s Manual Getting Started 2-20 NOTE The tcps2.c appl ication is a si mple exam ple designed to gi ve users a basic understan ding of the concepts inv olved in com bining Ethe rnet comm unication and seri al port c ommunicati on. However, the example program has some limita tions that make it unsuitab le for real-life applications[...]

  • Страница 40

    3 3 Chapter 3 Managing Embedded Linux This chapte r includes inf ormati on about vers ion contr ol, deploym ent, upda tes, and peri pherals. The information in this chapter will be particu larly useful when you need to run the same application on several UC -7420/74 10 units. The following topics are covered in this chapter:  System Version Info[...]

  • Страница 41

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-2 System Version Information To determine the hardware capability of your UC-7 420/7410 , and what kind of software functions are supported , check the versio n numbers of your U C-7420/7410’s h ardware, kernel, and u ser file system. Contact Moxa to determine th e hardware version. You will [...]

  • Страница 42

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-3 Since different Flash disks have different sizes, it’ s a good idea to check the size of your Flash disk before upgrading the firmware, o r before using the disk to store your application and data files. Use the #df –h command to list the size of each memo ry bl ock, and ho w much free sp[...]

  • Страница 43

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-4 -rw-rw-rw- 1 ftp ftp 8778996 Nov 29 10:24 UC7420_usrdisk-1.5.frm 226 Transfer complete. ftp> get UC7420-1.5.frm local: UC7420-1.5.frm remote: UC7420-1.5.frm 200 Port command successful. 150 Opening data connection for UC7420-1.5.frm 226 Transfer complete. 13167772 bytes received in 2.17 se[...]

  • Страница 44

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-5 Loading Factory Default s The easiest way to load factory defaults is to up d ate the firmware (follow the instructions in the previous section to u pgrade the firm ware). Note that if y our use r file is n ot working p roperly, the sy stem wi ll mount the M ini File S ystem. In this case, yo[...]

  • Страница 45

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-6 Type the command “ps –ef” to list all pro cesses currently running. 192.168.3.127 – PuTTY root@Moxa:~# cd /etc root@Moxa:/etc# ps -ef PID Uid VmSize Stat Command 1 root 1296 S init 2 root S [keventd] 3 root S [ksoftirqd_CPU0] 4 root S [kswapd] 5 root S [bdflush] 6 root S [kupdated] 7 [...]

  • Страница 46

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-7 Next, use the vi open your a pplication program. We use the exam ple program tcps2-release , and put it to run in the backg round. 192.168.3.127 – PuTTY # !/bin/sh # Add you want to run daemon /root/tcps2-release &~ Then you will find the enab led daemons after you reboot the system. 19[...]

  • Страница 47

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-8 Setting the Run-Level In this section, we outline the steps you should take to set the Linux run- level and execute requests. Use the follow ing comm and to enable or disable settings: 192.168.3.127 – PuTTY root@Moxa:/ect/rc.d/rc3.d# ls S19nfs-common S25nfs-user-server S99showreadyled S20sn[...]

  • Страница 48

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-9 Adjusting the System Time Setting the T ime Manually UC-7420/7410 has two time settings. One is the system time, and the other is the RTC (Real Time Clock) tim e kept by the UC-7420/7 410 hard ware. Use the #dat e command to query the cur rent system time or set a ne w system time. Use #hwclo[...]

  • Страница 49

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-10 NTP Client UC-7420/7410 has a bu ilt-in NTP (Network Time Protocol) client that is used to initialize a ti me request to a remote NTP server. Use #ntpdate < this client utility > to update the sy stem time. #ntpdate time.stdtime.gov.tw #hwclock –w Visit http://www.ntp.org fo r more i[...]

  • Страница 50

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-11 Cron—daemon to Execute Scheduled Commands This function is o nly available for firm ware version V1. 5 (and later version s). Start Cron from the directory /etc/rc.d/rc.local . It will return immediately, so you don’t need to start it with ‘&’ to run the backgroun d. The Cron dae[...]

  • Страница 51

    UC-7420/7410 User’s Manual Managing Embedded Linux 3-12 Connecting Peripherals USB Mass S torage This function is o nly available for firm ware version V1. 5 (and later version s). The UC-7420/7410 supports PNP (plug -n-play), and hot pluggability for connecting USB mass storage devices. UC-7420/ 7410 has a built-in auto m ount utility that eases[...]

  • Страница 52

    4 4 Chapter 4 Managing Communications In this chapt er, we ex plain how to configure UC -7420/7410 ’s various com muni cation functi ons. The following topics are covered in this chapter:  Telnet / FTP  DNS  Web Service—Apache ¾ Saving a W eb Page to the CF Car d  IPTABLES  NAT ¾ NA T Example ¾ Enabling NA T at Bootup  Dial[...]

  • Страница 53

    UC-7420/7410 User’s Manual Managing Communication 4-2 Telnet / FTP In addition to suppo rting Telnet client/server and FTP client/server, the UC-7420/7410 system also supports SSH and sftp client/server. To enable or disable the Telnet/ftp server, you first need to edit the file /etc/inetd.conf . Enabling the Telnet/ftp server The following examp[...]

  • Страница 54

    UC-7420/7410 User’s Manual Managing Communication 4-3 Web Service—Apache The Apache web server’s main co nfiguration file is /etc/apache/httpd.conf , with the default homepage loca ted at /usr/www/html/index.html . Save your own hom epage to the following directory: /usr/www/html/ Save your CGI page to the f ollowing direct ory: /usr/www/cgi-[...]

  • Страница 55

    UC-7420/7410 User’s Manual Managing Communication 4-4 To open the de fault CGI te st script re port page, ty pe http://192.168.3.127 /cg i-bin/test-cgi in your browser’s address box. NOTE The CGI functi on is enabl ed by defa ult. If yo u want to di sable the functi on, modi fy the file /etc/apache/httpd.conf . When you devel op your own CGI ap[...]

  • Страница 56

    UC-7420/7410 User’s Manual Managing Communication 4-5 Saving a W eb Page to the CF Card Since some applications will have web pages that take up a lot of memory space, you will need to be able to r un the homepage a nd other pages from the CF ca rd. In this sect ion, we use a si mple example to illustrate how to save web pages to the CF card, and[...]

  • Страница 57

    UC-7420/7410 User’s Manual Managing Communication 4-6 Step4: Open your browser and con nect to the UC-7420/7410 by typing the current LAN1 IP address in the browser’s addr ess box. NOTE Visit the Apache website at http://httpd.ap ache.org/docs/ for more information about setting up an Apache server. IPTABLES IPTABLES is an administrative tool f[...]

  • Страница 58

    UC-7420/7410 User’s Manual Managing Communication 4-7 MASQUERA DE — a special form for SNAT. If o ne hos t can connect to internet, th en other computers that c onnect to this host can connect to the Internet whe n it the computer does not have an actual IP address. REDIRECT — a special form of DNAT that re-se nds packet s to a local host ind[...]

  • Страница 59

    UC-7420/7410 User’s Manual Managing Communication 4-8 UC-7420/741 0 supports the f ollowing s ub-modules. Be sure to use t he module that m atches your application. ip_conntrack ipt_ MARK ipt_ah ipt_state ip_conntrack_ftp ip t_MASQUERADE ipt_esp ipt_tcpmss ipt_conntrack_irc ipt_ MIRROT ipt_length ipt_tos ip_nat_ftp ipt_ REDIRECT ipt_limit ipt_ttl[...]

  • Страница 60

    UC-7420/7410 User’s Manual Managing Communication 4-9 Examples: # iptables -L -n In this example, since we do not use the -t parameter, the system uses the default ‘filter’ table. Three chains are incl uded: INPUT, OUT PUT, and FORWARD. INPUT chains are acce pted automatically, and all connections ar e accepted without being filtered. #iptabl[...]

  • Страница 61

    UC-7420/7410 User’s Manual Managing Communication 4-10 Example 2: Ac cept TCP pack ets from 192. 168.0.1. # iptables –A INPUT –i ixp0 –p tcp –s 192.168.0.1 –j ACCEPT Example 3: Ac cept TCP pack ets from Cl ass C network 1 92.168.1.0/24. # iptables –A INPUT –i ixp0 –p tcp –s 192.168.1.0/24 –j ACCEPT Example 4: D rop TCP pac ket[...]

  • Страница 62

    UC-7420/7410 User’s Manual Managing Communication 4-11 1. #ehco 1 > /proc/sys/net/ipv4/ip_forward 2. # modprobe iptable_nat 3. # modprobe ip_conntract 4. # modprobe ipt_MASQUERADE 5. #iptables -t nat –A POSTROUTING –o ixp0 –j SNAT --to-source 192.168.3.127 or 6. #iptables –t nat –A POSTROUTING –o ixp0 –j MASQUERADE Enabling NA T [...]

  • Страница 63

    UC-7420/7410 User’s Manual Managing Communication 4-12 NOTE Click on the following links for more information about ppp: http://tldp.org /HOWTO/PPP-HOWTO/index.html http://axion.physics.ub c.ca/ppp-linux.html The pppd daem on is used to connect to a PPP se rver from a Linux syste m. For detai led informati on about pppd see t he man page. Example[...]

  • Страница 64

    UC-7420/7410 User’s Manual Managing Communication 4-13 crtscts Use hardware f low control between comput er and modem (at 115200 t his is a must ). modem Indicates that this is a modem device; pppd will hang up the phone before and after making the call. defaultroute Once the PPP link is established, make it the default route; if you have a PPP l[...]

  • Страница 65

    UC-7420/7410 User’s Manual Managing Communication 4-14 where z.z.z.z is the address of your name server. T his should work. Here ’s what the response could loo k like: waddington :~$p ping 129 .67.1.165 PING 129.67.1.165 (129.67 .1.165): 56 data bytes 64 bytes from 129.67.1.165: i cmp_seq=0 ttl=225 time=268 m s 64 bytes from 129.67.1.165: i cmp[...]

  • Страница 66

    UC-7420/7410 User’s Manual Managing Communication 4-15 PPPoE How to use PPPoE on UC-7 408: 1. Update two files: /usr/sbin/pppd and /usr/lib/pppd/2.4.1/pppoe.so on the target UC-7408 for version V1.5 or earlier ve rsions. Copy the files fr om the web or CD-ROM , and directly update it by the c opy command or FTP. 2. Connect UC-7 408’s LAN po rt [...]

  • Страница 67

    UC-7420/7410 User’s Manual Managing Communication 4-16 5. Edit the file /etc/ppp/pap-secrets and add t he followi ng: “username@hinet. net” * “passwor d” * “username@hinet.net” is t he username obtai ned from the ISP to log in to the ISP account. “password” is the corresponding password for the account. 6. Edit the file /etc/ppp/o[...]

  • Страница 68

    UC-7420/7410 User’s Manual Managing Communication 4-17 7. Add one of two fil es: /etc/ppp/options.ixp0 or /etc/ppp/options.ix p1 . The choice depends on which LAN is connected to t he ADSL modem . If you use LAN1 to connect to the ADSL modem , then add /etc/ppp/options.ixp0 . If you use LAN2 to connect to the ADSL m odem, then add /etc/ppp/option[...]

  • Страница 69

    UC-7420/7410 User’s Manual Managing Communication 4-18 NFS (Network File System) The Network File System (NFS) is used to mount a disk partition on a remote machine, as if it were on a local hard drive, allowing fast, seam less sharing of files across a network. NFS allows users to develop applications fo r UC-7420/7410, without worrying about th[...]

  • Страница 70

    UC-7420/7410 User’s Manual Managing Communication 4-19 async The async option instructs the server to lie to th e client, telling the client that all data has been written to the stable storag e. Example 1 /tmp *(rw,no_root_squash) In this example, UC -7420/7410 shares the /tmp directory to e veryone, gi ves everyone b oth read and write authorit[...]

  • Страница 71

    UC-7420/7410 User’s Manual Managing Communication 4-20 NOTE Click on the following link for more information about smtpclient: http://www.engelschall.co m/sw/smtpclient/ To send an email message, use the ‘smtpclient’ utility, which uses SMTP protocol. Type #smtpclient –help to see the help m essage. Example: smtpclient –s test –f sender[...]

  • Страница 72

    UC-7420/7410 User’s Manual Managing Communication 4-21 ***** SNMP QUERY FINISHED ***** NOTE Click on the following links for more information about MIB II and RS-2 32 like group: http://www.faqs.org/ rfcs/rfc121 3.html http://www.faqs.org/ rfcs/rfc131 7.html Æ UC-7420/7 410 does NOT support SNM P trap. The following tables list the variables sup[...]

  • Страница 73

    UC-7420/7410 User’s Manual Managing Communication 4-22 2. Generate a pre set shared key by typing the comma nd: # openvpn --genkey --secret secrouter.key Copy the file that is generated to the OpenVPN machine. 3. Generate a scri pt file nam ed openvpn-bridge on each OpenVPN m achine. This script reconfigures interface “ixp1” as IP-less, crea [...]

  • Страница 74

    UC-7420/7410 User’s Manual Managing Communication 4-23 IFS=$oIFS if [ “$FOUND” = “no” ]; then modprobe $mname fi } start() { ifcfg_vpn if [ ! ( -d “/dev/net” ) ]; then mkdir /dev/net fi if [ ! ( -r “/dev/net/tun” ) ]; then # create a device file if there is none mknod /dev/net/tun c 10 200 fi # load modules “tun” and “br[...]

  • Страница 75

    UC-7420/7410 User’s Manual Managing Communication 4-24 openvpn --rmtun --dev tap${i} i=`expr $i + 1` if [ $i -ge $maxtap ]; then break fi done brctl delif br0 $iface brctl delbr br0 ifconfig br0 down ifconfig $iface $IPADDR netmask $NETMASK broadcast $BROADCAST killall -TERM openvpn } case “$1” in start) start ;; stop) stop ;; restart) stop s[...]

  • Страница 76

    UC-7420/7410 User’s Manual Managing Communication 4-25 up /etc/openvpn/B-tap0-br.sh #---------------------------------- Start---------------------------- #!/bin/sh # value after “-net” is the subnet behind the remote peer route add -net 192.168.2.0 netmask 255.255.255.0 dev br0 #---------------------------------- end -------------------------[...]

  • Страница 77

    UC-7420/7410 User’s Manual Managing Communication 4-26 Setup 2: Ethernet Bridging for Pr ivate Networks on the Same Subnet 1. Set up four machines as sho wn in the following diagram: OpenVPN A OpenVPN B Host A eth0: 192.168.2.171 Host B eth0: 192.168.2.172 ixp0: 192.168.8.174 eth1: 192.168.2.173 local net local net Internet Internet ixp1: 192.168[...]

  • Страница 78

    UC-7420/7410 User’s Manual Managing Communication 4-27 2. Create a configuration file name d “A-tun.conf” and an execut able script file nam ed “A-tun.sh”. # point to the peer remote 192.168.8.174 dev tun secret /etc/openvpn/secrouter.key cipher DES-EDE3-CBC auth MD5 tun-mtu 1500 tun-mtu-extra 64 ping 40 ifconfig 192.168.2.173 192.168.4.1[...]

  • Страница 79

    5 5 Chapter 5 Programmer’s Guide This chapter includes importan t information for programmers. This following functions are covered in this chapter:  Flas h Memo ry Map  Linux Tool Chai n Introducti on  Debugging with GDB  Device API  RTC (Real Time Clock)  Buzzer  WDT (Watch Do g Timer)  UART  LCM  KeyPad  Make F[...]

  • Страница 80

    UC-7420/7410 User’s Manual Programmer’s Guide 5-2 Flash Memory Map Partition sizes are hard coded into th e kernel bina ry. To chang e the partition sizes, you will need to rebuild the kernel. The flash memory map is shown in the following table. Address Size Contents 0x00000000 – 0x0005FFFF 384 KB Boot Loa der—Read ONLY 0x00060000 – 0x00[...]

  • Страница 81

    UC-7420/7410 User’s Manual Programmer’s Guide 5-3 Obtaining help Use the Linux man utility to obtain help on many of the utilities provid ed by the tool chain. For example to get help on the armv5b-linux-gcc com piler, issue the command: #man armv5b-linux-gcc Cross Compiling Applications and Libraries To compile a simple C application , just us[...]

  • Страница 82

    UC-7420/7410 User’s Manual Programmer’s Guide 5-4 Debugging with GDB First compile the program must with option -ggdb. Use the following steps: 1. To debug a pro gram called hello-debug on the target, use t he command: #gdbserver 192.168.4.142:2000 hello-debug This is where 2000 is the network port number on which the serv er waits for a connec[...]

  • Страница 83

    UC-7420/7410 User’s Manual Programmer’s Guide 5-5 Buzzer The device node is located at /dev/console . UC-7 420/7410 suppor ts Linux standard buzzer con trol, with UC-7420 /7410’s bu zzer running at a fixed frequ ency of 100 H z. You must include <sys/kd.h> . 1. Function: KDMKTONE ioctl(fd, KDMKTONE, unsigned int arg); Description: The b[...]

  • Страница 84

    UC-7420/7410 User’s Manual Programmer’s Guide 5-6 int swtd_enable(int fd, unsigned long time) Description Enable application sWatchDog. And you must do ack after this process. Input int fd - the file handle, from the swtd_open() return value. unsigned long time - Th e time you wish to ack sWatchDog peri odically. Yo u must ack the sWatchDog bef[...]

  • Страница 85

    UC-7420/7410 User’s Manual Programmer’s Guide 5-7 int swtd_ack(int fd) Description: Acknowledge sWatchDog. When the user appli cation enable sWatchDog. It need to ca ll this function periodically with user predefined time in the application prog ram. Input : int fd - the file handle from swtd_open() return value. Output: OK will be zero. The ot[...]

  • Страница 86

    UC-7420/7410 User’s Manual Programmer’s Guide 5-8 swtd_close(fd); exit(0); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmoxalib Example 2: #include <stdio.h> #include <stdlib.h> #include <signal.h> #include <string.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/selec[...]

  • Страница 87

    UC-7420/7410 User’s Manual Programmer’s Guide 5-9 exit(1); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmoxalib UART The normal tty de vice node is located at /dev/ttyM0 … ttyM7 , and the m odem tty dev ice node is located at /dev/cum0 … cum7 . UC-7420/7410 suppor ts Linux standard termios contr ol. The Moxa UART De[...]

  • Страница 88

    UC-7420/7410 User’s Manual Programmer’s Guide 5-10 Example to get the baud rate #include <moxadevice.h> #include <termios.h> struct termios term; int fd, speed; fd = open(“/dev/ttyM0”, O_RDWR); tcgetattr(fd, &term); if ( (term.c_cflag & (CBAUD|CBAUDEX)) != B4000000 ) { // follow the standard termios baud rate define } el[...]

  • Страница 89

    UC-7420/7410 User’s Manual Programmer’s Guide 5-11 KeyPad The device node is /dev/keypad . The key value is defin ed in moxade vice.h. int ioctl(fd, IOCTL_KEYPAD_HAS_PRESS, int *flag); Checks how ma ny keys have been pressed. Ar gument 3 ret urns the num ber of pressed keys. 0 means no keys w ere pressed. int ioctl(fd, IOCTL_KEYPAD_GET_KEY, int[...]

  • Страница 90

    A A Appendix A System Commands Linux normal command utility collection File manager 1. cp c o p y f i l e 2. ls list file 3. ln make symbolic link file 4. mount mount and check file system 5. rm delete file 6. chmod change file owner & group & user 7. chown c h a n g e f i l e o w n e r 8. chgrp c h a n g e f i l e g r o u p 9. sync sync fi[...]

  • Страница 91

    UC-7420/7410 User’s Manual System Commands A-2 Process 1. kill kill process 2. ps display now running process Other 1. dmesg dump kernel log message 2. sty t o s e t s e r i a l p o r t 3. zcat dump .gz file context 4. mknod make device node 5. free display system memory usage 6. date p rint or set the system date and time 7. env run a program in[...]