Page 2 - Copyright Notice; Trademarks; Disclaimer
EM-1240-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 © 2006 Moxa Systems Co., Ltd. All rights reserved. Reproduction without permission is prohibited. Trad...
Page 3 - Table of Contents; Chapter 1
Table of Contents Chapter 1 Introduction ..................................................................................................1-1 Overview.................................................................................................................................. 1-2 Package Checkl...
Page 5 - Introduction
1 1 Chapter 1 Introduction The Moxa EM-1240-LX Series of Mini RISC-based Ready-to-Run Embedded Computer features dual 10/100 Mbps Ethernet ports and four RS-232/422/485 serial ports in a built-in µClinux ARM9 module. In addition, EM-1240-LX provides SD memory card for storage expansion, offers high ...
Page 6 - Overview
EM-1240-LX User’s Manual Introduction 1-2 Overview The EM-1240-LX Series of mini RISC-based communication platforms are ideal for your embedded applications. The EM-1240-LX comes with 4 RS-232/422/485 serial ports and dual 10/100 Mbps Ethernet LAN ports to provide users with a versatile communicatio...
Page 7 - Product Specifications; Hardware Specifications
EM-1240-LX User’s Manual Introduction 1-3 Product Specifications Hardware Specifications Model EM-1240 Embedded Module CPU MOXA ART ARM9 32-bit 192 MHz processor RAM 16 MB Flash 8 MB LAN Auto-sensing 10/100 Mbps x 2 LAN Protection Built-in 1.5 KV magnetic isolation Four serial ports supporting RS-23...
Page 8 - Software Specifications
EM-1240-LX User’s Manual Introduction 1-4 Software Specifications Kernel µClinux Kernel 2.6.9 Supports 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 Ke...
Page 9 - Hardware Block Diagram; EM-1240 Embedded Module + Development Kit
EM-1240-LX User’s Manual Introduction 1-5 Hardware Block Diagram Appearance EM-1240 Embedded Module + Development Kit EM-1240 Embedded Module EM-1240 Development Kit
Page 11 - Dimensions
EM-1240-LX User’s Manual Introduction 1-7 Dimensions EM-1240 Embedded Module . EM-1240 Development Kit
Page 12 - LED Indicators; LED Name; Wiring Requirements; NOTE
EM-1240-LX User’s Manual Introduction 1-8 Installing the EM-1240-LX If you would like to use the EM-1240 Embedded Module and the EM-1240 Development Kit, insert the EM-1240 Embedded Module vertically onto the Development Kit. Note that the pin marked “JP4” on the Embedded Module must be matched with...
Page 13 - Connecting the Power; Connecting Data Transmission Cables
EM-1240-LX User’s Manual Introduction 1-9 ATTENTION Safety First! Be sure to disconnect the power cord before installing and/or wiring your EM-1240-LX. Wiring Caution! Calculate the maximum possible current in each power wire and common wire. Observe all electrical codes dictating the maximum curren...
Page 14 - Connecting to the Network; Pin; Connecting to a Serial Device; DB9 Male Port
EM-1240-LX User’s Manual Introduction 1-10 Connecting to the Network Connect one end of the Ethernet cable to the EM-1240-LX’s 10/100M Ethernet port and the other end of the cable to the Ethernet network. If the cable is properly connected, the EM-1240-LX will indicate a valid connection to the Ethe...
Page 15 - Serial Console Port; Serial Console Port & Pinouts; Internal SD Socket; Reset Button; Reset
EM-1240-LX User’s Manual Introduction 1-11 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 EM-1240-LX boot up message. Serial Console Port & Pinouts Serial Console Cable 4 3 2 1 Pin S...
Page 17 - Getting Started; Console Port; Configuring the Ethernet Interface; Make File Sample Code
2 2 Chapter 2 Getting Started In this chapter, we explain the basic procedure for getting the EM-1240-LX connected and ready for your needs. In this chapter, we cover the following topics: Powering on the EM-1240-LX Connecting the EM-1240-LX to a PC ¾ Console Port ¾ Telnet Configuring the Ethe...
Page 18 - Serial Console Port Settings
EM-1240-LX User’s Manual Getting Started 2-2 Powering on the EM-1240-LX Connect the SG wire to the Shielded Contact located on the upper left corner of the EM-1240-LX, and then power on the EM-1240-LX by connecting the power adaptor. It takes about 16 seconds for the system to boot up. Once the syst...
Page 19 - Telnet; Default IP Address Default Netmask; Serial Console Reminder; Telnet Reminder
EM-1240-LX User’s Manual Getting Started 2-3 Telnet If you know at least one of the two IP addresses and netmasks, then you can use Telnet to connect to the EM-1240-LX’s console. Default IP Address Default Netmask LAN 1 192.168.3.127 255.255.255.0 LAN 2 192.168.4.127 255.255.255.0 Telnet can be used...
Page 21 - reboot
EM-1240-LX User’s Manual Getting Started 2-5 3. You may also configure the EM-1240-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” into the rc file as below. dhcpcd -p -a eth0...
Page 22 - Installing a Secure Digital (SD) Memory Card
EM-1240-LX User’s Manual Getting Started 2-6 Installing a Secure Digital (SD) Memory Card The EM-1240-LX provides an internal SD socket for storage expansion. To access this socket, perform the following steps to install the SD memory card. Step 1: Find the exact location of the SD socket. Step 2: I...
Page 23 - Developing Your Applications; Linux; Windows
EM-1240-LX User’s Manual Getting Started 2-7 Developing Your Applications Step 1: Connect the EM-1240-LX 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. Step 5: Do...
Page 25 - Go
EM-1240-LX User’s Manual Getting Started 2-9 Step 3: Click [Next] to select the local package files directory, and then click [Browse…] to select where your installation source is. The default path is the location of the “setup.exe” file. Step 4: Click [Next] to begin the package installation. You w...
Page 26 - hello
EM-1240-LX User’s Manual Getting Started 2-10 #make to compile Hello.c. Finally, execute the program to generate hello and hello.gdb . Uploading “Hello” to the EM-1240-LX To use FTP to upload hello to the EM-1240-LX, issue the following commands on the PC: #ftp 192.168.3.127 ftp> cd /home ftp>...
Page 28 - Make File Example Code
EM-1240-LX User’s Manual Getting Started 2-12 Make File Example Code The following Make File example codes are copied from the Hello example on the EM-1240-LX’s CD-ROM. srcdir = . LDFLAGS = -Wl,-elf2flt LIBS = CFLAGS = # Change these if necessary CC = arm-elf-gcc CPP = arm-elf-gcc -E all: hello hell...
Page 29 - Software Package
3 3 Chapter 3 Software Package This chapter includes information about the software that is used with EM-1240-LX Series products. In this chapter, we cover the following topics: EM-1240-LX Software Architecture ¾ Journaling Flash File System (JFFS2) EM-1240-LX Software Package
Page 31 - Flash Context
EM-1240-LX User’s Manual Software Package 3-3 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 Size Access control Boot loader 0 – 0x3ffff 256 K Read...
Page 32 - bin
EM-1240-LX User’s Manual Software Package 3-4 EM-1240-LX Software Package bin dev upkernel passwd -> tinylogin login -> tinylogin tinylogin telnetd snmpd mail sh routed netstat arp chat pppd portmap ntpdate necid eraseall kversion init expand inetd hwclock ftpd ftp mke2fs e2fsck discard dhcpcd...
Page 34 - NAT Example
4 4 Chapter 4 Configuring the EM-1240-LX In this chapter, we describe how to configure the EM-1240-LX Series products. The following topics are covered in this chapter: Enabling and Disabling Daemons Adding a Web Page IPTABLES NAT ¾ NAT Example ¾ Enabling NAT at Bootp Configuring Dial-in/D...
Page 35 - Enabling and Disabling Daemons; How to enable Network Time Protocol; The min time is 100ms.
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-2 Enabling and Disabling Daemons The following daemons are enabled when the EM-1240-LX boots up for the first time. y SNMP Agent daemon: snmpd y Telnet Server / Client daemon: telnetd y Internet Daemons: inetd y FTP Server / Client daemon: ftpd y WWW...
Page 36 - Adding a Web Page; Default Home Page address:; IPTABLES; Filter Table
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-3 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&...
Page 37 - Mangle Table
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-4 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 doe...
Page 38 - Observe and erase chain rules,; Observe and erase chain rules
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-5 The EM-1240-LX 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...
Page 40 - NAT; Enabling NAT at Bootup
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-7 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 EM-124...
Page 41 - Connect Using a Modem:; Connect Using a Modem:; Configuring PPPoE
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-8 Configuring Dial-in/Dial-out Service Dial-out Service Direct cable connection: y Without username and password, use: />pppd connect ‘chat –v’ /dev/ttyM0 38400 crtscts& y With username and password, use: />pppd connect ‘chat –v’ user xxxxx...
Page 42 - How to Mount a Remote NFS Server
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-9 <USER_PASSWORD>: Password for user account To check if PPPOE is successfully connected, use the command: y />ifconfig ppp0 How to Mount a Remote NFS Server Currently, the EM-1240-LX only supports NFS (Network File System) clients. Users ca...
Page 43 - Upgrading the Kernel; Login Password: xxxx; upkernel
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-10 Upgrading the Kernel The EM-1240-LX kernel is em1240 -1.x..bin , which can be downloaded from www.moxa.com. You must first download this file to your PC, and then use Console Terminal or Telnet Console to copy the file to the EM-1240-LX. You can s...
Page 44 - Upgrading the Root File System & User Directory
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-11 Upgrading the Root File System & User Directory The EM-1240-LX uses JFFS2 for root file system and user directory. By default, the root file system is pre-set to READ only. The EM-1240-LX provides a read/write user’s directory in the JFFS2 fil...
Page 45 - User Directory Backup; backupfs
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-12 User Directory Backup — EM-1240-LX to PC To enable the RAM disk, use the following command: />upramdisk />cd ramdisk Use the backupfs command to backup the file system. /ramdisk>backupfs /ramdisk/usrdisk-backup The file system will be bac...
Page 46 - Loading Factory Defaults; How to Upgrade User Directory; Mirroring the Application Program and Configuration; Autostarting User Applications on Bootup; Checking the Kernel and Root File System Versions
EM-1240-LX User’s Manual Configuring EM-1240-LX 4-13 | +bin Loading Factory Defaults The easiest way to “Load Factory Defaults” is with the “Upgrade User directory” operation. Refer to the previous section “ How to Upgrade User Directory ” for an introduction. You may also press the RESET button for...
Page 48 - Buzzer
5 5 Chapter 5 EM-1240-LX Device API In this chapter, we discuss the Device API for the EM-1240-LX Series. We introduce the APIs for the following functions: RTC (Real-time Clock) Buzzer UART Interface
Page 49 - UART Interface
EM-1240-LX User’s Manual EM-1240-LX Device API 5-2 RTC (Real-time Clock) The device node is located at /dev/rtc . The EM-1240-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_t...
Page 50 - UC Finder; Windows UC Finder
6 6 Chapter 6 UC Finder The EM-1240-LX comes with a UC Finder utility, which has the sole purpose of searching the LAN or intranet for the EM-1240-LX units. For most of the applications, it is not easy to remember the IP addresses of Universal Communicators connected to the LAN. This is especially t...
Page 51 - Welcome to the UC Finder Setup Wizard; Create a desktop icon; Next
EM-1240-LX User’s Manual UC Finder 6-2 Windows UC Finder The following steps 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 con...
Page 52 - Launch UC Finder
EM-1240-LX User’s Manual UC Finder 6-3 4. Select the Launch UC Finder option, to use UC Finder immediately after the installation has finished, and then click Next to complete the installation. 5. When the UC Finder window opens, click Broadcast Search to search for all Universal Communicators conne...
Page 54 - Linux UC Finder; ucfinder
EM-1240-LX User’s Manual UC Finder 6-5 ATTENTION UC finder is designed solely to find IP addresses of networked Universal Communicators. It cannot be used to configure Universal Communicators over the network. If you need to configure UC’s IP address or other parameters, connect to UC’s console util...
Page 55 - System Commands; busybox: μClinux normal command utility collection; File manager
A A Appendix A System Commands busybox: µClinux normal command utility collection File manager cp copy file ls list file ln make symbolic link file mount mount and check file system rm delete file chmod change file owner & group & user chown change file owner chgrp change file group sync syn...
Page 56 - Network
EM-1240-LX User’s Manual System Commands A-2 Network 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 rest...
Page 57 - Group; RFC1213 MIB-II supported SNMP variables:
B B Appendix B SNMP Agent with MIB II & RS-232 Like Group The EM-1240-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-1240-LX. The full SNMP object ID o...
Page 58 - SNMP Agent with MIB II & RS-232 Like Group; ip MIB
EM-1240-LX User’s Manual SNMP Agent with MIB II & RS-232 Like Group B-2 ip MIB tcp MIB udp MIB ipForwarding ipDefaultTTL ipInReceives ipInHdrErrors ipInAddrErrors ipForwDatagrams ipInUnknownProtos ipInDiscards ipInDelivers ipOutRequests ipOutDiscards ipOutNoRoutes ipReasmTimeout ipReasmReqds ipR...
Page 59 - snmp MIB
EM-1240-LX User’s Manual SNMP Agent with MIB II & RS-232 Like Group B-3 snmp MIB snmpInPkts snmpOutPkts snmpInBadVersions snmpInBadCommunityNames snmpInBadCommunityUses snmpInASNParseErrs snmpInTooBigs snmpInNoSuchNames snmpInBadValues snmpInReadOnlys snmpInGenErrs snmpInTotalReqVars snmpInTotal...
Page 60 - Answer 1; Answer 2; Answer 3
C C Appendix C EM-1240-LX FAQ FAQ 1 Why can I only use vfork( ),and am unable to use fork( )? Answer 1 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. FAQ 2 When using ...
Page 61 - Service Information; Moxa Internet Services
D D Appendix D Service Information This appendix shows you how to contact Moxa for information about this and other products, and how to report problems. In this appendix, we cover the following topics. Moxa Internet Services Problem Report Form Product Return Procedure
Page 62 - The following services are provided
EM-1240-LX User’s Manual Service Information D-2 Moxa Internet Services Customer satisfaction is our primary concern. To ensure that customers receive the full benefit of our products, Moxa Internet Services has been set up to provide technical support, driver updates, product information, and user’...
Page 63 - Problem Report Form
EM-1240-LX User’s Manual Service Information D-3 Problem Report Form Moxa EM-1240-LX Customer name: Company: Tel: Fax: Email: Date: 1. Moxa Product: EM-1240-LX 2. Serial Number: ___________ ______ Problem Description: Please describe the symptoms of the problem as clearly as possible, including an...
Page 64 - Product Return Procedure
EM-1240-LX User’s Manual Service Information D-4 Product Return Procedure For product repair, exchange, or refund, the customer must: Provide evidence of original purchase. Obtain a Product Return Agreement (PRA) from the sales representative or dealer. Fill out the Problem Report Form (PRF). ...