Moxa Technologies user manual UC-7420/7410 User’s Manual Managing Embedded Linux

Page 47

UC-7420/7410 User’s Manual

 

Managing Embedded Linux

 

 

 

 

 

 

 

192.168.3.127 – PuTTY

 

 

 

 

 

 

 

 

 

 

root@Moxa:~# cd /etc

 

 

 

 

root@Moxa:/etc# ps -ef

 

 

 

PID

Uid

VmSize Stat Command

 

 

1

root

1296

S

init

 

 

2

root

 

 

 

S

[keventd]

 

 

3

root

 

 

 

S

[ksoftirqd_CPU0]

 

 

4

root

 

 

 

S

[kswapd]

 

 

5

root

 

 

 

S

[bdflush]

 

 

6

root

 

 

 

S

[kupdated]

 

 

7

root

 

 

 

S

[mtdblockd]

 

 

8

root

 

 

 

S

[khubd]

 

 

10

root

 

 

 

S

[jffs2_gcd_mtd3]

 

 

32

root

 

 

 

D

[ixp425_csr]

 

 

34

root

1256

S

[ixp425 ixp0]

 

 

38

root

S

stdef

 

 

36

root

1368

S

[ixp425 ixp1]

 

 

47

root

S

/usr/sbin/inetd

 

 

53

root

4464

S

/usr/sbin/httpd

 

 

54

nobody

4480

S

/usr/sbin/httpd

 

 

64

nobody

4480

S

/usr/sbin/httpd

 

 

65

nobody

4480

S

/usr/sbin/httpd

 

 

66

nobody

4480

S

/usr/sbin/httpd

 

 

67

nobody

4480

S

/usr/sbin/httpd

 

 

92

bin

1460

S

/sbin/portmap

 

 

104

root

1556

S

/usr/sbin/rpc.statd

 

 

108

root

4044

S

/usr/sbin/snmpd –s –l /dev/null

 

 

110

root

2828

S

/usr/sbin/snmptrapd -s

 

 

139

root

1364

S

/sbin/cardmgr

 

 

143

root

1756

S

/usr/sbin/rpc.nfsd

 

 

145

root

1780

S

/usr/sbin/rpc.mountd

 

 

152

root

2960

S

/usr/sbin/sshd

 

 

160

root

1272

S

/bin/reportip

 

 

161

root

3464

S

/bin/massupfirm

 

 

162

root

1532

S

/sbin/getty 115200 ttyS01

 

 

163

root

1532

S

/sbin/getty 115200 ttyS1

 

 

166

root

3464

S

/bin/massupfirm

 

 

167

root

3464

S

/bin/massupfirm

 

 

170

root

3652

S

/usr/sbin/sshd

 

 

171

root

2196

S

–bash

 

 

182

root

1592

S

ps -ef

 

 

root@Moxa:/ect#

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To run a private daemon, you can edit the file rc.local, as follows:

#cd /etc/rc.d #vi rc.local

192.168.3.127 – PuTTY

root@Moxa:~# cd /etc/rc.d root@Moxa:/etc/rc.d# vi rc.local

Next, use the vi open your application program. We use the example program tcps2-release, and put it to run in the background.

192.168.3.127 – PuTTY

#!/bin/sh

#Add you want to run daemon /root/tcps2-release &~

Then you will find the enabled daemons after you reboot the system.

3-7

