EKI-1121L, EKI-1122L, EKI-1124L 1/2/4 Serial Port, Dual Ethernet, Linux-based Embedded Platform User’s Manual Version 1.
Copyright Notice This document is copyrighted, 2009, by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd., reserves the right to make improvements to the products described in this manual at any time without notice. No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reliable. However, Advantech Co., Ltd.
Advantech Customer Services Each and every Advantech product is built to the most exacting specifications to ensure reliable performance in the unusual and demanding conditions typical of industrial environments. Whether your new Advantech equipment is destined for the laboratory or the factory floor, you can be assured that your product will provide the reliability and ease of operation for which the name Advantech has come to be known. Your satisfaction is our number one concern.
Product Warranty Advantech warrants to you, the original purchaser, that each of its products will be free from defects in materials and workmanship for two years from the date of purchase. This warranty does not apply to any products which have been repaired or altered by other than repair personnel authorized by Advantech, or which have been subject to misuse, abuse, accident or improper installation. Advantech assumes no liability as a consequence of such events under the terms of this Warranty.
descriptions such as “does not work” and “failure” are so general that we are then required to apply our internal standard repair process. 4. Carefully pack the defective product, a completely filled-out Repair and Replacement Order Card and a photocopy of dated proof of purchase (such as your sales receipt) in a shippable container. A product returned without dated proof of purchase is not eligible for warranty service. 5.
Contents Chapter 1: Introduction .................................................................................... 1 1.1 Overview ............................................................................................. 1 1.2 Features.............................................................................................. 1 1.3 Specifications ...................................................................................... 1 1.4 Packing List .................................................
4.2.1 Check the Flash Memory Space ............................................. 30 4.2.2 User Space via FTP ................................................................ 32 4.2.3 Root File-system ..................................................................... 32 4.3 How to Compile and Run Application ................................................ 32 4.3.1 Hello World .............................................. 錯誤! 尚未定義書籤。 Chapter 5: Troubleshooting ............................................
Chapter 1: Introduction 1.1 Overview The EKI-1121L/1122L/1124L is a Linux-based RISC-grade embedded platform that offers 2 LAN and 1/2/4 serial ports. EKI-1121L/1122L/1124L could operate well under 0~60℃. Its compact size and light weight could fit in industrial robust environment. With these advantages, EKI-1121L/1122L/1124L is suitable for communication gateway for converting communication protocol.
TFTP, TELNET, PAP, CHAP, DHCP, PPP, PPPoE, NFS, SMTP Interfaces: Network: 2 10/100 BASE-T Ethernet ports Serial: 1/2 independent RS-232/422/485 serial ports Serial ports: EKI-1121L: 1 independent RS-232/422/485 serial port EKI-1122L: 2 independent RS-232/422/485 serial ports EKI-1124L: 4 independent RS-232/422/485 serial ports Connectors: Network: RJ-45 Serial: DB9 Transmission speed: 50 bps to 921 Kbps Parity bit: Odd, Even, None, Space, Mark Data bits: 5, 6, 7, 8
1.
Chapter 2: Getting Started In this chapter, you will be given an overview of the EKI-1121L/1122L/1124L hardware installation procedures. As mentioned in the previous chapter, the EKI-1221L/1222L/1224L comes ready with all network connections, including Ethernet and RS-232/422 /485 port connections. 2.1 Understanding the EKI-1121L/1122L/1124L 2.2 Hardware The following instructions will give the overview of EKI-1121L/1122L/1124L hardware and its installation. 2.2.
Green Serial port is receiving data. Off No data is transmitted or received through the serial port. 2.2.2 Dimensions (Units: mm) EKI-1121L: Figure 2.
Figure 2.4 Side View of EKI-1121L Figure 2.5 Back View of EKI-1121L Figure 2.
Figure 2.7 Front View of EKI-1122L Figure 2.
Figure 2.9 Back View of EKI-1122L Figure 2.
Figure 2.11 Front View of EKI-1124L Figure 2.
Figure 2.13 Back View of EKI-1124L Figure 2.14 Top View of EKI-1224L 2.
EKI-1121L/1122L/1124L and how to connect to the network, hock up the power cable and connect to the EKI-1121L/1122L/1124L. 2.3.1 Choosing the Location Due to its versatility and innovative design, the EKI-1122L/1122L/1124L can be: Fixed to a panel mount Fixed to a DIN-rail Panel/Wall Mounting The EKI-1121L/1122L/1124L can be attached to a wall using the included metal brackets. Each bracket comes with four screws.
Figure 2.15 Combine the Metal Mounting Kit DIN-rail Mounting The EKI-1121L/1122L/1124L can be mounted on a standard DIN-rail. The DIN-rail kit is screwed on the Modbus data gateway when out of factory. If the DIN-rail kit is not screwed on the EKI-1121L/1122L/1124L, please screw the DIN-rail kit on the Modbus data gateway first. First, hang the EKI-1121L/1122L/1124L to the DIN-rail with angle of inclination. Please see the figure below.
Figure 2.16 Din-rail Step1 Then, let the EKI-1121L/1122L/1124L down straight to slide over the rail smoothly.
Figure 2.17 Din-rail Step2 2.3.2 Connecting Power The EKI-1121L/1122L/1124L supports dual 12 to 48 VDC power inputs and a power-fail relay output. Below figure is the power terminal block pin assignments. Please refer it to connect to the proper power and polarity. Figure 2.
through the power-fail relay output. The relay opens if power input V1 or V2 fails. (“Open” means if you connect relay output with an LED, the light will be turned off) 2.3.3 Connecting Serial Device The EKI-1121L/1122L/1124L provides one, two or four standard serial ports DB9 (male) connectors. RS-232/422/485 pin assignments are as below. Table 2.
Chapter 3: Installation and Configuration 3.1 Connecting the Hardware Use 115200 bps, N81 to connect console. The EKI-1121L/1122L/1124L offers an easy setup feature. Take out the EKI-1121L/1122L/1124L and the accessories from the package and follow the steps below for initial setup: 1. Connect the EKI-1121L/1122L/1124L LAN1 to your network with standard RJ-45 connector. 2.
Figure 3.1 The boot up messages 6. When you see the prompt, the system is ready. Note: 1. Use direct cable rather than cross-over cable; otherwise there is no message shown to you! 2. If you power on before open minicom, you can not see the boot up messages like that. But the boot up process may be successful. 3.2 OS Configuration and Usage Before configure and use, user must release other1.tar.gz files to /var. because it includes all of configured files. 3.2.
Figure 3.2 Configure RTC In order to maintain the correct time when power off, user should use the „hwclock -w‟ to write the current system time to real time clock and use the „hwclock -s‟ to read the real time clock into system. Now if you reboot the EKI-1121L/1122L/1124L, the time is still correct. Because command „hwclock -s‟ in /etc/rc(/var/other1/init.custom) executes by default. 3.2.
Figure 3.3 Configure Ethernet Interface Using Static IP 3.2.2.2 Using DHCP User can modify the /etc/rc(/var/other1/init.custom) file like below to make system boot up using DHCP. dhcpcd eth0 & And user can obtain IP address with command line. For example: Figure 3.
3.2.3 TELNET Service and Client When boot up the EKI-1121L/1122L/1124L, the telnet service is already started by default. User can telnet to EKI-1121L/1122L/1124L by telnet client in another computer. After you telnet into the EKI-1121L/1122L/1124L, all the other operations is the same as using console. And you can telnet to other computer by telnet client in EKI-1121L/1122L/1124L as well. Use command like this: Figure 3.5 TELNET Service and Client 3.2.
Figure 3.6 FTP Client in Another Computer „172.21.73.100‟ is your EKI-1121L/1122L/1124L‟s IP address. „Name‟ can be „anonymous‟ or „ftp‟ and „Password‟ can be any or none. Use command to get and put file like this: Figure 3.7 FTP Command in Another Computer Please look at „get‟ and „put‟ command line. In „get‟ command line, user must use full path of file that will be transmitted from EKI-1121L/1122L/1124L to a local file with the same name.
If user wants to connect other computers by ftp client in EKI-1121L/1122L/1124L, use command to put and get file like this: Figure 3.8 FTP Client in EKI-1121/1122/1124 „172.21.73.74‟ is another computer‟s IP address. 3.2.5 TFTP Service and Client When boot up the EKI-1121L/1122L/1124L, the tftp service is already started by default. User can tftp to EKI-1121L/1122L/1124L by tftp client in another computer. Use command to get and put file like this: Figure 3.
„172.21.73.100‟ is your EKI-1121L/1122L/1124L‟s IP address. In „get‟ command line, user must use full path of file that will be received from EKI-1121L/1122L/1124L. In „put‟ command line, user must use full path of file of EKI-1121L/1122L/1124L and file name must be the same as that will be put. If user wants to connect another computer by tftp client in EKI-1121L/1122L/1124L, use command to get and put file like this: Figure 3.10 TFTP in EKI-1121L/1122L/1124L „172.21.73.
Figure 3.11 NFS Client in EKI-1121L/1122L/1124L „172.21.73.74‟ is another computer‟s IP address. „/mnt/aaa‟ is file system supported by another computer. User can mount it to EKI-1121L/1122L/1124L. 3.2.7 NTP Client User can synchronize time on EKI-1121L/1122L/1124L by using ntp client. Use „msntp‟ command like this: Figure 3.12 NTP Client in EKI-1121L/1122L/1124L „172.21.73.74‟ is NTP server‟s IP address.
3.2.8 SNMP Service The EKI-1121L/1122L/1124L has built-in SNMP (Simple Network Management Protocol) v1 and v2c agent software. When boot up the EKI-1121L/1122L/1124L, the snmp client is not started by default, user must start snmp serveice like this: Figure 3.13 SNMP Client in EKI-1121L/1122L/1124L Then user can manage EKI-1121L/1122L/1124L by snmp service in another computer, use „snmpwalk‟ command like this: Figure 3.
And user can modify /var/other1/snmpd.conf which is linked to /etc/snmpd.conf to change configuration. 3.2.9 Mail Client EKI-1121L/1122L/1124L use smtpclient to send mail which is a minimal SMTP client that takes an email message body and passes it on to an SMTP server. When boot up the EKI-1121L/1122L/1124L, the smtp client is already started by default. User can send mail via smtp server. Use „mail‟ command to send mail like this: Figure 3.13 MAIL Client in EKI-1121/1122/1124 „172.21.73.
UserDir public_html DirectoryIndex index.htm KeepAliveMax 1000 KeepAliveTimeout 10 DefaultType text/html AddType application/x-httpd-cgi cgi ScriptAlias /cgi-bin/ /www/cgi-bin/ AddType image/jpeg jpg Because the default homepage is already located at /var/other1/www/index.htm released from other1.tar.gz, user can open default page. Type “http://‟IP_address‟” („IP_address‟ is web server‟s LAN IP address which is still active.
INIT_MODEM=ATL1M1V1S11=55S7=75 DIAL=ATDT$TELEPHONE chat ABORT 'ERROR' ABORT 'BUSY' ABORT 'NO ANSWER' ABORT 'RING\r\n\r\nRING' '' AT 'OK-+++\c-OK' $HANGUP OK $RESET_MODEM OK $INIT_MODEM TIMEOUT 30 OK $DIAL CONNECT '' Please replace „NUMBER‟ with the telephone number. Use the following command to launch the ppp connection. />/var/other1/ppp-on & After the connection is built, a new Ethernet interface ppp will attach to system. 3.2.
PPPOE_EXTRA="" Please replace „USERNAME‟ with correct user name and „eth0‟ with correct interface of Ethernet. Fourthly, user must open and modify /var/other1/www/chap–secrets. "USERNAME" * "PASSWORD" * Please replace „USERNAME‟ with correct user name and „PASSWORD‟ with correct password. At last, user must open and modify \var\other1\www\pap-secrets. "USERNAME" * "PASSWORD" * Please replace „USERNAME‟ with correct user name and „PASSWORD‟ with correct password.
Chapter 4: Development Guide 4.1 Establish Develop Environment 4.1.1 Install the Cross Compile Tool Chain Install Linux distribution on your host computer. Use root account to login system. Put arm-uclinux-tool-20080121-advantech.tar.bz2 under “\” path. You can find the file at release\toolchain\linux\. Use “tar jxvf arm-uclinux-tool-20080121-advantech.tar.bz2” to uncompress the tool chain. The tool chain has been installed into your system. 4.1.2 Setup the Runtime Environment 1.
2. Change to your working directory and issue the command “make” to build the application. When successfully built, you should see the following. Then copy hello to /home/aaa . Figure 4.1 How to make hello 3. To test the application, place the file “hello” on an ftp server. Next, connect to the EKI-112x via console or telnet, and change to the “/var/other1“ directory. Use the following commands to ftp the file “hello” from the ftp server. 4. Change the file permissions as follows. 5.
4.2.2 User Space via FTP Sometimes, user wants to execute applications in file system of EKI-1121L/1122L/1124L. Please use the following commands to get and execute the files. Figure 4.2 How to Get Applications via FTP 4.2.3 Root File-system 1. Uncompress romfs.tar.bz2 to a temporary folder. tar jxvf romfs.tar.bz2 2. Put your applications to relative directory or modify the configuration files as you want. 3. Use following command to generate a new root file system. genromfs -v -V “ROMdisk” -f romfs.
Peripheral Device File Serial Port 1 /dev/ttyS2 Serial Port 2 /dev/ttyS3 Serial Port 3 /dev/ttyS4 Serial Port 4 /dev/ttyS5 Port configuration is done using the POSIX termios interface. Developing in C, you will first need to include the header file to use the required functions. Additionally, the serial port line drivers are software configurable for RS-232, RS-422 or RS-485 operation, through the termios interface. You will need to include the adv.
4.3.2 RTC APIs To access a RTC device, you simply open the corresponding device file. Peripheral Device File Real Time Clock /dev/rtc 4.3.3 LED APIs To access a LED device, you simply open the corresponding device file. Peripheral Device File LED Indicator /dev/led Developing in C, you will first need to include the and "ledman.h" header file to use the required functions.
Chapter 5: Troubleshooting 35
Appendix A: Restore the Platform Kernel Just in case if the kernel or flash is corrupted, follow the below steps to recover the kernel and root file system. 1. Connect the EKI-1121L/1122L/1124L with console. 2. Press Ctrl + C when power on the EKI-1121L/1122L/1124L. 3. You should see the following messages. 4. Start your TFTP server and put the kernel.lzo and romfs.img under the TFTP directory. 5. Assume your TFTP server‟s IP is 172.21.73.65. Use the following commands. Figure A.
Appendix B: Erase JFFS2 File System 1. Sometimes, you may encounter the issue during development. You may see the output message like below. mtdblock_open ok jffs2_scan_empty(): Empty block at 0x003142e4 ends at 0x00316000 (with 0x00000000)! Marking dirty JFFS2: Erase block at 0x00310000 is not formatted.
Appendix C: Command Collection File manager 1.mount: Mount a filesystem. You need this to access NFS and SMB filesystems. 2.umount: Unmount a filesystem. 3.ar: Extract or list files from an ar archive. 4.basename: Strips directory path and suffixes from FILE. If specified, also removes any trailing SUFFIX. 5.cp: Copy files. 6.dd: Copy a file with formatting and conversions. 7.df: Print the filesystem space used and space available. 8.dirname: Strips non-directory suffix from arguments. 9.
Support for the EGREP applet (alias to the grep applet). Alias egrep to grep -e : Support for the EGREP applet (alias to the grep applet) 28.more: More is a filter for viewing a file one screenful at a time. 29.sed: Stream editor. 30.sort: 31.tail: Sorts lines of text in the specified files. Print last 10 lines of each file to standard output. With more than one file, precede each with a header giving the file name. With no file, or when file is -, read standard input. 32.
56.iproute: Equivalent to selecting route support to "ip", above. 57.netstat: netstat prints information about the Linux networking subsystem. 58.nslookup: Queries the nameserver for the IP address of the given host. 59.ping: Send ICMP ECHO_REQUEST packets to network hosts. 60.route: Edit the kernel's routing tables. 61.tftp: Transfers a file from/to a tftp server using "octet" mode. put: Support the TFTP PUT command. get: Support the TFTP GET command. 62.