How to make Linux and Windows CE work together

Source: Internet
Author: User
Tags ftp client

Background

Linux is a UNIX-like operating system. It originated from a hobby called Linus Torvalds in Finland, but is now the most popular free operating system. Ordinary users work on Linux, browse websites, send emails, and play games. Many universities and research institutions also use Linux to complete daily computing tasks. In the commercial field, many companies have built their own servers on the basis of Linux because of low price, high security and stability of Linux systems. According to IDC statistics, about 1/3 of the world's website servers use Linux as the operating system.

Windows CE, according to Microsoft's definition in Windows CE and Pocket PC: FAQ, is a series of components used by operating system developers to build a proprietary operating system. OEMs can purchase an integrated development environment called "Windows CE platform development system" from Microsoft and use this system to assemble and compile Windows CE-based operating systems, the operating system includes a series of Windows CE-based components and applications or device drivers developed by developers. Windows CE-based operating systems have similar user interfaces as Microsoft Windows operating systems, so they are favored by many end users and developers. At present, Windows CE has been widely used in mobile phones, palm computers, personal digital assistants, quick translation, electronic dictionaries, and other portable devices.

For a long time, users of Windows CE devices also need a host based on Windows 9x/2000/NT to exchange data with Windows CE devices. Run the Windows CE Service software provided by Microsoft on the host, which establishes a point-to-point connection with the Windows CE device through a RS-232 cable, users can access the Windows CE device through the service software, but other computers in the LAN cannot access the Windows CE device. If you want other computers in the LAN to access the device, you need to install expensive dedicated NICs and related access devices for the device. This is a very economic solution.

This article uses the PPP server that comes with the Red Hat Linux 7.2 operating system to establish a TCP/IP connection with the Windows CE device, then, run an FTP server on the Windows CE device so that the Linux host can access resources on the Windows CE device. This method is a cost-effective solution because it is based on the RS-232 data cable that comes with Windows CE device and does not need to purchase any additional device. In addition, the solution described in this article is also applicable to Windows 9x/2000/NT hosts.

Connect Linux to Windows CE

Point-to-Point Protocol (PPP) is a Protocol for transmitting IP data packets through a serial port. Using the PPP protocol, a computer can log on to a remote host through a serial line, telephone line, and other communication devices and use the resources of the host or the network where the host is located. In point-to-point communication, two parts are included: the server and the client. The client requests a network connection from the server, and the server receives client requests to establish a network connection and allocate the network resources to the client. After the network connection is established, the server and the client are strictly equal. Linux usually has PPP servers and client programs, while Windows CE usually only has PPP client programs. Therefore, we use Linux Hosts as PPP servers, the Windows CE device acts as the PPP client.

To use a Linux host as a PPP server, we must first check whether the PPP server program pppd has been installed on the host. This program is usually installed in the/usr/sbin directory. We can use the following command to check whether the file exists in this directory:

Ls/usr/sbin/pppd

The recently officially released Linux operating systems (such as Red Hat Linux 6.x/ 7.x) usually have pre-installed PPP server programs. If the PPP server has not been installed on the Linux host, we should first download and install a PPP server program, such as pppd2.3.4. The installation of this package may also require support from other packages. As the installation of the application program is beyond the scope of this article, please refer to other related materials for interested readers.

After confirming that the PPP server has been installed on a Linux host, we need to make some necessary configurations for the Linux host. To perform these configurations, we need to have the root permission.

Create a file/etc/ppp/peers/wince with the following content:

       /dev/ttyS0 115200 crtscts

connect '/usr/sbin/chat -v -f /etc/ppp/wince.chat'

noauth

local

90.0.0.1:90.0.0.2

Create a file/etc/ppp/wince. chat with the following content:

       TIMEOUT 3600

"CLIENT" "CLIENT\c"

"" "SERVER\c"

In the preceding two configuration files, using wince as the file name only indicates that this configuration file is used for a Windows CE device. You can also choose another file name, such as palm or handheld, but ensure that the two file names are consistent.

The configuration file/etc/ppp/peers/wince specifies that the serial port ttyS0 is used to establish a connection with the customer device at a rate of 115,200 bps. The noauth parameter indicates that no authentication is required when the client requests a connection. In this peering connection, the IP address of the server (Linux host) is 90.0.0.1, and that of the client (Windows Ce device) is 90.0.0.2. The TIMEOUT parameter in the configuration file/etc/ppp/wince. chat specifies the server wait time. If the server still does not receive the client connection request after this time, terminate the current server program. If you need to learn more about the configurations, refer to the relevant documents of chat and pppd.

