User Manual EKI-1121L, EKI-1122L, EKI-1124L 1/2/4-port Programmable Serial Device Servers
Copyright The documentation and the software included with this product are copyrighted 2010 by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd. reserves the right to make improvements in 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.
Declaration of Conformity CE The EKI-1121L/1122L/1124L has passed the CE test for environmental specifications. Test conditions for passing included the equipment being operated within an industrial enclosure. In order to protect the product from being damaged by ESD (Electrostatic Discharge) and EMI leakage, we strongly recommend the use of CEcompliant industrial enclosure products.
Safety Instructions 1. 2. 3. Read these safety instructions carefully. Keep this User Manual for later reference. Disconnect this equipment from any AC outlet before cleaning. Use a damp cloth. Do not use liquid or spray detergents for cleaning. 4. For plug-in equipment, the power outlet socket must be located near the equipment and must be easily accessible. 5. Keep this equipment away from humidity. 6. Put this equipment on a reliable surface during installation.
Contents Chapter Chapter 1 Introduction..........................................1 1.1 1.2 1.3 1.4 Overview ................................................................................................... 2 Features .................................................................................................... 2 Specifications ............................................................................................ 2 Packing List...............................................................
3.2.5 Chapter 3.3 TFTP Service and Client............................................................. 26 Figure 3.9 TFTP Server in EKI-1121L/1122L/1124L ................. 26 Figure 3.10TFTP Client in EKI-1121L/1122L/1124L .................. 27 3.2.6 NFS Client .................................................................................. 28 Figure 3.11NFS Client in EKI-1121L/1122L/1124L .................... 28 3.2.7 NTP Client .........................................................................
Chapter 1 Introduction 1
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°C. 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.
EKI-1121L/1122L/1124L CD-ROM for BSP 3 EKI-1121L/1122L/1124L User Manual Introduction 1.4 Packing List Chapter 1 Data bits: 5, 6, 7, 8 Stop bits: 1, 1.
EKI-1121L/1122L/1124L User Manual 4
Chapter 2 Getting Started 2
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 RS232/422 /485 port connections. 2.1 Understanding the EKI-1121L/1122L/1124L Networks have become increasingly vital for industrial automation applications.
Chapter 2 2.3 Dimensions (Units: mm) EKI-1121L: Getting Started Figure 2.1 Front View of EKI-1121L Figure 2.
Figure 2.3 Back View of EKI-1121L Figure 2.
Chapter 2 EKI-1122L: Getting Started Figure 2.5 Front View of EKI-1122L Figure 2.
Figure 2.7 Back View of EKI-1122L Figure 2.
Chapter 2 EKI-1124L: Getting Started Figure 2.9 Front View of EKI-1124L Figure 2.
Figure 2.11 Back View of EKI-1124L Figure 2.
This section will explain how to find a proper location for your 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.4.1 Choosing the Location 2.4.1.1 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. You can install the EKI-1121L/1122L/ 1124L firmly via the components, please see the figure below. Figure 2.
2.4.1.2 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.
Chapter 2 Then, let the EKI-1121L/1122L/1124L down straight to slide over the rail smoothly. Getting Started Figure 2.15 Din-rail Step2 2.4.2 Connecting Power The EKI-1121L/1122L/1124L supports dual 12 to 48 VDC power inputs and a powerfail relay output. Below figure is the power terminal block pin assignments. Please refer it to connect to the proper power and polarity. Figure 2.
2.4.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.2: EKI-1121L/1122L/1124L Serial Port Pin Assignments Pin 1 2 3 4 5 6 7 8 9 RS-232 DCD RX TX DTR GND DSR RTS CTS RI RS-422 TX- - - TX+ GND - RX+ - RX- RS-485 Data- - - Data+ GND - - - - 2.4.
Chapter 3 Installation and Configuration 3
3.1 Connecting the Hardware Note! 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. Use the console cable inside the release package to connect the console port on EKI-1121L/1122L/1124L with serial port on your develop desktop. 3.
Before configure and use, user must release other1.tar.gz files to /var. because it includes all of configured files. 3.2.1 Configure RTC 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.
3.2.2 Configure IP After connect to the console and power on the device, you can use following command to enable Ethernet or you can modify the /etc/rc(/var/other1/init.custom) file to bring up Ethernet when booting up by default. 3.2.2.1 Using Static IP User can modify the /etc/rc(/var/other1/init.custom) file like below to make system boot up using static IP. /etc/rc(/var/other1/init.custom) will be executed when system boot up if the file exists. ifconfig eth0 10.0.0.1 broadcast 10.0.0.255 netmask 255.
dhcpcd eth0 & And user can obtain IP address with command line. For example: 21 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.4 Configure Ethernet Interface Using DHCP Chapter 3 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.
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 EKI1121L/1122L/1124L as well. Use command like this: Figure 3.
When boot up the EKI-1121L/1122L/1124L, the ftp service is already started by default. User can ftp to EKI-1121L/1122L/1124L by ftp client in another computer to get and put files. '172.21.73.77' is your EKI-1121L/1122L/1124L's IP address. 'Name' can be 'anonymous' or 'ftp' and 'Password' can be any or none. Note! You should use command "adduser ftp" to add a user "ftp" in advance! 23 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.
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. In 'put' command line, user must use full path of file of EKI-1121L/1122L/ 1124L and the file name must be same as that will be put.
'172.21.73.101' is another computer's IP address. 25 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.
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.101' is another computer's IP address. User can use "tftp -g -r" to send file to another computer and use "tftp -p -l" to get file from another computer. 27 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.10 TFTP Client in EKI-1121L/1122L/1124L Chapter 3 '172.21.73.77' 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.
3.2.6 NFS Client User can mount file system to EKI-1121L/1122L/1124L provided by another computer with NFS service. Use 'mount' command like this: Figure 3.11 NFS Client in EKI-1121L/1122L/1124L '172.21.73.101' is another computer's IP address. '/home/jinxin/test' is file system supported by another computer. User can mount it to EKI-1121L/1122L/1124L.
User can synchronize time on EKI-1121L/1122L/1124L by using ntp client. Use 'msntp' command like this: '172.21.73.74' is NTP server's IP address. 29 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.12 NTP Client in EKI-1121L/1122L/1124L Chapter 3 3.2.
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 Note! "/etc/snmp/snmpd.
31 EKI-1121L/1122L/1124L User Manual Installation and Configuration Figure 3.14 SNMP Message in Manage Computer And user can modify configurable file 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.15 MAIL Client in EKI-1121/1122/1124 '172.21.73.74' is smtp server's IP address. 'AdvantechNew' defined in /etc/ resolve.conf is locale host name.
The boa is a small web server .If you want the web server starting by default, user must add 'boa:unknown:/bin/boa -c /www &' to /etc/inittab. To use web server, user can use vi to modify /var/other1/www/boa.conf which is released from other1.tar.gz like this: Port 80 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.
Secondly, user must open and modify /var/other1/ppp-on-dialer. #!/bin/sh TELEPHONE=NUMBER HANGUP=ATH0 RESET_MODEM=ATZ 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.
"USERNAME" * "PASSWORD" * "USERNAME" * "PASSWORD" * Please replace 'USERNAME' with correct user name and 'PASSWORD' with correct password. Use the following command to launch the pppoe connection. />/var/other1/pppoe-on & After the connection is built, a new Ethernet interface ppp will attach to system. 3.
EKI-1121L/1122L/1124L User Manual 36
Chapter 4 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. 3.
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. Chapter 4 4.2.2 User Space via FTP Development Guide Figure 4.1 How to Get Applications via FTP 4.2.3 Root File-system we support jffs2 file system in current version. 4.3 Device APIs 4.3.1 Serial port APIs Each serial port has an associated device file. To access a serial port, you simply open the corresponding device file.
Then, use the following instructions to set the termios structure, followed by the tcsetattr function to set the new configuration. switch(gMode) { case MODE_RS232: PortTermios.c_iflag &= ~IRS422; PortTermios.c_iflag &= ~IRS485; break; case MODE_RS422: PortTermios.c_iflag |= IRS422; PortTermios.c_iflag &= ~IRS485; break; case MODE_RS485: PortTermios.c_iflag &= ~IRS422; PortTermios.
flag = 1; cmd = LEDMAN_CMD_OFF; /*your action*/ } if( ioctl(devfp, cmd, LEDMAN_HEARTBEAT) < 0 || ioctl(devfp, cmd, LEDMAN_RESET) < 0 ) 41 EKI-1121L/1122L/1124L User Manual Development Guide { /*your action*/ } For a complete example of serial port configuration, please see the provided lmtest.c example.
EKI-1121L/1122L/1124L User Manual 42
Chapter 5 Troubleshooting 5
5.1 Troubleshooting 1. After restart the EKI-1121L/1122L/1124L, You may encounter following or similar warnings: JFFS2 warning: (270) jffs2_do_read_inode_internal: Truncating ino #30 to 23732 bytes failed because it only had 12288 bytes to start with! In this case,you need "fis load" and "fis write"(but not fis create) the jffs2fs.img again under redboot. For examples: redboot>load -r -v -h 172.21.73.101 -b 0x100000 jffs2fs.
Appendix A A Restore the Platform Kernel
A.1 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 jffs2fs.img under the TFTP directory. 5. Assume your TFTP server's IP is 172.21.73.101. Use the following commands.
Appendix B B Erase JFFS2 File System
B.1 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 C Command Collection
C.1 File manager 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. mount: Mount a filesystem. You need this to access NFS and SMB filesystems. umount: Unmount a filesystem. ar: Extract or list files from an ar archive. basename:Strips directory path and suffixes from FILE. If specified, also removes any trailing SUFFIX. cp: Copy files. dd: Copy a file with formatting and conversions. df: Print the filesystem space used and space available.
38. boa: 39. dhcpcd: The DHCP client daemon, used to get an IP address from a DHCP server. 40. ftp: An ftp client 41. ftpd: 42. inetd: 43. mail: Client which allows mail to be sent to other hosts that support SMTP 44. msntp: Simple Network Time Protocol utility. 45. portmap: The portmapper service, needed for NFS under 2.4. 46. pppd: Dialup networking daemon. 47. pptpd: PPTP VPN daemon. 48. pptp: PPTP Client for establishing VPN's. 49. rp_pppoe: The Roaring Penguin PPPOE. 50.
C.5 Others 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. cpu: cpu tool setserial: User level serial port configuration tool. clear: Clear screen. date: Displays the current time or sets the system date. dmesg: Prints or controls the kernel ring buffer. hwclock: The hwclock utility is used to read and set the hardware clock on a system. This is primarily used to set the current time on shutdown in the hardware clock, so the hardware will keep the correct time when Linux is _not_ running.
Appendix C Command Collection 53 EKI-1121L/1122L/1124L User Manual
www.advantech.com.cn Please verify specifications before quoting. This guide is intended for reference purposes only. All product specifications are subject to change without notice. No part of this publication may be reproduced in any form or by any means, electronic, photocopying, recording or otherwise, without prior written permission of the publisher. All brand and product names are trademarks or registered trademarks of their respective companies. © Advantech Co., Ltd.