Moxa Technologies UC-7420/7410 user manual #upramdisk #cd /mnt/ramdisk

Page 43

UC-7420/7410 User’s Manual

Managing Embedded Linux

Since different Flash disks have different sizes, it’s a good idea to check the size of your Flash disk before upgrading the firmware, or before using the disk to store your application and data files. Use the #df –hcommand to list the size of each memory block, and how much free space is available in each block.

192.168.3.127 – PuTTY

root@Moxa:~# df -h

 

Used Available Use% Mounted on

Filesystem

Size

 

/dev/mtdblock3

26.0M

 

8.9M

17.1M

34%

/

/dev/mtdblock3

26.0M

 

8.9M

17.1M

34%

/

/dev/ram2

2.0M

40.0k

1.8M

 

2%

/var

tmpfs

62.1M

0

62.1M

0%

/dev/shm

root@Moxa:~# upramdisk

 

 

 

 

 

 

 

root@Moxa:~# df -h

 

Used Available Use% Mounted on

Filesystem

Size

 

/dev/mtdblock3

26.0M

 

8.9M

17.1M

34%

/

/dev/mtdblock3

26.0M

 

8.9M

17.1M

34%

/

/dev/ram2

2.0M

40.0k

1.8M

 

2%

/var

tmpfs

62.1M

0

62.1M

0%

/dev/shm

/dev/ram1

29.0M 13.0k 27.5M

0%

/mnt/ramdisk

root@Moxa:~# cd /mnt/ramdisk root@Moxa:/mnt/ramdisk#

The following instructions give the steps required to save the firmware file to UC-7420/7410’s RAM disk, and then upgrade the firmware.

1.Type the following commands to enable the RAM disk:

#upramdisk

#cd /mnt/ramdisk

2.Type the following commands to use UC-7420/7410’s built-in FTP client to transfer the firmware file (uc7400-x.x.x.frm) from the PC to UC-7420/7410:

/mnt/ramdisk> ftp <destination PC’s IP> Login Name: xxxx

Login Password: xxxx ftp> bin

ftp> get uc7400-x.x.x.frm

192.168.3.127 – PuTTY

root@Moxa:/mnt/ramdisk# ftp 192.168.3.193 Connected to 192.168.3.193 (192.168.3.193).

220 TYPSoft FTP Server 1.10 ready… Name (192.168.3.193:root): root 331 Password required for root. Password:

230 User root logged in. Remote system type is UNIX.

Using binary mode to transfer files. ftp> cd newsw

250 CWD command successful. “/C:/ftproot/newsw/” is current directory. ftp> bin

200 Type set to I. ftp> ls

200 Port command successful.

150 Opening data connection for directory list.

drw-rw-rw-

1

ftp

ftp

0

Nov

30

10:03 .

drw-rw-rw-

1

ftp

ftp

0

Nov

30

10:03 .

-rw-rw-rw-

1

ftp

ftp

13167772 Nov 29 10:24 UC7420-1.5.frm

-rw-rw-rw-

1

ftp

ftp

8778996 Nov 29 10:24 UC7420_usrdisk-1.5.frm

 

 

 

 

3-3

 

 

 

Image 43
Contents Third Edition, June UC-7420/7410 User’s ManualTrademarks Copyright NoticeDisclaimer Table of Contents Chapter UC Finder Appendix B Windows Tool Chain Introduction ‰ Hardware Introduction IntroductionUC-7410-LX Package ChecklistProduct Features OverviewProduct Hardware Specifications Hardware Introduction Appearance and DimensionsAppearance Dimensions LED Indicators Hardware Block DiagramLED Name Color Meaning Real Time Clock Reset-type ButtonsReset Button Reset to default ButtonWall or Cabinet Placement OptionsHardware Connection Description Wiring RequirementsDIN-Rail Mounting 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 InterfaceConnecting UC-7420/7410 to a PC Powering on UC-7420/7410Serial Console 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.cDeveloping Your First Application Testing EnvironmentUploading Hello to UC-7420/7410 and Running the Program #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 versions earlier than V1.5 not including Backing Up the User File SystemFirmware version V1.5 and later versions Enabling and Disabling Daemons UC-7420/7410 User’s Manual Managing Embedded Linux Setting the Run-Level Setting the Time Manually Adjusting the System TimeNTP Client Example shell script to update the system time periodicallyUpdating the Time Automatically Enable cron when the system boots up Cron-daemon to Execute Scheduled CommandsChange mode of fixtime.sh Enable the cron daemon manuallyUSB Mass Storage Connecting PeripheralsCF 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 Flash Memory Map Address Size ContentsLinux Tool Chain Introduction Tools Available in the Host Environment Debugging with GDBObtaining help Cross Compiling Applications and LibrariesRTC Real Time Clock Device APIBuzzer 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 managerOther ProcessMoxa special utilities 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