Configurations required on Windows CE devices are relatively simple. Because the default automatic connection function of Windows CE occupies the serial port of the device, we need to stop using this function first. Choose "Settings"> "communication"> "PC connection" from the Start menu and disable the connection to the PC. Then, create a new connection, select "program-> communication-> Connection Manager" from the Start menu, and click the "Create connection" icon, name the new connection as Linux and specify the connection type as "linear connection". In the next step, specify COM1 for connection and set the communication rate to 115,200, in TCP/IP Settings, specify the IP address of the device as 90.0.0.2. After you click OK to save the disk, the connection will appear in the "program-> communication" menu.

Run the following command to start the PPP server on a Linux host:

Pppd call wince

After you start a new connection (program> communication> Linux) on a Windows CE device, the network connection diagram is displayed on the taskbar of the Windows CE device, on the Linux host, the following information is displayed, indicating that the connection has been successfully established with the Windows CE device:

       Serial connection established.

Using interface ppp0

Connect: ppp0 <--> ttyS0

found interface eth0 for proxy arp

local IP address 90.0.0.1

remote IP address 90.0.0.2

We can also use the ping Command provided by the Linux host to verify whether the connection has been successfully established with the Windows CE device:

Ping 90.0.0.2

If the Linux host has successfully established a connection with the Windows CE device, we should be able to see information similar to the following:

       PING 90.0.0.2 (90.0.0.2) from 90.0.0.1 : 56(84) bytes of data.

64 bytes from 90.0.0.2: icmp_seq=0 ttl=32 time=26.587 msec

64 bytes from 90.0.0.2: icmp_seq=1 ttl=32 time=19.928 msec

64 bytes from 90.0.0.2: icmp_seq=2 ttl=32 time=19.939 msec

64 bytes from 90.0.0.2: icmp_seq=3 ttl=32 time=19.947 msec

FTP software based on Windows CE

After we successfully establish a PPP connection between the Linux host and the Windows CE device, what should we do next? Of course, we need some suitable programs to exchange files between Linux Hosts and Windows CE devices. We have now been able to use the TCP/IP protocol to transmit data between Linux Hosts and Windows CE devices. Obviously, the FTP program is a suitable choice.

File Transfer Protocol (FTP) is a widely used Protocol for File exchange over the network. Due to the requirement of Data Transmission reliability, FTP is a transmission protocol based on TCP/IP. An FTP session includes a server and a client. The client actively connects to the server and sends a file transfer request to the server, the server waits for the client to access and process the client's file transfer request.

Pe ftp Explorer is a popular FTP Client Software Based on Windows CE. It is also a fully functional file browser. Similar to FTP clients such as Cute FTP and ws ftp, which are commonly used on PCs, users can use the mouse (pointer) to compress the directory tree on the local end and server end, and upload or download files and directories, you can also rename or delete files or directories. This software can be obtained from the CE Archive website (http://www.cearchives.com/ftp.html. Readers can also find another popular FTP client, vxFTP.

Although FTP client software has been very complete and easy to operate, it is still inevitable to receive the limitation of the portable device's small display. If you can create an FTP server on a portable device, file transfer can be performed on a Linux host using a common FTP client.

Ftpsrv.exe is such an FTP server software based on Windows CE. This 28.5 KB small program can process most common FTP requests except for providing identity authentication and Passive transmission mode. Use the Windows ceservice software provided by Microsoft to upload ftpsrv.exe to any directory of a portable device. After the program is started, a small icon similar to a computer connecting two portable devices appears on the task bar. A small control window will appear when you click this icon using the pointer. Here we can change the port number of the FTP server or terminate the program.

Ftpsrv.exe can be obtained from http://pda.tucows.com/or http://www.oohito.com. Readers of these two websites can also find more useful applets.

Others

If you are using a Windows 9x/2000/NT host, you can also use the Windows linear cable connection function to establish a PPP connection with the Windows CE device.

For example, on a Windows 2000 host, choose Settings> network and dial-up connections> new connection from the Start Menu. In the subsequent Network Connection Wizard, select to connect directly to another computer and configure the machine as a host. After selecting the appropriate communication port and configuring the communication rate, the host is used as a PPP server to wait for client access. Similarly, create a new connection on the Windows CE device, specify the appropriate communication port and set the communication parameters, and then establish a point-to-point connection with the Windows host. Because the Windows host is already equipped with a dynamic IP Address Allocation (DHCP) server, the Windows CE device can either use a static IP address or a dynamic IP address allocated by the server in real time. However, because the maximum transmission rate allowed by the linear cable connection is 19,200 bps, the use of Windows 9x/2000/NT host as the PPP server seems to be less practical than the Linux host.

If you set the PPP server as a gateway, all machines in the LAN can access the Windows CE devices connected to the network by modifying the gateway. On a Linux host, you can use ipchains to set the host to a transparent gateway. on a Windows 9x/2000/NT host, you can use Proxy software such as Win Proxy to set it as a transparent gateway. If you need to learn more about how to set a Linux or Windows host as a transparent gateway, read other references.

Article entry: csh responsible editor: csh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.