Image 47
Contents Third Edition, June UC-7420/7410 User’s ManualDisclaimer Copyright NoticeTrademarks Table of Contents Chapter UC Finder Appendix B Windows Tool Chain Introduction ‰ Hardware Introduction IntroductionUC-7410-LX Package ChecklistProduct Features OverviewProduct Hardware Specifications Appearance Appearance and DimensionsHardware Introduction Dimensions LED Name Color Meaning Hardware Block DiagramLED Indicators Real Time Clock Reset-type ButtonsReset Button Reset to default ButtonWall or Cabinet Placement OptionsDIN-Rail Mounting Wiring RequirementsHardware Connection Description Grounding UC-7420/7410 Connecting the PowerConnecting to the Network Pin SignalPin RS-232 RS-422 RS-485 Connecting to a Serial DeviceConnecting to the Console Port CompactFlashSoftware Architecture Software IntroductionSoftware Package Journaling Flash File System JFFS2Software Version Comparison Table Directory Change Protocol stacks and utilitiesGetting Started ‰ Configuring the Ethernet InterfaceSerial Console Powering on UC-7420/7410Connecting UC-7420/7410 to a PC 192.168.4.127 255.255.255.0 Default IP Address NetmaskTelnet Console 192.168.3.127 255.255.255.0Windows Users SSH ConsoleStatic IP addresses Configuring the Ethernet InterfaceModifying Network Settings with the Serial Console Linux UsersDynamic IP addresses IEEE802.11b Configuring the Wlan via the Pcmcia InterfaceModifying Network Settings over the Network Default IP address is 192.168.5.127, netmask#vi /etc/wlan/wlancfg-any IEEE802.11g Setting Setting ExplanationKey1Str, Key2Str, Key3Str, Key4Str-Sets strings Key1 to Key4 TurboRate-Enables or disables TurboRate Step Installing the Tool Chain LinuxTest Program-Developing Hello.c Checking the Flash Memory SpaceYou should receive the following response Compiling Hello.cUploading Hello to UC-7420/7410 and Running the Program Testing EnvironmentDeveloping Your First Application #mount -t iso9660 /dev/cdrom /mnt/cdrom Compiling tcps2.cPuTTY Uploading tcps2-release and Running the Program#jobs // use this command to check if the program is running UC-7420/7410 User’s Manual Testing Procedure SummaryUC-7420/7410 User’s Manual Managing Embedded Linux ‰ System Version Information ‰ System Image BackupUpgrading the firmware will erase all data on the Flash ROM System Image BackupSystem Version Information Upgrading the Firmware#upramdisk #cd /mnt/ramdisk Loading Factory Defaults Firmware version V1.5 and later versions Backing Up the User File SystemFirmware versions earlier than V1.5 not including Enabling and Disabling Daemons UC-7420/7410 User’s Manual Managing Embedded Linux Setting the Run-Level Setting the Time Manually Adjusting the System TimeUpdating the Time Automatically Example shell script to update the system time periodicallyNTP Client Enable cron when the system boots up Cron-daemon to Execute Scheduled CommandsChange mode of fixtime.sh Enable the cron daemon manuallyCF Mass Storage Connecting PeripheralsUSB Mass Storage ‰ Iptables ‰ NAT Managing CommunicationsDisabling the Telnet/ftp server Web Service-ApacheTelnet / FTP Enabling the Telnet/ftp serverUsr/www/cgi-bin Saving a Web Page to the CF Card Use the following commands to restart the Apache web server Iptables Local Host Packets Examples Observe and erase chain rulesDefine policy for chain rules UsageIptmac Append or delete rulesNAT Example Enabling NAT at BootupDial-up Service-PPP Example 2 Connecting to a PPP server over a hard-wired link UP Loopback Running How to check the connection#vi /etc/exports Setting up UC-7420/7410 as an NFS ServerSetting up a Machine for Incoming PPP Connections NFS Network File SystemSetting up UC-7420/7410 as an NFS Client Steps 2 MailOpen VPN Internet IFS=‘ Create link symbols to enable this script at boot time Destination Gateway Genmsk Flags Metric Use Iface Now ping Host B from Host a by typing Setup 3 Routed IP Destination Gateway Genmsk Flags Metric Use Iface Programmer’s Guide Linux Tool Chain Introduction Address Size ContentsFlash Memory Map Tools Available in the Host Environment Debugging with GDBObtaining help Cross Compiling Applications and LibrariesBuzzer Device APIRTC Real Time Clock WDT Watch Dog Timer Input Int fd File handle from swtdopen return value Output User application example Example Special NoteSwtddisableswtdfd Int mainint argc, char *argv Pidt sonpid Example to get the baud rate Example to set the baud rateExamples KeyPadBaud rate inaccuracy Special NoteMake File Example UC Finder Windows UC Finder Installing the SoftwareUC-7420/7410 User’s Manual UC Finder Broadcast Search Linux ucfinder Editor System CommandsBusybox V0.60.4 Linux normal command utility collection File managerMoxa special utilities ProcessOther Windows Tool Chain Introduction Introduction Select the Root Directory Installation ProcedureUC-7420/7410 User’s Manual Windows Tool Chain Introduction UC-7420/7410 User’s Manual Windows Tool Chain Introduction Using the Bash Shell UC-7420/7410 User’s Manual Windows Tool Chain Introduction GDB debug tool-InsightUC-7420/7410 User’s Manual Windows Tool Chain Introduction Service Information Following services are provided Moxa Internet ServicesMoxa Product † UC-7410-LX † UC-7420-LX Serial Number Problem Report FormProduct Return Procedure