Table of Contents Chapter 1 Introduction ....................1-1 Overview..........................1-2 W406 Software ........................1-2 Application Development Environment ............... 1-2 Networking and Communications Capabilities ............1-3 Supported Servers and Daemons .................. 1-3 Obtaining the Firmware Build Version ..................1-4 Memory and File Systems ....................... 1-4 RAM File System ......................
Page 4
Process (Thread) Monitoring/Control..................3-4 Launching Processes Automatically ..................3-4 Monitoring and Controlling Services..................3-5 Binary/Text File Management ....................3-6 Appendix A Firmware Upgrade Procedure..............A-1 A. Configure HyperTerminal for the Console Port............A-2 B. Download and Install the TFTP program..............A-7 C.
Introduction Chapter 1 The W406 embedded computer has two RS-232/422/485 serial ports, one 10/100 Mbps Ethernet port, an embedded GSM/GPRS/EDGE module, an SD socket interface for storage expansion, one USB 2.0 host port, four digital input channels, and four digital output channels. This combination of features makes the W406 ideal for your wireless embedded applications.
C Libraries and Run-times—Compared to the C libraries and run-times used on a desktop PC running Windows®, the C libraries and run-times on a W406 WinCE are a subset of the WIN32 APIs. The system supports a full ANSI C run-time, standard input/output library, standard input/output ASCII library, and standard ASCII string functions.
W406-CE User’s Manual Introduction Networking and Communications Capabilities Simple Network Management Protocol (SNMP)—Monitors remote connections to the network. Simple Network Time Protocol (SNTP) Client—Provides support for synchronizing the device’s system time with an SNTP server, and supports Daylight Savings Time. Serial Communications—In addition to the 16550 UART driver bound to a debug port and the console port, a special driver for 2 additional Moxa serial ports is also included.
W406-CE User’s Manual Introduction Obtaining the Firmware Build Version There are two ways to obtain the firmware version of W406 embedded computers. This information is particularly important for identifying the features supported by the computer. Examine the welcome message after you log on to the computer. Log on to the web-based management system (described in a later chapter) to view the system information.
W406-CE User’s Manual Introduction An SD card has its own life cycle. Since most SD cards are made from a NAND Flash, their hardware controllers implement BBM. This feature allows FAT to skip bad blocks if they exist. Furthermore, the memory space of an SD card is much larger than that of the NOR Flash. Using this space cautiously will ensure that its life cycle is not exceeded.
W406-CE User’s Manual Introduction Inserting an SD Card into the Computer The W406 is equipped with an SD slot. When an empty SD card is inserted into the slot, the computer automatically formats it in the FAT file system. This process takes a few minutes to complete.
W406-CE User’s Manual Introduction RS-232/422/485 Serial Ports The W406-CE embedded computer contains two software-selectable RS-232/422/48 serial ports for reliable and stable serial communication. They both support non-standard baudrate settings of up to 921,600 bps. To configure the interface of the serial ports, simply use the setinterface command in telnet or console mode.
Getting Started Chapter 2 In this chapter, we explain how to use a PC to operate a W406 embedded computer. We will refer to the PC that connects to the W406 as the development workstation, and the W406 embedded as the target computer.
W406-CE User’s Manual Getting Started Starting Your W406 Computer Connect the SG wire to the shielded contact located in the upper left corner of the W406 computer, and then power it up by connecting it to the power adaptor. It takes about 30 to 60 seconds for the system to boot up.
W406-CE User’s Manual Getting Started Step 6: Type “2” for “Format User Disk”, and then press Enter. Step 7: After a few seconds, you will see the bootloader menu again. Unplug the power line and then plug it back again. It takes about 3 minutes to reset the operating system. Boot Loader For addressing OS stability issues, we provide an easy and useful function with Boot Loader for the following tasks:...
W406-CE User’s Manual Getting Started Changing the Network Settings The W406 computer has one network interface. There is no default IP address; the default network setting is configured as DHCP. If you have a DHCP server, simply connect the W406 to your network using an Ethernet cable.
W406-CE User’s Manual Getting Started After logging in, enter the netshare -h command to learn how to configure shared folders. For example, netshare -s docs “\My Documents” -a admin will share the “My Documents” folder as “docs” for the user “admin”. Connecting to a GPRS/EDGE Network Before connecting to a GPRS/EDGE network, make sure the SIM card is properly installed and the antenna is connected.
Page 17
W406-CE User’s Manual Getting Started When the GPRS/EDGE has successfully connected, you can use gprs_connection_status.exe to check the GPRS/EDGE connection status or use ipconfig.exe to verify the Network Status. 2. To create a permanent GPRS/EDGE connection: If the connection fails, use the gprs_reconnect.exe command to re-connect to the GPRS network again.
W406-CE User’s Manual Getting Started Disconnecting from a GPRS/EDGE Network To disconnect from the GPRS network, type />gprs_disconnect After a few seconds, the embedded computer will disconnect from the GPRS/EDGE network. A notification message will NOT be shown. GPRS/EDGE Connection Error Detection To detect connection problems, gprs_diagnose.exe allows users to diagnose connection problems during the network connection process.
W406-CE User’s Manual Getting Started SIM Card Utilities The W406 provides some utilities for manipulating the PIN code. NOTE: Make sure your PIN code is correct. After three failed attempts at entering the PIN code, the SIM card will be locked and the PUK code will be required to unlock the SIM card. After ten failed attempts at entering the PUK code, the SIM card will be invalidated and no longer usable.
W406-CE User’s Manual Getting Started 4. To change the PIN code of the SIM card. /> sim_change_pin 5. To unlock the SIM card, if your SIM card status is Need PUK code. /> sim_unlock Sending, Reading, and Deleting SMS Messages 1.
W406-CE User’s Manual Getting Started 3. To delete an SMS message />sms_remove_msg Troubleshooting the GPRS/EDGE Connection When encountering GPRS/EDGE connection problems, use the following commands: 1. gprs_diagnose In the case above, the problem is Need PIN Code. Simply use the sim_input_pin command to input the PIN code.
Page 22
W406-CE User’s Manual Getting Started 2. setregapn The setregapn.exe is an APN configuration tool. You can change the ISP and APN mapping. For more information, please type “setregapn –h”. 3. gprs_connect -d This command allows users to check the ISP provider and the APN. In the case above, users may know the name of the ISP is Chunghwa Teleco and the default APN is Internet.
W406-CE User’s Manual Getting Started Operating Your W406 Computer through a Telnet Client Use a cross-over Ethernet cable to connect directly from your development workstation to the W406 computer, or use a straight-through Ethernet cable to connect the computer to a LAN hub or switch.
W406-CE User’s Manual Getting Started user xxxx has been added to group yyyy Deleting a User: Use the command userdel <userID> to delete a user from the system. User “admin” CANNOT be deleted. \> userdel xxxx user xxxx has been deleted You can also just remove a user from a user group by using the command userdel –g <groupName>...
W406-CE User’s Manual Getting Started Starting and Stopping Services After booting up, the W406 computer runs several services continuously to serve requests from users or other programs. Some important services are telnet (“TEL0:”), console (“CON0:”), world wide web HTTP (“HTP0:”), and file transfer FTP (“FTP0:”). If you rarely use these services, you can still start up or stop a service with its associated name by using the services command.
W406-CE User’s Manual Getting Started The route utility allows you to view or modify network routing tables. Type this command without parameters to view a list of functions. \> route To view current routing items in the tables, type \> route PRINT To add a routing item on network interface 1, type \>...
Web-based Management System Chapter 3 Note: You must use Internet Explorer 5.5 or above to access the web-based management system. W406-CE ready-to-run embedded computers are network-centric platforms designed to be used as front-end computers for data acquisition and industrial control. Due to the distributed characteristics of the devices that these computers control, they often reside in harsh environments away from the system administrator.
W406-CE User’s Manual Web-based Management System Logging into the Web-based Management System The web-based management system installed in the W406 computer incorporates often-used features into CGI pages, and categorizes them on a menu bar. Before attempting to connect to the management system, make sure the network connection from your PC to the target computer active, and you are able to use the PC’s Internet browser.
W406-CE User’s Manual Web-based Management System Networking/Server Configuration The W406 computer has two network interfaces. To view or change the settings, click the Networking item on the menu bar. After the page loads, enter the relevant details in the corresponding text fields and then click Update to activate the changes. Serial Port Configuration The W406 computer has two high-performance serial ports, each of which supports RS-232, RS-422, and RS-485.
W406-CE User’s Manual Web-based Management System Process (Thread) Monitoring/Control At runtime, the W406 computer manages up to 32 applications. You can use the management system to monitor and control them. To view current processes, click the Processes item on the main menu bar.
W406-CE User’s Manual Web-based Management System Monitoring and Controlling Services Some services, such as ftp and telnet daemons, run in the background to provide services for user requests. To monitor and control these services, do the following: Step 1: Click the Services item on the main menu bar. The running services are displayed. Step 2: Click the relevant check box to toggle a start/stop operation for the desired service.
W406-CE User’s Manual Web-based Management System Binary/Text File Management PC users enjoy the convenience of using Windows’ friendly windows-based file manager to browse, delete, and organize files and directories. Moxa’s web-based management system provides the same kind of convenience for managing files on the target computer. Click File Manager to view the directory tree of your target computer.
Firmware Upgrade Procedure Appendix A Moxa provides a boot loader utility for firmware upgrade or recovery. You will need the following items to use this utility. 1. The embedded computer that you would like to upgrade or recover. 2. A PC or a laptop computer. 3.
W406-CE User’s Manual Firmware Upgrade Procedure A. Configure HyperTerminal for the Console Port. 1. Connect the console port with a console port cable to your P C. The console port is located on the bottom panel. 2. Connect your embedded computer to the power source. The power input is located on the top panel.
Page 35
W406-CE User’s Manual Firmware Upgrade Procedure aunch a serial communication tool to access your embedded computer. We suggest that you use HyperTerminal, which is built into Windows XP. Navigate to Start Programs Accessories Communications and then select HyperTerminal. . After HyperTerminal launches, choose a name for the connection, such as “W406.”...
Page 36
W406-CE User’s Manual Firmware Upgrade Procedure lick Cancel when the “Connect To” window opens. elect File Properties from the main HyperTerminal screen.
Page 37
W406-CE User’s Manual Firmware Upgrade Procedure . You can change the COM port number in the Properties window. Click Configure for additional configuration options. 8. Configure the Port Settings with following parameters: Bits per second: 115200 Data bits: 8 Parity: None Stop bit: 1 Flow contro l: None.
Page 38
W406-CE User’s Manual Firmware Upgrade Procedure 9. Click the Settings tab and then select VT100 (for Emulation). Click OK to complete the configuration.
W406-CE User’s Manual Firmware Upgrade Procedure B. Download and Install the TFTP program. 1. You will need to download a free TFTP server pac kage to upgrade the firmware for the boot loader utility. The utility can be found at the follow ing URL: ftp://papa.indstate.edu/ The TFTP program is locate...
W406-CE User’s Manual Firmware Upgrade Procedure C. Download and Upgrade the Firmware through HyperTerminal. 1. Connect to Moxa’s website at http://www.moxa.com, and then select Software fro m the Support drop-down menu. . Under Search for Software, select the product line and then choose the specific product model. Click on Search to continue.
Page 41
W406-CE User’s Manual Firmware Upgrade Procedure 3. In the software list, select the firmware for your model. Choose the appropriate OS and then click the download icon to start downloading the new firmware. Note: Check the filename, it may differ from the filename shown below.
Page 42
W406-CE User’s Manual Firmware Upgrade Procedure ut the latest firmware image in the same directory as the TFTP files. 5. Next, connect the LAN Port of the embedded computer to your PC using a cross-over Ethernet cable. The LAN1 port is located on the rear panel of the embedded computer. A-10...
Page 43
W406-CE User’s Manual Firmware Upgrade Procedure . Press and hold down the DEL key on your PC and power on the embedded computer at the same time. You will be guided to the boot loader utility menu, as show below. .
Page 44
W406-CE User’s Manual Firmware Upgrade Procedure ou will need to enter the IP address of the embedded computer and your PC. Follow the steps below to configure the IP addresses. From Start Settings, select Netw ork Connections. Right-click on Local Area Connection, and then select Properties. A-12...
Page 45
W406-CE User’s Manual Firmware Upgrade Procedure Click the General tab and select Internet Protocol (TCP/IP), and then click on Properties. A-13...
Page 46
W406-CE User’s Manual Firmware Upgrade Procedure Next, select Use the following IP address and enter the IP address and Subnet mask. For exam ple: IP address: 19 2.168.1.1 (This IP address is only an example; you may assign any IP address of your choice as long as it’s on the same LAN as your PC.) Subnet mask: 255.255.255.0 A-14...
Page 47
W406-CE User’s Manual Firmware Upgrade Procedure 3. Go back to the boot load utility menu and assign the local IP address, and then enter the server IP address. The local IP address is the IP address of the embedded computer. Note that the local IP address must be on the same LAN as the server IP address.
Page 48
W406-CE User’s Manual Firmware Upgrade Procedure . Press the ESC key to exit the IP setting option. If you encounter a system crash, or have problem booting up the system, we suggest you select (2) Format User Disk to solve the problem.
Page 49
W406-CE User’s Manual Firmware Upgrade Procedure 7. To start the TFPF server, double-click on the tftpd32 icon to launch the TFTP server. 8. When the TFTP server has been launched, the following screen will appear. A-17...
Page 50
W406-CE User’s Manual Firmware Upgrade Procedure 9. Go back to the boot loader utility menu and enter the file name of the firmware image. he firmware upgrade will then start to run. A-18...
Page 51
W406-CE User’s Manual Firmware Upgrade Procedure 11. It will take several minutes for the firmware files to be written to your embedded computer. Do not power off your computer! hen you return to command line mode, the firmware upgrade has completed. At this point, ou may reboot the embedded computer to complete the firmware upgrade or recover from the oot loader utility.
Page 52
W406-CE User’s Manual Firmware Upgrade Procedure 13. If you cannot reboot your embedded computer even after following all the steps above, contact Moxa’s technical support staff for further assistance. A-20...
Application Development Appendix B The mxdev library for C++ and the mxdevice library for VB.net and C# are provided to help users develop their application on the W406 quickly and easily. The complete source code can be found in the sample directory on the software CD. Developing an application with VS2005 Open Microsoft®...
W406-CE User’s Manual Application Development Visual C++ Library After the SDK is installed on your development PC, the library will be available in your Visual Studio 2005/2008 environment. GPRS/SIM/SMS The definition header file includes the entire library API; you can find it in the SDK installation path “C:\Program Files\Windows CE Tools\wce600\W406-CE\Include\Armv4i\moxa”.
Page 55
W406-CE User’s Manual Application Development Gets the signal strength of the GPRS modem. int cellular_modem_gprs_get_signal_strength(unsigned int fd); Inputs: <fd> the cellular modem Outpus: <recv> point to buffer that stores the reply Return Values: 1 to 99 on success, otherwise the function fails Remark: It is suggested to call this function periodically.
Page 56
W406-CE User’s Manual Application Development Diagnoses the status of a GPRS connection and the status of the SIM card. unsigned int cellular_modem_gprs_diagnose_status(unsigned int fd); Inputs: <fd> the cellular modem Return Values: 0 indictes no error. otherwise, a 32-bit number indicating a combination of errors Remark: define GPRS errors, of which each stands on one of a 32-bit number #define GPRS_ERROR_BAUDRATE_COM3...
Page 57
W406-CE User’s Manual Application Development Sends a SMS message to a specific phone number. int cellular_modem_sms_send_message(unsigned int fd, unsigned int msg_mode, SMSMSG *psms); Inputs: <fd> the cellular modem <msg_mode> 0: message in text, 1: message in PDU <psms> point to the message Return Values: 0 on success, otherwise, the function fails Remark:...
Page 58
W406-CE User’s Manual Application Development Deletes an indexed SMS message. int cellular_modem_sms_delete_message(unsigned int fd, int index); Inputs: <fd> the cellular modem <index> the index to the message pool Return Values: 0 on success, otherwise, the function fails Remark: Gets the SIM card status. int cellular_modem_sim_get_sim_card_status(unsigned int fd);...
Page 59
W406-CE User’s Manual Application Development When the SIM card status is PUK (3), this function changes the status to PIN (2). If this fails, the SIM card will be locked. int cellular_modem_sim_unlock_pin_code(unsigned int fd, char *passwd, char *new_pin_code); Inputs: <fd> the cellular modem <passwd>...
Page 60
W406-CE User’s Manual Application Development Get the modem module temperature. int cellular_modem_gprs_get_module_temperature(unsigned int fd) Inputs: <fd> the cellular modem Return Values: the tempture of GPRS module Remark: UART Gets the UART interface. DWORD uart_getmode(int port); Inputs: <port> the serial port number. Return Values: 0 : RS-232 1 : RS485-2W...
Page 61
W406-CE User’s Manual Application Development Closes the DIO handle. void mxdio_stop(HANDLE hDIO); Inputs: <hDIO> the DIO handle Return Values: None Remark: Sets one of the DOUT outputs. int mxdio_set_dout(HANDLE hDIO, unsigned int port, unsigned int data); Inputs: <hDIO> the DIO handle <port>...
Page 62
W406-CE User’s Manual Application Development Watchdog Opens a watchdog handle for later use. HANDLE watchdog_init(DWORD dwRefreshPeriod); Inputs: <dwRefreshPeriod> the watchdog refresh time interval in milliseconds.. Return Values: the watchdog handle, INVALID_HANDLE_VALUE indicates failure. Remark: After calling the watchdog_init(), you must call watchdog_refresh() in the specified time(dwRefreshPeriod) or the system will be triggered rebooting.
W406-CE User’s Manual Application Development Visual C++ Examples The C++ examples are available on the software CD for your reference. Net Compact Framework Library For .Net programming, MOXA also provides a .Net Compact Framework library. GPRS/SIM/SMS The definition header file includes the entire library APIs, you can find it in the Software Opens a cellular modem.
Page 64
W406-CE User’s Manual Application Development Gets the signal strength of the GPRS modem, Class Name: GPRS Method: int GetSignalStrength() Inputs: none Return Values: 1 to 99 on success, otherwise the function fails Remark: It is suggested to call this function periodically. Establishes a GPRS connection to the ISP service provider.
Page 65
W406-CE User’s Manual Application Development Diagnoses the status of a GPRS connection and the status of the SIM card. Class Name: GPRS Method: int Diagnose() Inputs: none Return Values: 0 indictes no error. otherwise, a 32-bit number indicating a combination of errors Remark: define GPRS errors, of which each stands on one of a 32-bit number const GPRS_ERROR_BAUDRATE_COM3...
Page 66
W406-CE User’s Manual Application Development Sets the SMS storage base. Class Name: GPRS Method: int SetSMSStorageBase(StorageBase mode) Inputs: <mode> Storage base number in “StorageBase” type. Return Values: 0 on success, otherwise the function fails Remark: public enum StorageBase SIMCard = 0, CellularModule, Both Sends an SMS message to a specific phone number.
Page 67
W406-CE User’s Manual Application Development Receives an indexed SMS message. Class Name: GPRS Method: int RecvSMS(int index, uint msg_mode, ref SMSMSG pmsg) Inputs: <index> the index to the message pool <msg_mode> 0: message in text, 1: message in PDU <psms> point to the message Return Values: 0 on success, otherwise, the function fails Remark:...
Page 68
W406-CE User’s Manual Application Development Gets the status of the SIM card. Class Name: GPRS Method: SIMCardState GetSIMCardStatus(); Inputs: none Return Values: 0 : ready, okay to use 1 : no sim card, (or loose) 2 : PIN, wait for the pin code for authentication 3 : PUK, three times of wrong pin codes otherwise, the function fails Remark:...
Page 69
W406-CE User’s Manual Application Development When the SIM card status is set to NeedPINCode (2), this function authenticates a PIN code. Then the status will be set back to ready (0). Class Name: GPRS Method: int InputPINCode(string pin_code); Inputs: <pin_code> the PIN code string Return Values: 0 on success, otherwise, the function fails Remark:...
Page 70
W406-CE User’s Manual Application Development When the SIM card status is ready (0) and the PIN code is enabled, this function assigns a PIN code to the SIM card. Class Name: GPRS Method: int ChangePINCode(string old_pin_code, string new_pin_code); Inputs: <old_pin_code> the old PIN code string <new_pin_code>...
Page 71
W406-CE User’s Manual Application Development Sets one of the DOUT outputs. Class Name: DigitalOutput Method: bool Set(int port, int data); Inputs: <port> the port index, from 0 to 3 mapping to DO0~DO3 <data> 1 : HIGH, 0 : LOW Return Values: true on success, false, the function fails Remark: Get one of the DIN inputs.
Page 72
W406-CE User’s Manual Application Development Watchdog refresh function call. Class Name: Watchdog Method: bool refresh(); Inputs: none Return Values: true indicates the watchdog refresh succeed, false indicates refresh failure. Remark: Closes the watchdog handle. Class Name: Watchdog Method: bool close(); Inputs: None Return Values:...
W406-CE User’s Manual Application Development Visual C# Examples A device .Net CF 2.0 class library (mxdevice.dll) is provided to simplify application development with Visual Studio 2005 tools. This library covers the .Net CF Class Library for the buzzer and digital I/O devices. To link the library with your Visual Studio 2005 project environment, perform the following steps from your Visual Studio 2005 tool: 1.
Need help?
Do you have a question about the W406 WinCE and is the answer not in the manual?
Questions and answers