Moxa Technologies EM-1240-LX User Manual
Moxa Technologies EM-1240-LX User Manual

Moxa Technologies EM-1240-LX User Manual

Mini risc-based ready-to-run embedded computer
Hide thumbs Also See for EM-1240-LX:
Table of Contents

Advertisement

Quick Links

EM-1240-LX User's Manual
www.moxa.com/product
First Edition, November 2006
Moxa Systems Co., Ltd.
Tel:
+886-2-8919-1711
Fax:
+886-2-8919-1722
Web: www.moxa.com
Moxa Technical Support
Worldwide:
The Americas
support@moxa.com
support@usa.moxa.com

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Moxa Technologies EM-1240-LX

  • Page 1 EM-1240-LX User’s Manual www.moxa.com/product First Edition, November 2006 Moxa Systems Co., Ltd. Tel: +886-2-8919-1711 Fax: +886-2-8919-1722 Web: www.moxa.com Moxa Technical Support Worldwide: support@moxa.com The Americas support@usa.moxa.com...
  • Page 2: Copyright Notice

    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.
  • Page 3: Table Of Contents

    Real-time Clock... 1-12 Chapter 2 Getting Started ...2-1 Powering on the EM-1240-LX ... 2-2 Connecting the EM-1240-LX to a PC... 2-2 Console Port ... 2-2 Telnet... 2-3 Configuring the Ethernet Interface ... 2-4 Installing a Secure Digital (SD) Memory Card... 2-6 Developing Your Applications ...
  • Page 4 Dynamic Driver Module Load/Unload ... 4-9 Upgrading the Kernel... 4-10 Upgrading the Root File System & User Directory ...4-11 User Directory Backup—EM-1240-LX to PC... 4-12 Loading Factory Defaults ... 4-13 Mirroring the Application Program and Configuration... 4-13 Autostarting User Applications on Bootup ... 4-13 Checking the Kernel and Root File System Versions...
  • Page 5: Chapter 1 Introduction

    EM-1240-LX is an ideal solution for embedded applications that use a lot of memory and must be housed in a small physical space without sacrificing performance. This chapter covers the...
  • Page 6: Overview

    Software written for desktop PCs is easily ported to the EM-1240-LX by using a GNU cross complier, so that you will not need to spend time modifying existing software code. The operating system, device drivers, and your own software can all be stored in the EM-1240-LX’s Flash memory.
  • Page 7: Product Specifications

    EM-1240-LX User’s Manual Product Specifications Hardware Specifications Model Flash LAN Protection Serial Port Serial Console Storage Expansion GPIO Real-time Clock Watchdog Timer Buzzer Signals LED Signals Reset Signal Power Input Dimensions (W x L) Operating temperature Storage temperature Module Interface...
  • Page 8: Software Specifications

    EM-1240-LX User’s Manual Software Specifications Kernel Protocol Stack File System pppd PPPoE snmpd busybox Tinylogin Telnetd telnet inetd ftpd ntpdate Linux Tool Chain Windows Tool Chain UC Finder µClinux Kernel 2.6.9 Supports dynamic driver module load / unload ARP, ICMP, IPV4, TCP, UDP, FTP, Telnet, SNMP V1/V2c, HTTP,...
  • Page 9: Hardware Block Diagram

    EM-1240-LX User’s Manual Introduction Hardware Block Diagram Appearance EM-1240 Embedded Module + Development Kit EM-1240 EM-1240 Development Kit Embedded Module...
  • Page 10 EM-1240-LX User’s Manual Introduction EM-1240 Embedded Module EM-1240 Development Kit...
  • Page 11: Dimensions

    EM-1240-LX User’s Manual Dimensions EM-1240 Embedded Module. EM-1240 Development Kit Introduction...
  • Page 12: Installing The Em-1240-Lx

    Pin marked “JP4” on the Development Kit. Be careful when inserting the module to avoid damaging the product. LED Indicators The following table explains the function of the five LED indicators located on the EM-1240-LX’s top panel. LED Name Ready...
  • Page 13: Connecting The Power

    Connecting the Power Connect the “live-wire” end of the 12-48 VDC power adapter to the EM-1240-LX’s terminal block. If the power is properly supplied, the “Ready” LED will glow a solid green after a 25 to 30 second delay.
  • Page 14: 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 Ethernet in the following ways: The top-right LED on the connector glows a solid green when connected to a 100 Mbps Ethernet network.
  • Page 15: Serial Console Port

    The internal SD socket is located at the backside of the EM-1240-LX bottom board; you can find the SD plug-in slot at the right of the EM-1240-LX, lower than the cover screw. Plug the SD card into the socket directly and remember to press the SD card first if you want to take it out.
  • Page 16: Real-Time Clock

    EM-1240-LX User’s Manual ATTENTION Resetting to factory defaults will not format the user directory and erase all of the user’s data. Loading factory defaults will only load the configuration file. The files in the EM-1240-LX that will be replaced include: /etc/boa.conf b.
  • Page 17: 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 Ethernet Interface...
  • Page 18: Powering On The Em-1240-Lx

    EM-1240-LX User’s Manual 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.
  • Page 19: Telnet

    Serial Console Reminder: Remember to choose VT100 as the terminal type. Use the CBL-RJ45F9-150 cable that comes with the EM-1240-LX to connect to the serial console port. If you are not able to conect on the first try, unplug and then re-plug the EM-1240-LX’s power cord.
  • Page 20: Configuring The Ethernet Interface

    EM-1240-LX User’s Manual Configuring the Ethernet Interface In this section, we use the serial console to explain how to modify the EM-1240-LX’s network settings. 1. Change directories by issuing the command cd /etc. 2. Type the command vi rc to use the VI Editor to edit the configuration file. The IP addresses for the EM-1240-LX’s LAN1 and LAN2 are given as...
  • Page 21 EM-1240-LX User’s Manual 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.
  • Page 22: Installing A Secure Digital (Sd) Memory Card

    EM-1240-LX User’s Manual 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.
  • Page 23: Developing Your Applications

    The Tool Chain requires about 100 MB of hard disk space (on your PC). The EM-1240-LX Tool Chain can be found on the EM-1240-LX CD. To install the Tool Chain, insert the CD into your PC and then issue the following command: #mount –t iso9660 /dev/cdrom /mnt/cdrom...
  • Page 24 EM-1240-LX User’s Manual Getting Started Step 1: Double click the “tool-chain\windows\setup.exe” on the EM-1240-LX CD to begin the installation, then click [Next]. Step 2: Click [Browse…] to select your installation location. The default location is under C:\UC.
  • Page 25: Compiling Hello.c

    MD5 status of each software package. Click [Next] to let the installer finish the installation. ATTENTION You can download the Tool Chain from Moxa’s website (go to the EM-1240-LX product page, click the Documentation & Drivers link, and then click Go under Driver & Software Downloads. Compiling Hello.c...
  • Page 26: Uploading "Hello" To The Em-1240-Lx

    #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> bin ftp>...
  • Page 27: Running "Hello" On The Em-1240-Lx

    If the flash memory is full, you will no longer be able to save data in Flash ROM. To free up some memory, use the console cable to connect to the EM-1240-LX’s serial console terminal, and then delete files from the Flash ROM.
  • Page 28: Make File Example Code

    EM-1240-LX User’s Manual 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...
  • Page 29: Chapter 3 Software Package

    Chapter 3 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 Software Package...
  • Page 30: Em-1240-Lx Software Architecture

    µClinux architecture, making programs that follow the POSIX standard easily ported to the EM-1240-LX by using 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 31: Journaling Flash File System (Jffs2)

    EM-1240-LX User’s Manual 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 Boot loader Kernet & Root File System User Directory Developers write their own programs only on partition /etc, /home, /tmp, and /usr/bin .It is advised...
  • Page 32: Em-1240-Lx Software Package

    EM-1240-LX User’s Manual EM-1240-LX Software Package upkernel passwd -> tinylogin login -> tinylogin tinylogin telnetd snmpd mail routed netstat chat pppd portmap ntpdate necid eraseall kversion init expand inetd hwclock ftpd mke2fs e2fsck discard dhcpcd busybox backupfs downramdisk upramdisk mtdblock1...
  • Page 33 EM-1240-LX User’s Manual Software Package ptyp0 ram1 ram0 null kmem cua0 console...
  • Page 34: Configuring The Em-1240-Lx

    Configuring the EM-1240-LX Chapter 4 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 Example Enabling NAT at Bootp...
  • Page 35: Enabling And Disabling Daemons

    Disable the www service by typing “#” in front of the first character of the row. How to enable Network Time Protocol ntpdate is a time adjusting client utility. The EM-1240-LX plays the role of Time client, and sends requests to the Network Time Server to request the correct time.
  • Page 36: Adding A Web Page

    A rule (such as a jump to a user-defined chain in the same table) is called a “target.” The EM-1240-LX supports three types of IPTABLES tables: Filter tables, NAT tables, and Mangle tables: A. Filter Table—includes three chains:...
  • Page 37 EM-1240-LX User’s Manual 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 38 EM-1240-LX User’s Manual The EM-1240-LX supports the following sub-modules. Be sure to use the module that matches your application. ip_conntrack ip_conntrack_ftp ipt_conntrack_irc ip_nat_ftp ip_nat_irc ip_nat_snmp_basic ip_queue NOTE The EM-1240-LX does NOT support IPV6 and ipchains. Use iptables, iptables-restore, iptables-save to maintain the database.
  • Page 39 # iptables –A INPUT –i eth0 –p tcp --dport 21 –j DROP Example 6: Accept TCP packets from 192.168.0.24 to the EM-1240-LX’s port 137, 138, 139 # iptables –A INPUT –i eth0 –p tcp –s 192.168.0.24 --dport 137:139 –j ACCEPT Example 7: Drop all packets from MAC address 01:02:03:04:05:06.
  • Page 40: Nat

    IP addresses used on another network. One network is designated the inside network and the other is the outside network. Typically, the EM-1240-LX connects several devices on a network and maps local inside network addresses to one or more global outside IP addresses, and remaps the global IP addresses on incoming packets back into local IP addresses.
  • Page 41: Configuring Dial-In/Dial-Out Service

    EM-1240-LX User’s Manual Configuring Dial-in/Dial-out Service Dial-out Service Direct cable connection: Without username and password, use: />pppd connect ‘chat –v’ /dev/ttyM0 38400 crtscts& With username and password, use: />pppd connect ‘chat –v’ user xxxxx password xxxxx /dev/ttyM0 38400 crtscts& Connect Using a Modem: Use: />pppd connect ‘chat –v ATDT<phone_number>...
  • Page 42: How To Mount A Remote Nfs Server

    Currently, the EM-1240-LX only supports NFS (Network File System) clients. Users can open NFS service on a Linux PC to enable the EM-1240-LX to push data to it. The EM-1240-LX can use NFS to mount a remote disk as a local disk for data or log purposes.
  • Page 43: Upgrading The Kernel

    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 save this file to the EM-1240-LX’s RAM disk, and then upgrade the kernel. The following is a step-by-step example.
  • Page 44: Upgrading The Root File System & User Directory

    The format is em1240-1.x.dsk. You must download this file to a PC first, and then use Console Terminal or Telnet Console to copy the file to the EM-1240-LX. You can save this file to the EM-1240-LX’s RAM disk, and then upgrade the user directory. The following is a step-by-step example.
  • Page 45: User Directory Backup-Em-1240-Lx To Pc

    EM-1240-LX User’s Manual 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 backed up. Use ftp commands to transfer the usrdisk-backup to the FTP server on the PC.
  • Page 46: Loading Factory Defaults

    “ldfactory” in telnet console to restore the factory defaults. Mirroring the Application Program and Configuration For some applications, you may need to “Mirror” (or sometimes “Ghost”) one EM-1240-LX’s user directory, and duplicate it to other EM-1240-LXs.
  • Page 47 EM-1240-LX User’s Manual Configuring EM-1240-LX To check the root file system (firmware) version of the EM-1240-LX, type: />fsversion You may also check the user directory version of the EM-1240-LX by using the following command: />cat /etc/version 4-14...
  • Page 48: Em-1240-Lx Device Api

    Chapter 5 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 EM-1240-LX Device API...
  • Page 49: Rtc (Real-Time Clock)

    Description: Sets RTC time. Buzzer The device node is located at /dev/console. The EM-1240-LX supports µClinux standard buzzer control. The EM-1240-LX’s buzzer runs at a fixed frequency of 100 Hz. You must include <sys/kd.h> to use these functions. 1. Function: KDMKTONE ioctl(fd, KDMKTONE, unsigned int arg);...
  • Page 50: 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 true for some problem solving and testing in the field.
  • Page 51: Windows Uc Finder

    EM-1240-LX User’s Manual 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 continue.
  • Page 52 EM-1240-LX User’s Manual 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 connected to the LAN.
  • Page 53 EM-1240-LX User’s Manual 6. The Searching window will show the Universal Communicators that have been located. You can click Stop as soon as the Universal Communicator you are looking for is listed. 7. When the search is complete, the Broadcast Search window closes, and the Model, MAC Address, and IP Address of all Universal Communicators that were located will be listed in the UC Finder window.
  • Page 54: Linux Uc Finder

    EM-1240-LX User’s Manual 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 utility by Telnet (over the network) or serial console (using the serial console cable that came with the product).
  • Page 55: Appendix A System Commands

    busybox: µClinux normal command utility collection File manager mount chmod chown chgrp sync mkdir rmdir head tail touch Editor grep find more test echo System Commands Appendix A copy file list file make symbolic link file mount and check file system delete file change file owner &...
  • Page 56: Network

    EM-1240-LX User’s Manual Network ping route netstat ifconfig tracerout tftp telnet iptables-restore iptables iptables-save Process kill killall sleep Other dmesg stty mknod free date clear reboot halt gzip, gunzip, zcat hostname Moxa Special Utilities backupfs cat /etc/version upramdisk downramdisk kversion...
  • Page 57 SNMP Agent with MIB II & RS-232 Like 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 of the EM-1240-LX is “.iso.3.6.1.4.1.8691.12.7112” and “.iso.3.6.1.4.1.8691.12.1240”.
  • Page 58: Appendix B Snmp Agent With Mib Ii & Rs-232 Like Group

    EM-1240-LX User’s Manual ip MIB ipForwarding ipDefaultTTL ipInReceives ipInHdrErrors ipInAddrErrors ipForwDatagrams ipInUnknownProtos ipInDiscards ipInDelivers ipOutRequests ipOutDiscards ipOutNoRoutes ipReasmTimeout ipReasmReqds ipReasmFails ipFragOKs ipFragFails ipFragCreates ipAddrTable ipAdEntAddr ipAdEntIfIndex ipAdEntNetMask ipAdEntBcastAddr ipAdEntReasmMaxSize ipRouteTable ipRouteDest ipRouteIfIndex ipRouteMetric1 ipRouteMetric2 ipRouteMetric3 ipRouteMetric4 ipRouteNextHop ipRouteType ipRouteProto ipRouteAge...
  • Page 59 EM-1240-LX User’s Manual 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 snmpOutTraps snmpEnableAuthenTraps RFC1317 RS-232 like group supported variables rs232 MIB...
  • Page 60: Appendix C Em-1240-Lx Faq

    -1pthread to add an option to the linker. What is the correct format for linking to an API? FAQ 3 Answer 3 arm-elf-gcc –W1, -elf2flt (In this example, the API converts elf format to flat format.) EM-1240-LX FAQ Appendix C...
  • Page 61: Appendix D Service Information

    Appendix D 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 Service Information...
  • Page 62: Moxa Internet Services

    EM-1240-LX User’s Manual 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’s manual updates.
  • Page 63: Problem Report Form

    EM-1240-LX User’s Manual Problem Report Form Customer name: Company: Tel: Email: EM-1240-LX 1. Moxa Product: 2. Serial Number: _________________ Problem Description: Please describe the symptoms of the problem as clearly as possible, including any error messages you see. A clearly written description of the problem will allow us to reproduce the symptoms, and expedite the repair of your product.
  • Page 64: Product Return Procedure

    EM-1240-LX User’s Manual 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). Include as much detail as possible for a shorter product repair time.

Table of Contents