Chris De Herrera's Windows CE Website

Discuss.Pocket PC FAQ Forum

Add Pocket PC FAQ to your Favorites
RSS    RSS Feeds
Wiki    Lost?
Custom Search
Subscribe    Print
Table of Contents
Mobile Format

Pocket PC Blast

Pocket PC Magazine Best Site

Website Awards
Website Updates

By Chris De Herrera 
Copyright 1998-2007
 All Rights Reserved
A member of the Talksites Family of Websites

Windows and Windows CE are trademarks of Microsoft
and are used
under license from owner.
CEWindows.NET is not
associated with Microsoft 

All Trademarks are owned
by their respective companies.

Connecting Linux and Windows CE via Serial & IrDA
By Arthur Tyde and Bryan Abshier of Linuxcare, Inc, Copyright 2000
 Version 1.00   Revised 3/16/2000

Shop unique and cheap iPhone cases on


This will tell you how to set up a masqueraded PPP connection via. IrDA from a Windows CE PC Companion to a Linux based notebook computer. Once you are IP connected, the rest is up to you. We put this together as a guide for Sony notebook users with Casio E-100/105 PDA's, though the procedure should work for any Windows CE 2.11 device with infrared capabilities talking to any notebook. Do all the Linux side testing signed on as root, standard warnings apply.

Step by Step

1. Configure a network connection for your Windows CE device. Go into "Connections" and create a "Direct Connection" Name it something meaningful, for device select "Infrared Port". Go into settings and change the baud rate to 115200, this is the max for Windows CE. Go to TCP/IP settings and check "Use server-assigned IP address," and "Use software compression," and "Use IP header compression" Make sure "Use Slip," is unchecked. For Name Servers, make sure "Use server-assigned addresses" is checked. Go to Start, Settings, Communications, Identification and enter something for the Device Name. (I used "cetoy") You most likely already have these values set if you have synced with a Win9x desktop using ActiveSync.

2. Set up IrDA support on your notebook (described elsewhere) and get to the point where your notebook will discover an IrDA compliant device. A good sign is the irda0 device will show up when you execute "ifconfig". It will not have an IP address, this is ok.

3. Test the discovery by setting an IrDA device in range of your IR port, wait 5 seconds, and;

"> cat /proc/net/irda/discovery"

For example, the Ericsson I888 World Phone with IR port enabled should immediately show something like this:

"name:I 888 WORLD ,hint:0x9104,saddr:0x838470e5,daddr:0x152dceaa"

Your Windows CE machine will not be discovered unless it's actively looking for a connection. So, if you want to test with Windows CE position your device and double tap on the network icon you created in step 2, you should see something like this:


The name displayed will be whatever value you have entered into the Start > Settings > Communications > Identification as the Device Name. At this point, with basic IrDA functioning- we can move on to establishing a PPP connection for Windows CE. These scripts can also be used for serial cable connects. Create the following files and copy them into the directory indicated.

[/usr/sbin/ - make it executable]
pppd call cebox

Because Microsoft likes to break standards, you need the following chat script. This will feed Windows CE the proper ASCII keywords it wants before allowing a PPP connection.

""        "SERVER\c"

The following file will allow you to specify the IP addresses, IR (or serial port if using a cable) device, DNS and so forth. I do not recommend you change the 192.IP addresses below. Windows CE really has an affection for because all the MS synch tools seem to have it hardcoded. DNS can be whatever you normally use.

/dev/irnine 115200 crtscts
connect '/usr/sbin/chat -v -f /etc/ppp/'

Testing the connection

Ok, now you can test the connection to make sure it all works. Reboot your Linux machine, run "irmanager -d 1", it should automatically run "irattach /dev/ttyS2" (/dev/ttyS2 being the serial port your BIOS sees the IR device as, if irattach is not running, start it) Align the IR ports, at the Linux command prompt type "/usr/sbin/", and simultaneously press return to start cebox and double tap your connection icon in Windows CE. You should get a happy message from Windows CE
reporting Connecting to Host, Device Connected, Authenticating User, User Authenticated and finally Connected. You should see something like this when you are connected;

irda0 Link encap:IrLAP HWaddr 06:89:d0:58
RX packets:246 errors:0 dropped:0 overruns:0 frame:0
TX packets:251 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:8

ppp0 Link encap:Point-to-Point Protocol
inet addr: P-t-P: Mask:
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10

The following script sets up IrDA, establishes a PPP connection with Windows CE, and then sets up IP masquerading. It is provided as an example of how you can tie this all together. This is more or less a manual approach. You can get creative, start irmanager at boot and stick a line in inittab to constantly look for a Windows CE connection on the IR
port. This will however, run down your batteries and limit your ability to access other IR gadgets. I just use the script below.

Position the device, run "windowsce" and start communications on your PDA when the script tells you to.

[/usr/local/bin/windowsce - make this executable]
use strict;
# Enable IrDA, start ppp0 and set up Windows CE masquerading
# A. Tyde - Linuxcare Inc.
print "\n-> Setting up IR infrastructure...\n";
system("killall irmanager 2>/dev/null");
system("killall irattach 2>/dev/null");
sleep 1;
system("irmanager -d 1");
sleep 1;
print " Start Windows CE Serial or IR networking now!\n";
open(ECHO,">/proc/sys/net/ipv4/ip_forward") or die "Can not open /proc/sys/net/ipv4/ip_forward";
print ECHO "1";
close (ECHO);
print " Serving to Windows CE device...\n\n";
system("ipchains -F");
sleep 5;
system("ipchains -P forward DENY");
system("ipchains -A forward -s -j MASQ");
exit 0;

For a Serial Connection

Yes, you can use serial - just stick one of the the following example lines in your inittab, change /dev/irnine to /dev/ttySx and plug your docking station in. I have a docking station for my E105 plugged into a Cobalt Qube. When it docks, it automatically backs it up to SAMBA, et. al.

T0:23:respawn:/usr/sbin/ # /dev/ttyS0 
T1:23:respawn:/usr/sbin/ # /dev/ttyS1 
T2:23:respawn:/usr/sbin/ # /dev/ttyS2 
T3:23:respawn:/usr/sbin/ # /dev/ttyS3 
T4:23:respawn:/usr/sbin/ # /dev/ttyS4


Now you can connect your Windows CE PC Companion to your Linux desktop or notebook for file transfer without using ActiveSync or any emulation.

Return to Chris De Herrera's Windows CE Website