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...
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...
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.
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...
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...
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.
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.
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.
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.
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...
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.
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.
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.
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.
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.
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...
#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>...
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.
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...
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...
µ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.
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...
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...
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.
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.
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.
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>...
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.
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.
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.
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.
“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...
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...
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);...
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.
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.
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).
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 &...
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”.
-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...
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...
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.
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.
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.
Need help?
Do you have a question about the EM-1240-LX and is the answer not in the manual?
Questions and answers