Moxa IA240-T-LX [3/92] Table of contents
Table of Contents
Chapter 1 Introduction ..................................................................................................1-1
Overview.................................................................................................................................. 1-2
Software Architecture .............................................................................................................. 1-2
Journaling Flash File System (JFFS2)........................................................................ 1-3
Software Package ....................................................................................................... 1-4
Chapter 2 Getting Started .............................................................................................2-1
Powering on the IA240/241..................................................................................................... 2-2
Connecting the IA240/241 to a PC .......................................................................................... 2-2
Serial Console ............................................................................................................ 2-2
Telnet Console............................................................................................................ 2-3
SSH Console .............................................................................................................. 2-4
Configuring the Ethernet Interface .......................................................................................... 2-6
Modifying Network Settings with the Serial Console................................................ 2-6
Modifying Network Settings over the Network ......................................................... 2-7
Configuring the WLAN via the PCMCIA Interface ................................................................ 2-7
IEEE802.11g .............................................................................................................. 2-7
SD Socket and USB for Storage Expansion........................................................................... 2-12
Test Program—Developing Hello.c....................................................................................... 2-12
Installing the Tool Chain (Linux)............................................................................. 2-13
Checking the Flash Memory Space.......................................................................... 2-13
Compiling Hello.c .................................................................................................... 2-14
Uploading and Running the “Hello” Program.......................................................... 2-14
Developing Your First Application ........................................................................................ 2-15
Testing Environment................................................................................................ 2-15
Compiling tcps2.c..................................................................................................... 2-15
Uploading and Running the “tcps2-release” Program.............................................. 2-16
Testing Procedure Summary .................................................................................... 2-19
Chapter 3 Managing Embedded Linux ........................................................................3-1
System Version Information..................................................................................................... 3-2
System Image Backup.............................................................................................................. 3-2
Upgrading the Firmware............................................................................................. 3-2
Loading Factory Defaults........................................................................................... 3-4
Enabling and Disabling Daemons............................................................................................ 3-5
Setting the Run-Level.............................................................................................................. 3-6
Adjusting the System Time...................................................................................................... 3-7
Setting the Time Manually......................................................................................... 3-7
NTP Client.................................................................................................................. 3-8
Updating the Time Automatically.............................................................................. 3-8
Cron—Daemon to Execute Scheduled Commands ................................................................. 3-9
Chapter 4 Managing Communications ........................................................................4-1
Telnet / FTP ............................................................................................................................. 4-2
DNS ......................................................................................................................................... 4-2
Web Service—Apache............................................................................................................. 4-3
Install PHP for Apache Web Server ......................................................................................... 4-5
IPTABLES............................................................................................................................... 4-7
NAT........................................................................................................................................ 4-12
Содержание
- Fifth edition january 2010 1
- Ia240 241 linux user s manual 1
- Www moxa com product 1
- Copyright notice 2
- Disclaimer 2
- Ia240 241 linux user s manual 2
- Technical support contact information www moxa com support 2
- Trademarks 2
- Table of contents 3
- Chapter 1 introduction 5
- Introduction 5
- Overview 6
- Software architecture 6
- Journaling flash file system jffs2 7
- Software package 8
- Chapter 2 getting started 9
- Getting started 9
- Connecting the ia240 241 to a pc 10
- Powering on the ia240 241 10
- Serial console 10
- Telnet console 11
- Ssh console 12
- Windows users 12
- Linux users 13
- Configuring the ethernet interface 14
- Modifying network settings with the serial console 14
- Configuring the wlan via the pcmcia interface 15
- Ieee802 1g 15
- Modifying network settings over the network 15
- Sd socket and usb for storage expansion 20
- Test program developing hello c 20
- Checking the flash memory space 21
- Installing the tool chain linux 21
- Compiling hello c 22
- Uploading and running the hello program 22
- Compiling tcps2 c 23
- Developing your first application 23
- Testing environment 23
- 16 2 16 24
- From the pc type 24
- Ia240 241 linux user s manual getting started 24
- Next use the bin command to set the transfer mode to binary and the put command to initiate the file transfer 24
- Note if you get an error message at this point it could be because you neglected to put tcps2 c and tcpsp c in the same directory the example makefile we provide is set up to compile both tcps2 and tcpsp into the same project makefile alternatively you could modify the makefile to suit your particular requirements 24
- Tcps2 debug an arm platform gdb debug server execution file see chapter 5 for details about the gdb debug tool 24
- Tcps2 release an arm platform execution file created specifically to run on the ia240 241 24
- Two executable files tcps2 release and tcps2 debug are created 24
- Uploading and running the tcps2 release program 24
- Use the following commands to use ftp to upload tcps2 release to the ia240 241 24
- You will get the following response indicating that the example program was compiled successfully 24
- 17 2 17 25
- From the ia240 241 type 25
- Ia240 241 linux user s manual getting started 25
- 18 2 18 26
- Command for job number 1 to terminate this program 26
- Command to check if the tcps2 program is actually running in the background 26
- Ia240 241 linux user s manual getting started 26
- Kill 1 26
- Note use the 26
- The program should start running in the background use the 26
- Lan rx buffer 27
- Pc 2 pc 1 27
- Read serial data send data to pc2 serial rx buffer 27
- Rs 232 lan 27
- Tcps2 c 27
- Testing procedure summary 27
- Write data to pc1 receive lan data 27
- Chapter 3 managing embedded linux 28
- Managing embedded linux 28
- System image backup 29
- System version information 29
- Upgrading the firmware 29
- Command to list the size of each memory block and how much free space is available in each block 30
- Ia240 241 linux user s manual managing embedded linux 30
- 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 30
- The following instructions give the steps required to save the firmware file to the ia240 241 s ram disk and how to upgrade the firmware 30
- Type the following commands to enable the ram disk 30
- Type the following commands to use the ia240 241 s built in ftp client to transfer the firmware file ia240 x x x frm or ia241 x x x frm from the pc to the ia240 241 30
- Attention 31
- Ia240 241 linux user s manual managing embedded linux 31
- Loading factory defaults 31
- Next use the upfirm command to upgrade the kernel and root file system 31
- The upfirm utility will reboot your target after the upgrade is ok 31
- To load the the factory default settings you must press the reset to default button for more than 5 seconds all files in the home etc directories will be destroyed note that while pressing the reset to default button the ready led will blink once every second for the first 5 seconds the ready led will turn off after 5 seconds and the factory defaults will be loaded 31
- Enabling and disabling daemons 32
- Ia240 241 linux user s manual managing embedded linux 32
- Next use vi to open your application program we use the example program tcps2 release and put it to run in the background 32
- Snmpd snmp agent daemon telnetd telnet server client daemon inetd internet daemons ftpd ftp server client daemon sshd secure shell server daemon httpd apache www server daemon 32
- The following daemons are enabled when the ia240 241 boots up for the first time 32
- To run a private daemon you can edit the file rc local as follows 32
- Type the command ps ef to list all processes currently running 32
- And save to 33
- As an example 33
- Edit a shell script to execute 33
- Ia240 241 linux user s manual managing embedded linux 33
- In this section we outline the steps you should take to set the linux run level and execute requests use the following command to enable or disable settings 33
- Setting the run level 33
- Sxxrunfile stands for s start the run file while linux boots up xx a number between 00 99 smaller numbers have a higher priority runfile the file name 33
- The enabled daemons will be available after you reboot the system 33
- Adjusting the system time 34
- Setting the time manually 34
- Example shell script to update the system time periodically 35
- How to run the shell script automatically when the kernel boots up 35
- Ia240 241 linux user s manual managing embedded linux 35
- In this subsection we show how to use a shell script to update the time automatically 35
- Note before using the ntp client utility check your ip and dns settings to make sure that an internet connection is available refer to chapter 2 for instructions on how to configure the ethernet interface and see chapter 4 for dns setting information 35
- Ntp client 35
- Save the shell script using any file name e g 35
- The ia240 241 has a built in ntp network time protocol client that is used to initialize a time request to a remote ntp server us 35
- To update the system time 35
- Updating the time automatically 35
- Visit http www ntp org for more information about ntp and ntp server addresses 35
- Cron daemon to execute scheduled commands 36
- Chapter 4 managing communications 37
- Managing communications 37
- Telnet ftp 38
- Web service apache 39
- Ia240 241 linux user s manual managing communication 41
- Install php for apache web server 41
- Note the cgi function is enabled by default if you want to disable the function modify the file etc apache conf httpd conf when you develop your own cgi application make sure your cgi file is executable 41
- Step 1 check that you have enough free space 41
- Step 2 type upramdisk to get the free space ram disk to save the package 41
- This embedded computer supports the php option however since the php file is 3 mb it is not installed by default to install it yourself first make sure there is enough free space at least 3 mb on your embedded flash rom 41
- To check that the dev mtdblock3 free space is greater than 3 mb 41
- Ia240 241 linux user s manual managing communication 42
- Step 3 download the php package from the cd rom you can find the package in cd rom target php php tar gz 42
- Step 4 utar the package to do this type the command tar xvzf php tar gz 42
- Step 5 run install sh and select to install php 42
- Iptables 43
- Observe and erase chain rules 46
- Append or delete rules 47
- Define policy for chain rules 47
- Nat area private ip 48
- Nat example 48
- 13 4 13 49
- Dial up service ppp 49
- Enabling nat at bootup 49
- Ia240 241 linux user s manual managing communication 49
- In most real world situations you will want to use a simple shell script to enable nat when the ia240 241 boots up the following script is an example 49
- Modem ppp access is almost identical to connecting directly to a network through the ia240 241 s ethernet port since ppp is a peer to peer system the ia240 241 can also use ppp to link two networks or a local network to the internet to create a wide area network wan 49
- Note click on the following links for more information about ppp http tldp org howto ppp howto index html http axion physics ubc ca ppp linux html 49
- Ppp point to point protocol is used to run ip internet protocol and other network protocols over a serial link ppp can be used for direct serial connections using a null modem cable over a telnet link and links established using a modem over a telephone line 49
- The pppd daemon is used to connect to a ppp server from a linux system for detailed the pppd daemon is used to connect to a ppp server from a linux system for detailed information about pppd see the man page 49
- Example 1 connecting to a ppp server over a simple dial up connection 50
- Example 2 connecting to a ppp server over a hard wired link 51
- How to check the connection 51
- Setting up a machine for incoming ppp connections 52
- Nfs network file system 55
- Setting up the ia240 241 as an nfs client 55
- 20 4 20 56
- Ia240 241 linux user s manual managing communication 56
- The following simple example allows you to use an snmp browser on the host site to query the ia240 241 which is the snmp agent the ia240 241 will respond 56
- The ia240 241 has built in snmp v1 simple network management protocol agent software it supports rfc1317 rs 232 like group and rfc 1213 mib ii 56
- 21 4 21 57
- Ia240 241 linux user s manual managing communication 57
- 22 4 22 58
- Ia240 241 linux user s manual managing communication 58
- 23 4 23 59
- Ia240 241 linux user s manual managing communication 59
- 24 4 24 60
- Ia240 241 linux user s manual managing communication 60
- 25 4 25 61
- Ia240 241 linux user s manual managing communication 61
- 26 4 26 62
- Ia240 241 linux user s manual managing communication 62
- 27 4 27 63
- Ia240 241 linux user s manual managing communication 63
- Openvpn 64
- Setup 1 ethernet bridging for private networks on different subnets 64
- 29 4 29 65
- Generate a script file named openvpn bridge on each openvpn machine this script reconfigures interface eth1 as ip less creates logical bridge s and tap interfaces loads modules enables ip forwarding etc 65
- Ia240 241 linux user s manual managing communication 65
- 30 4 30 66
- Ia240 241 linux user s manual managing communication 66
- 31 4 31 67
- Create a configuration file named a tap0 br conf and an executable script file named a tap0 br sh on openvpn a 67
- Create a configuration file named b tap0 br conf and an executable script file named b tap0 br sh on openvpn b 67
- Create link symbols to enable this script at boot time 67
- Ia240 241 linux user s manual managing communication 67
- Note select cipher and authentication algorithms by specifying cipher and auth to see 67
- 33 4 33 69
- Ia240 241 linux user s manual managing communication 69
- Set up four machines as shown in the following diagram 69
- Setup 2 ethernet bridging for private networks on the same subnet 69
- Setup 3 routed ip 69
- The configuration procedure is almost the same as for the previous example the only difference is that you will need to comment out the parameter up in etc openvpn a tap0 br conf and etc openvpn b tap0 br conf 69
- Chapter 5 development tool chains 71
- Development tool chains 71
- Compilation for applications 72
- Linux tool chain 72
- Steps for installing the linux tool chain 72
- On line debugging with gdb 73
- On line debugging with insight 74
- Chapter 6 programmer s guide 75
- Programmer s guide 75
- Buzzer 76
- Device api 76
- Flash memory map 76
- Rtc real time clock 76
- Wdt watch dog timer 77
- Close the file handle 79
- Example 1 79
- Example 2 79
- Ia240 241 linux user s manual programmer s guide 79
- Input int fd the file handle from swtd_open return value 79
- Output ok will be zero 79
- Special note 79
- The makefile is shown below 79
- The other has some error to get error code from errno 79
- User application example 79
- When you kill the application with 9 or kill without option or ctrl c the kernel will change to auto ack the swatchdog 79
- When your application enables the swatchdog and does not ack your application may have a logical error or your application has made a core dump the kernel will not change to auto ack this can cause a serious problem causing your system to reboot again and again 79
- Ia240 241 linux user s manual programmer s guide 80
- The makefile is shown below 80
- Example to get the baudrate 81
- Example to set the baudrate 81
- Baudrate inaccuracy 82
- Special note 82
- Digital input signal 83
- Din_event_high_to_low 83
- Duration 83
- 10 6 10 84
- Description the program indicates to connect do1 to di1 change the digital output state to high or low by manual input then the detect and count the state changed events from di1 ok 84
- Don t forget to link the library libmoxalib libpthread for di do programming and also include the header file moxadevice h the di do library only can be used by one program at a time 84
- Example 84
- Example 1 84
- File name tdio c 84
- Ia240 241 linux user s manual programmer s guide 84
- Special note 84
- 11 6 11 85
- Ia240 241 linux user s manual programmer s guide 85
- 12 6 12 86
- Description the program indicates to connect do1 to di1 and program will change digital output state automatically at the fixed frequency then detect event change of the digital input state is high or low in different duration ok 86
- Example 2 86
- File name tduration c 86
- Ia240 241 linux user s manual programmer s guide 86
- 13 6 13 87
- Ia240 241 linux user s manual programmer s guide 87
- 14 6 14 88
- Dio program make file example 88
- Ia240 241 linux user s manual programmer s guide 88
- 15 6 15 89
- Ia240 241 linux user s manual programmer s guide 89
- Make file example 89
- The following makefile file example codes are copied from the hello example on the ia240 241 s cd rom 89
- Chapter 7 software lock 90
- Software lock 90
- Appendix a system commands 91
- Editor 91
- File manager 91
- Linux normal command utility collection 91
- Network 91
- System commands 91
- Moxa special utilities 92
- Process 92
Похожие устройства
- Moxa IA240-T-LX Руководство по аппаратной части
- Moxa IA240-T-LX Технические характеристики
- Moxa IA240-T-LX Руководство по быстрой установке
- Moxa IA240-T-LX Руководство по работе с утилитой Moxa Device Manager
- Moxa IA260-CE Инструкция по эксплуатации
- Moxa IA260-CE Руководство по аппаратной части
- Moxa IA260-CE Руководство по быстрой установке
- Moxa IA260-CE Технические характеристики
- Moxa IA260-CE Руководство по работе с утилитой Moxa Device Manager
- Moxa IA260-T-CE Инструкция по эксплуатации
- Moxa IA260-T-CE Руководство по аппаратной части
- Moxa IA260-T-CE Технические характеристики
- Moxa IA260-T-CE Руководство по быстрой установке
- Moxa IA260-T-CE Руководство по работе с утилитой Moxa Device Manager
- Moxa IA260-LX Инструкция по эксплуатации
- Moxa IA260-LX Руководство по аппаратной части
- Moxa IA260-LX Технические характеристики
- Moxa IA260-LX Руководство по быстрой установке
- Moxa IA260-LX Руководство по работе с утилитой Moxa Device Manager
- Moxa IA260-T-LX Инструкция по эксплуатации