ThinkCore W311/321/341 Linux User’s Manual Second Edition, March 2007 www.moxa.com/product MOXA Systems Co., Ltd. Tel: +886-2-2910-1230 Fax: +886-2
22 Chapter 2 Getting Started In this chapter, we explain how to connect the W311/321/341, how to turn on the power, how to get started programming
ThinkCore W311/321/341 Linux User’s Manual System Commands A-2Process 1. kill kill process 2. ps display now running process Other 1. dmesg dum
BB Appendix B Service Information This appendix shows you how to contact Moxa for information about this and other products, and how to report pro
ThinkCore W311/321/341 Linux User’s Manual Service Information B-2MOXA Internet Services Customer satisfaction is our number one concern, and to ens
ThinkCore W311/321/341 Linux User’s Manual Service Information B-3Problem Report Form MOXA ThinkCore W311/321/341 Customer name: Company: Tel: Fax
ThinkCore W311/321/341 Linux User’s Manual Service Information B-4Product Return Procedure For product repair, exchange, or refund, the customer mu
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-2Powering on the W311/321/341 Connect the SG wire to the shielded contact located in th
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-3The following window will open when a connection has been established. To log in, typ
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-4 You can proceed with configuring the network settings of the target computer when you
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-5 Linux Users From a Linux machine, use the “ssh” command to access the W311/321/341’s
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-62. Type #vi interfaces to edit the network configuration file with vi editor. You can
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-7 /etc/wireless.conf Format: DEVICE=eth1 MODE=managed ESSID=any KEY=any /etc/wireless
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-8Default Setting for WIRLESS LAN Dynamic Setting using DHCP iface eth1 inet static ad
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-9Channel—Sets the channel Using iwconfig eth1 channel Setting Note: Infrastruct couldn’
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-10140 5700 (K) 184 4920 (K) 188 4940 (K) 192 4960(K) 196 4980 (K) 8 5040 (K) 12 5060 (K
ThinkCore W311/321/341 Linux User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accor
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-11Using WPA_SUPPLICANT to Support WPA and WPA2 This embedded computer supports the WPA
ThinkCore W311/321/341 Linux User’s Manual Getting Started2-12W341The SD slot is located on the front panel of the W341. To install an SD card, you m
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-13Test Program—Developing Hello.c In this section, we use the standard “Hello” programm
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-14 If there isn’t enough “Available” space for your application, you will need to delet
detratS gnitteG launaM s’resU xuniL 143/123/113W eroCknihT2-15NOTE Since Moxa’s tool chain places a specially designed Makefile in the directory /tmp/
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-16Testing Environment The tcps2 example demonstrates a simple application program that
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-17Compiling tcps2.c The source code for the tcps2 example is located on the CD-ROM at C
detratS gnitteG launaM s’resU xuniL 143/123/113W eroCknihT2-18Uploading and Running the “tcps2-release” Program Use the following commands to upload t
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-194. The program should start running in the background. Use the #ps –ef command to ch
ThinkCore W311/321/341 Linux User’s Manual Getting Started 2-20NOTE Use the kill -9 command for PID 728 to terminate this program: #kill -9 %728 Te
Table of Contents Chapter 1 Introduction ...1-1 Overv
33 Chapter 3 Managing Embedded Linux This chapter includes information about version control, deployment, updates, and peripherals. The informatio
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux 3-2System Version Information To determine the hardware capability of your W311/3
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux 3-3Since different Flash disks have different sizes, it is a good idea to check t
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-42. Type the following commands to use the W311/321/341’s built-in FTP client to
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux 3-5 ATTENTION The upfirm utility will reboot your target after the upgrade is OK.
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-6Deploying the User Directory to Additional W311/321/341 Units For some applicati
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-7Type the command “ps –ef” to list all processes currently running. 192.168.3.127
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-8The enabled daemons will be available after you reboot the system. 192.168.3.127
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-9192.168.3.127 – PuTTY root@Moxa:/ect/rc.d/rc3.d# ls S19nfs-common S25nfs-user-s
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-10The following figure illustrates how to update thesystem time and set the RTC t
Chapter 4 Managing Communications ...4-1 Telnet / FTP ...
ThinkCore W311/321/341 Linux User’s Manual Managing Embedded Linux3-11How to run the shell script automatically when the kernel boots upCopy the exam
44 Chapter 4 Managing Communications In this chapter, we explain how to configure the W311/321/341’s various communication functions. The followin
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-2Telnet / FTP In addition to supporting Telnet client/server and FTP client/ser
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-3/home/httpd/cgi-bin/ Before you modify the homepage, use a browser (such as Mi
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-4To open the default CGI test script report page, type http://192.168.3.127/cgi
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-5Step 2: Type ‘upramdisk’ to get the free space ram disk to save the package. 192
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-6Step 5: Run ‘install.sh’ and select to install php 192.168.3.127 – PuTTY ro
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-7IPTABLES IPTABLES is an administrative tool for setting up, maintaining, and i
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-8 The W311/321/341 support the following sub-modules. Be sure to use the modul
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-9NOTE The W311/321/341 do NOT support IPV6 and ipchains. The basic syntax to
Appendix A System Commands...A-1 busybox (V0.60.4): Linux normal c
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-10Define policy for chain rules Usage: # iptables [-t tables] [-P] [INPUT, OUTPUT
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-11Example 8: Drop all packets from MAC address 01:02:03:04:05:06. # iptables –A I
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-12Enabling NAT at Bootup In most real world situations, you will want to use a si
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-13optional. #pppd connect ‘chat -v “ “ ATDT5551212 CONNECT ogin: username word
ThinkCore W311/321/341 Linux User’s Manual Managing Communications4-14Example 2: Connecting to a PPP server over a hard-wired link If a username and
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-15This should show three routes, something like this: Kernel routing table Dest
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-164. Edit the file /etc/ppp/pap-secrets and add the following: “username@hinet
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-176. Add one of two files: /etc/ppp/options.eth0 or /etc/ppp/options.eth1. The
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-18NOTE Click on the following links for more information about NFS: http://www
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-193: sysUpTime.0 (timeticks) 0 days 03h:50m:11s.00th (1381100) 4: sysContact.0
11 Chapter 1 Introduction The MOXA ThinkCore W311/321/341 are RISC-based ready-to-run wireless embedded computers with 802.11a/b/g WLAN, one 10/10
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-2070: ifInUcastPkts.2 (counter) 28224 71: ifInUcastPkts.3 (counter) 0 72: ifInU
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-21137: ifSpecific.3 (object identifier) (null-oid) zeroDotZero 138: ifSpecific.
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-22204: ipNetToMediaPhysAddress.1.192.168.27.139 (octet string) 00.90.E8.10.02.4
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-23271: tcpConnLocalAddress.192.168.27.139.1025.0.0.0.0.0 (ipaddress) 192.168.27
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-24338: tcpConnRemPort.192.168.4.127.9.0.0.0.0.0 (integer) 0 339: tcpConnRemPort
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-25405: rs232PortOutSigNumber.2 (integer) 2 406: rs232PortOutSigNumber.3 (intege
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-26472: rs232OutSigPortIndex.1.4 (integer) 1 [1] 473: rs232OutSigPortIndex.2.4 (
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-27OpenVPN OpenVPN provides two types of tunnels for users to implement VPNS: Ro
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-28NETMASK= BROADCAST= # it is not a great idea but this system doesn’t support
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-29 mname=tun module_up mname=bridge module_up # create an ethernet bridge t
ThinkCore W311/321/341 Linux User’s Manual Introduction 1-2Overview The ThinkCore W311/321/341 wireless embedded computers support 802.11a/b/g wirel
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-30 ;; restart) stop start ;; *) echo “Usage: $0 [start|stop|restart]
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-315. On each OpenVPN machine, check the routing table by typing the command: #
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-322. The configuration procedure is almost the same as for the previous exampl
ThinkCore W311/321/341 Linux User’s Manual Managing Communications 4-33# value after “-net” is the subnet behind the remote peer route add -net 192.
55 Chapter 5 Tool Chains for Application Development This chapter describes how to install a tool chain in the host computer that you use to devel
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-2Linux Tool Chain The Linux tool chain contains a suite of cros
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-3The following cross compiler tools are provided: ar Manages a
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-4Windows Tool Chain The Windows tool chain is a cross developme
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-51. Double click on the tool chain file to start the installti
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-63. Navigate to the directory where the packages of the tool c
ThinkCore W311/321/341 Linux User’s Manual Introduction 1-3Factory Default Image file. The user directory saves the user’s settings and application.
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-7y Base Category: List all packages that will be installed by d
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-86. Checkmark Create icon on Desktop to place a Moxa BASH Shel
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-9Using the BASH Shell A command-line interface is used to devel
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-10Compilation for Applications Windows tool chain is a cross co
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-11Next, enter the hello directory and invoke the make program t
ThinkCore W311/321/341 Linux User’s Manual Tool Chains for Application Development 5-12On-Line Debugging with Insight Insight is a graphical user in
66 Chapter 6 Programmer’s Guide This chapter includes important information for programmers. The following functions are covered in this chapter:
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-2Flash Memory Map Partition sizes are hard coded into the kernel binary. To change t
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-3Buzzer The device node is located at /dev/console. The W311/321/341 support Linux s
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-4int swtd_enable(int fd, unsigned long time) Description Enable application sWatchDo
ThinkCore W311/321/341 Linux User’s Manual Introduction 1-4Software Package Boot Loader Moxa Boot Loader (v1.2) Kernel Linux 2.6.9 Protocol Stack AR
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-5int swtd_ack(int fd) Description Acknowledge sWatchDog. When the user application e
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-6} The makefile is shown below: all: arm-linux-gcc –o xxxx xxxx.c –lmoxalib Exa
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-7The makefile is shown below: all: arm-linux-gcc –o xxxx xxxx.c –lmoxalib UART T
ThinkCore W311/321/341 Linux User’s Manual Programmer’s Guide 6-8if ( (term.c_cflag & (CBAUD|CBAUDEX)) != B4000000 ) { // follow the standard
77 Chapter 7 Software Lock “Software Lock” is an innovative technology developed by the Moxa engineering team. It can be adopted by a system integ
88 Chapter 8 UC Finder UC Finder comes in handy if you forget the IP address of the target computer while you have a demand for troubleshooting fi
ThinkCore W311/321/341 Linux User’s Manual UC Finder 8-2Windows UC Finder The UC Finder utility is used to search the LAN or intranet for Moxa embed
ThinkCore W311/321/341 Linux User’s Manual UC Finder 8-33. Click on Next to install program files in the default directory, or select an alternativ
ThinkCore W311/321/341 Linux User’s Manual UC Finder 8-41. Click o n the Broadcast Search button to start searching. 2. The Searching window disp
AA Appendix A System Commands busybox (V0.60.4): Linux normal command utility collection File manager 1. cp copy file 2. ls list file 3. ln ma
Comments to this Manuals