Table of Contents

Advertisement

Quick Links

EM-1220 LX User's Manual
Fourth Edition, January 2010
www.moxa.com/product
© 2010 Moxa Inc. All rights reserved.
Reproduction without permission is prohibited.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EM-1220 LX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Moxa Technologies EM-1220 LX

  • Page 1 EM-1220 LX User’s Manual Fourth Edition, January 2010 www.moxa.com/product © 2010 Moxa Inc. All rights reserved. Reproduction without permission is prohibited.
  • Page 2 EM-1220 LX 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 © 2010 Moxa Inc. All rights reserved. Reproduction without permission is prohibited.
  • Page 3: Table Of Contents

    Table of Contents Chapter 1 Introduction ....................1-1 Overview..........................1-2 Ordering Information ....................... 1-2 Product Specifications ......................1-3 Hardware Specifications....................1-3 Software Specifications ....................1-4 Hardware Block Diagram ......................1-5 Appearance ..........................1-6 Dimensions ..........................1-7 Installing the EM-1220-LX...................... 1-7 LED Indicators......................... 1-7 Wiring Requirements .......................
  • Page 4 Configuring Dial-in/Dial-out Service ..................4-8 Dial-out Service......................4-8 Dial-in Service......................4-8 Configuring PPPoE........................4-9 How to Mount a Remote NFS Server ..................4-9 Dynamic Driver Module Load/Unload ..................4-9 Upgrading the Kernel......................4-10 Upgrading the Root File System & User Directory ..............4-11 Loading Factory Defaults ......................
  • Page 5: Chapter 1 Introduction

    Introduction Chapter 1 The Moxa EM-1220-LX is a mini RISC-based ready-to-run embedded module that features dual 10/100 Mbps Ethernet ports and two RS-232/422/485 serial ports in a µClinux ARM9 module. In addition, the EM-1220-LX supports an external SD socket for installing an SD memory card for storage expansion, and offers high performance communication and unlimited storage in a super compact, palm-sized module.
  • Page 6: Overview

    EM-1220 LX User’s Manual Introduction Overview The EM-1220-LX is a mini RISC-based communication platform that is ideal for embedded applications. The EM-1220-LX supports 2 RS-232/422/485 serial ports and dual 10/100 Mbps Ethernet LAN ports to provide users with a versatile communication platform.
  • Page 7: Product Specifications

    EM-1220 LX User’s Manual Introduction Product Specifications Hardware Specifications Model EM-1220-LX Embedded Module MOXA ART ARM9 32-bit 192 MHz processor 16 MB 8 MB Flash Auto-sensing 10/100 Mbps × Built-in 1.5 KV magnetic isolation LAN Protection Two serial ports supporting RS-232/422/485 signals...
  • Page 8: Software Specifications

    EM-1220 LX User’s Manual Introduction -20 to 80°C (-4 to 176°F), 5 to 95% RH Storage temperature -40 to 85°C (-40 to 185°F) is optional for EM-1220-T model Two 2 × 17 pin-headers; pitch: 2.5 × 2.5 mm Module Interface Software Specifications µClinux Kernel 2.6.9...
  • Page 9: Hardware Block Diagram

    EM-1220 LX User’s Manual Introduction Hardware Block Diagram...
  • Page 10: Appearance

    EM-1220 LX User’s Manual Introduction Appearance EM-1220-LX Embedded Module + EM-1220-DK Carrier Board EM-1220-LX Embedded Module MOXA ART ARM9 32-bit Communication Processor onboard 16 MB RAM EM-1220-LX Development Kit...
  • Page 11: Dimensions

    EM-1220 LX User’s Manual Introduction Dimensions EM-1220-LX Embedded Module 80cm 50cm EM-1220-DK Carrier Board Installing the EM-1220-LX To use the EM-1220-LX Development Kit, insert the EM-1220-LX embedded module vertically onto the development kit. Note that the pin marked “J2” on the embedded module must be matched with the pin marked “J2”...
  • Page 12: Wiring Requirements

    EM-1220 LX User’s Manual Introduction Wiring Requirements This section describes how to connect the EM-1220-LX to serial devices. Be sure to heed the following common safety precautions before proceeding with the installation of any electronic device: Use separate 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.
  • Page 13: Connecting Data Transmission Cables

    EM-1220 LX User’s Manual Introduction ATTENTION This product should be mounted to a well-grounded mounting surface such as a metal panel. 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.
  • Page 14: Connecting To A Serial Device

    EM-1220 LX User’s Manual Introduction Connecting to a Serial Device Connect the serial cable between the EM-1220-DK and the serial device(s). Serial ports P1 and P2 on EM-1220-DK use male DB9 connectors, and can be configured for RS-232, RS-422, or RS-485 by software. The pin assignments are shown in the following table:...
  • Page 15: Additional Functions

    EM-1220 LX User’s Manual Introduction Additional Functions Reset Button Press the Reset button on the EM-1220-DK continuously for at least 5 seconds to load the factory default configuration. After the factory default configuration has been loaded, the system will reboot automatically. We recommend that you only use this function if the software is not working properly and you want to load factory default settings.
  • Page 16: Chapter 2 Getting Started

    Getting Started Chapter 2 In this chapter, we explain the basic procedure for getting the EM-1220-LX connected and ready for use. In this chapter we cover the following topics: Powering on the EM-1220-DK Connecting the EM-1220-LX to a PC Console Port Telnet Configuring the Ethernet Interface Installing a Secure Digital (SD) Memory Card...
  • Page 17: Powering On The Em-1220-Dk

    EM-1220 LX User’s Manual Getting Started Powering on the EM-1220-DK Connect the SG wire to the Shielded Contact located on the upper left corner of the EM-1220-DK, and then power on the EM-1220-DK by connecting the power adaptor. It takes about 16 seconds for the system to boot up.
  • Page 18: Telnet

    EM-1220 LX User’s Manual Getting Started Telnet If you know at least one of the Default IP Address Default Netmask two IP addresses and netmasks, then you can use Telnet to LAN 1 192.168.3.127 255.255.255.0 connect to the EM-1220-LX’s LAN 2 192.168.4.127...
  • Page 19: Configuring The Ethernet Interface

    EM-1220 LX User’s Manual Getting Started Configuring the Ethernet Interface In this section, we use the serial console to explain how to modify the EM-1220-LX’s network settings. 1. Change directories by issuing the command cd /etc. Type the command vi rc to use VI Editor to edit the configuration file. The IP addresses for the EM-1220-LX’s LAN1 and LAN2 are:...
  • Page 20 EM-1220 LX User’s Manual Getting Started 2. You may also configure the EM-1220-LX to request IP addresses from a DHCP server. In this case, use the sharp sign (#) to comment out one or both “ifconfig” lines, and then add the setting about the “dhcpcd”...
  • Page 21: Installing A Secure Digital (Sd) Memory Card

    EM-1220 LX User’s Manual Getting Started Installing a Secure Digital (SD) Memory Card The EM-1220 Development Kit has an internal SD socket for storage expansion. To access this socket, perform the following steps to install the SD memory card. Step 1: Locate the SD socket.
  • Page 22: Developing Your Applications

    EM-1220 LX User’s Manual Getting Started Developing Your Applications Step 1: Connect the EM-1220-DK to a Linux PC. Step 2: Install Tool Chain (GNU Cross Compiler & uClibc). Step 3: Configure cross compiler and uClibc environment variables. Step 4: Code & compile your program.
  • Page 23: Compiling Hello.c

    EM-1220 LX User’s Manual Getting Started Compiling Hello.c The Tool Chain path is: PATH=/usr/local/bin:$PATH The EM-1220-LX 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:...
  • Page 24: Uploading "Hello" To The Em-1220-Lx

    EM-1220 LX User’s Manual Getting Started Uploading “Hello” to the EM-1220-LX To use FTP to upload hello to the EM-1220-LX, issue the following commands from the PC: #ftp 192.168.3.127 ftp> cd /home ftp> bin ftp> put ./hello ftp> quit #telnet 192.168.3.127...
  • Page 25: Running "Hello" On The Em-1220-Lx

    EM-1220 LX User’s Manual Getting Started Running “Hello” on the EM-1220-LX To run the Hello program, issue the following commands on the EM-1220-LX: # chmod 755 hello #./hello The words “hello world” are printed on the screen. ATTENTION Be sure to calculate the amount of Flash Memory used by the User File System in the Flash ROM.
  • Page 26: Make File Sample Code

    EM-1220 LX User’s Manual Getting Started Make File Sample Code The following Make File example code was copied from the Hello example on the EM-1220-LX’s CD-ROM. srcdir = . LDFLAGS = -Wl,-elf2flt LIBS = CFLAGS = # Change these if necessary...
  • Page 27: Chapter 3 Software Package

    Software Package Chapter 3 This chapter includes information about the software used with the EM-1220-LX. In this chapter, we cover the following topics: EM-1220-LX Software Architecture Journaling Flash File System (JFFS2) EM-1220-LX Software Package...
  • Page 28: Em-1220-Lx Software Architecture

    EM-1220 LX User’s Manual Software Package EM-1220-LX Software Architecture The pre-installed µClinux operating system used by the EM-1220-LX follows the standard µClinux architecture. This means that programs following the POSIX standard are easily ported to the EM-1220-LX with the GNU Tool Chain provided by www.uClinux.org. In addition to the Standard POSIX API, device drivers for the buzzer and UART for the serial ports are also included.
  • Page 29: Journaling Flash File System (Jffs2)

    EM-1220 LX User’s Manual Software Package The partition sizes are hard coded into the kernel binary. You must rebuild the kernel to change the partition sizes. The flash memory map is shown in the following table. Flash Context Flash Address...
  • Page 30: Em-1220-Lx Software Package

    EM-1220 LX User’s Manual Software Package EM-1220-LX Software Package upkernel mtdblock1 passwd -> tinylogin mtdr1 login -> tinylogin mtd1 tinylogin mtdblock0 telnetd mtdr0 snmpd mtd0 mail cum1 cum0 routed ttyM1 netstat ttyM0 urandom chat random pppd zero portmap ttypf ntpdate...
  • Page 31 EM-1220 LX User’s Manual Software Package ptyp0 ram1 ram0 null kmem cua0 console...
  • Page 32: Configuring The Em-1220-Lx

    Configuring the EM-1220-LX Chapter 4 In this chapter, we describe how to configure the EM-1220-LX Series products. The following topics are covered in this chapter: Enabling and Disabling Daemons Adding a Web Page IPTABLES NAT Example Enabling NAT at Bootup Configuring Dial-in/Dial-out Service Dial-out Service Dial-in Service...
  • Page 33: Enabling And Disabling Daemons

    EM-1220 LX User’s Manual Configuring the EM-1220-LX Enabling and Disabling Daemons The following daemons are enabled when the EM-1220-LX boots up for the first time. SNMP Agent daemon: snmpd Telnet Server / Client daemon: telnetd Internet Daemons: inetd FTP Server / Client daemon:...
  • Page 34: Adding A Web Page

    EM-1220 LX User’s Manual Configuring the EM-1220-LX Adding a Web Page Default Home Page address: /home/httpd/index.html You may change the default home page directory by editing the web server’s configuration file, located at: /etc/boa.conf Type the following command to edit the boa.conf file: /etc>vi boa.conf...
  • Page 35 EM-1220 LX User’s Manual Configuring the EM-1220-LX 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.
  • Page 36 EM-1220 LX User’s Manual Configuring the EM-1220-LX The EM-1240-LX supports the following sub-modules. Be sure to use the module that matches your application. You must load a module before you can use it. Use the insmod command to load a module.
  • Page 37 EM-1220 LX User’s Manual Configuring the EM-1220-LX 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.
  • Page 38: Nat

    EM-1220 LX User’s Manual Configuring the EM-1220-LX 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.
  • Page 39: Enabling Nat At Bootup

    EM-1220 LX User’s Manual Configuring the EM-1220-LX Enabling NAT at Bootup In most real world situations, you should use a simple shell script to enable NAT when the EM-1220-LX boots up, as indicated by the following: 1. setting iptables 2. iptables-save > /home/xxx.file (xxx.file is the user defined file name) 3.
  • Page 40: Configuring Pppoe

    EM-1220 LX User’s Manual Configuring the EM-1220-LX Configuring PPPoE PPPoE relies on two widely accepted standards: PPP and Ethernet, which permits 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 a single DSL line, wireless device or cable modem, used by many ADSL service providers.
  • Page 41: Upgrading The Kernel

    EM-1220 LX User’s Manual Configuring the EM-1220-LX For example, to unload the UART driver, type the following command: />rmmod mxser For the EM-1240-LX, the factory default is to load the UART driver mxser.ko. An additional driver module for controlling the SD/MMC memory card is loaded for the EM-1240-LX. The location and file name for these driver modules is given below.
  • Page 42: Upgrading The Root File System & User Directory

    EM-1220 LX User’s Manual Configuring the EM-1220-LX Upgrading the Root File System & User Directory The EM-1220-LX uses JFFS2 for the root file system and user directory. By default, the root file system is pre-set to READ only. The EM-1220-LX provides a read/write user’s directory in the JFFS2 file system.
  • Page 43: Loading Factory Defaults

    EM-1220 LX User’s Manual Configuring the EM-1220-LX 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 System & User Directory,” for an introduction.
  • Page 44: Em-1220-Lx Device Api

    EM-1220-LX Device API Chapter 5 In this chapter, we discuss the Device API for the EM-1220-LX Series. We introduce the APIs for the following functions: RTC (Real-time Clock) Buzzer UART Interface GPIO...
  • Page 45: Rtc (Real-Time Clock)

    EM-1220 LX User’s Manual EM-1220-LX Device API RTC (Real-time Clock) The device node is located at /dev/rtc. The EM-1220-LX supports µClinux standard simple RTC control. You must include <linux/rtc.h> to use these functions. 1. Function: RTC_RD_TIME int ioctl(fd, RTC_RD_TIME, struct rtc_time *time);...
  • Page 46: Gpio

    EM-1220 LX User’s Manual EM-1220-LX Device API GPIO GPIO means General Purpose I/O. It is a user-programmable design that both digital input and digital output can be easily defined as the signals are all made with TTL format. Moxa GPIO API For customers using EM-1220 or EM-1240, we will provide an API library with static link.
  • Page 47 EM-1220 LX User’s Manual EM-1220-LX Device API int set_gpio_mode(unsigned int pio, int mode) --to configure GPIO ports to be DI ports or DO ports. Input: unsigned int pio - GPIO port number Each GPIO point will be regarded as a port. We support from Port 0 to Port 9 for EM-1240, and from Port 0 to Port 7 for EM-1220.
  • Page 48 EM-1220 LX User’s Manual EM-1220-LX Device API Limits 1. Both SD card and GPIO share the same signals. To enable GPIO, SD must be disabled, and vice versa. Drivers will not automatically check if it is SD or GPIO signals, users must decide before using these signals.
  • Page 49 EM-1220 LX User’s Manual EM-1220-LX Device API typedef struct gpio_set_struct { io_number; mode_data; } gpio_t; * To get the GPIO mode now. * Input: unsigned int pio - the GPIO number, from 0 to MAX_GPIO-1 * Output: < 0 - some error...
  • Page 50 EM-1220 LX User’s Manual EM-1220-LX Device API return GPIO_NODE_ERROR; pset.io_number = gpio_no; pset.mode_data = mode; if ( ioctl(fd, IOCTL_GPIO_SET_MODE, &pset) != 0 ) { close(fd); return GPIO_ERROR; close(fd); return GPIO_OK; * To set the GPIO now data. * Input: unsigned int pio - the GPIO number, from 0 to MAX_GPIO-1...
  • Page 51: Appendix A System Commands

    System Commands Appendix A µClinux normal command utility collection File manager copy file list file make symbolic link file mount and check file system mount delete file change file owner & group & user chmod change file owner chown change file group chgrp sync file system;...
  • Page 52 EM-1220 LX User’s Manual System Commands Network ping to test network ping routing table manager route display network status netstat set network IP address ifconfig tftp protocol tftp user interface to TELNET protocol telnet file transfer protocol iptables command iptables...
  • Page 53 SNMP Agent with MIB II & RS-232 Like Appendix B Group The EM-1220-LX 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 EM-1220-LX. The full SNMP object ID of EM-1220-LX is .iso.3.6.1.4.1.8691.12.1220.
  • Page 54: Appendix B Snmp Agent With Mib Ii & Rs-232 Like Group

    EM-1220 LX User’s Manual SNMP Agent with MIB II & RS-232 Like Group ip MIB tcp MIB udp MIB ipForwarding tcpRtoAlgorithm udpInDatagrams ipDefaultTTL tcpRtoMin udpNoPorts ipInReceives tcpRtoMax udpInErrors ipInHdrErrors tcpMaxConn udpOutDatagrams ipInAddrErrors tcpActiveOpens udpTable ipForwDatagrams tcpPassiveOpens udpLocalAddress ipInUnknownProtos tcpAttemptFails udpLocalPort...
  • Page 55 EM-1220 LX User’s Manual SNMP Agent with MIB II & RS-232 Like Group snmp MIB snmpInPkts snmpOutPkts snmpInBadVersions snmpInBadCommunityNames snmpInBadCommunityUses snmpInASNParseErrs snmpInTooBigs snmpInNoSuchNames snmpInBadValues snmpInReadOnlys snmpInGenErrs snmpInTotalReqVars snmpInTotalSetVars snmpInGetRequests snmpInGetNexts snmpInSetRequests snmpInGetResponses snmpInTraps snmpOutTooBigs snmpOutNoSuchNames snmpOutBadValues snmpOutGenErrs snmpOutGetRequests snmpOutGetNexts snmpOutSetRequests...
  • Page 56: Appendix C Em-1220-Lx Faq

    EM-1220-LX FAQ Appendix C Why can I only use vfork( ),and am not able to use fork( )? FAQ 1 μClinux only supports vfork( ). It does not support fork( ). Note that when using Answer 1 vfork ( ), the parent process will hang until the child process calls an exec group API, or exits.

Table of Contents