Log in

View Full Version : TUTORIAL: Setting up and using Wi-Fi peer-to-peer connections between Pocket PC's


Menneisyys
03-03-2006, 09:36 AM
Don't you have a Bluetooth PAN because you don't have a Bluetooth unit in your PDA at all or you "only" have the Microsoft Bluetooth stack? Would you still want to create local, wireless networks between Pocket PC's? Wi-Fi ad-hoc (peer-to-peer) networking to the rescue!

Local, wireless networks between Pocket PC's are really useful. They excel at running multiplayer games (please read this roundup of multiplayer games (http://www.pocketpcmag.com/blogs/menneisyys/102005MPPPCGames.asp) for more information; for this tutorial, I've successfully tested the following multiplayer games with Wi-Fi P2P: OmniGSoft titles (3D Mini-Jetfight 1.2 and Dogfight 1.5), ZIO Space Tactics 1.0, Handmark Battleship 1.06, Quartz 2 1.2, RocketElite 2.1, Warfare Incorporated 1.2, CanTris and The Travel Collection 1.6), running (also) LAN-based, excellent communication applications like Microsoft Portrait (http://www.pocketpcmag.com/blogs/index.php?blog=3&title=microsoft_portrait_gphone_and_peer_to_pe&more=1) or help in Internet connection sharing between your PDA's (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=453&more=1).

Bluetooth (BT) Personal Area Network (PAN) is one means of achieving this kind of connectivity. (Please see the Recommended links section for the links of the tutorial explaining how BT PAN can be set up and used between Pocket PC's.) Unfortunately, support for BT PAN is painfully missing from all Pocket PC's that have the Microsoft BT stack on them, as opposed to the Widcom/Broadcomm stacks. Examples of Pocket PC's like this are all the HTC Phone Edition devices, the Dell Axim x51(v) etc.

Before publishing this tutorial, it seemed to be impossible to create computer-to-computer connections on Pocket PC's via Wi-Fi – or, at least, I have never seen any tutorials or even threads on this. It would seem to the causal user none of the available Pocket PC Wi-Fi clients (including the built-in Microsoft one) allow for explicitly starting a P2P connection – this is why most people would think it's not possible to host P2P connections at all on Pocket PC's. This is, fortunately, not true.

Setting up a Wi-Fi Peer-to-peer (P2P for short) or ad-hoc (non-infrastructure) connection between two (or, for that matter, several) Pocket PC's is really easy.

You can host the P2P connection on any Pocket PC that has Wi-Fi support – even on older (non-WM5) ones. In this tutorial, I show doing this on the HTC Wizard; the way of doing this is exactly the same on any other Pocket PC's.

I use the built-in Microsoft client for this. The latter can be found in WM2003 at Settings/Connections/ Connections /Advanced/ Network Card/Wireless and in (most) WM2003SE/WM5 devices at Settings/Connections/ Network Cards/Wireless.

Please note that you will need to explictly start the Wi-Fi unit before going there; otherwise, the Wireless tab won't be seen. Also note that WM2003/WM2003SE devices can be cradled during this, unlike WM5 devices because of the completely new networking model of WM5 (I've elaborated on the latter here (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=555&more=1)). That is, you must not only start the Wi-Fi unit, but also disconnect your WM5 Pocket PC's in order to be able to have access to this tab.

Start the built-in Wi-Fi unit as can be seen in this screenshot (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-1.bmp.png). On other Pocket PC's, you'll have a different menu to do this; for example, on the Pocket Loox 720, you will need to click the globe icon on the Today screen and choose "Turn Wireless ON" (http://www.winmobiletech.com/032006WiFiP2P/PL720SwitchOnWireless.bmp.png) and, on the Dell Axim x51v, you will need to click the http://www.winmobiletech.com/032006WiFiP2P/x51vWirelessIcon.png icon and click the Turn On button (http://www.winmobiletech.com/032006WiFiP2P/x51vTurnOnWiFi.png).

Then, on all WM2003+ devices (but not on Pocket PC 2000/2002 ones – more on them later) you will need to go straight to Settings/Connections/ Network Cards/Wireless. You can do this, as has already been pointed out, via the Start menu – on most Pocket PC's. On the Wizard, it's also available through the above-shown connection dialog (go to Settings/Wi-Fi Settings (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-2.bmp.png) and, inside, Menu/Network Cards (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-3.bmp.png)).

Now follows the initial creation of the Wi-Fi P2P network. It's very easy and must be done in exactly the same way on all Pocket PC's. This example shows a HTC Wizard.

Click Add New...; enter the name of the new p2p network; here, I've chosen to call it HTCWizardP2PwiFi.

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-4.bmp.png)

Make sure you also enable the "This is a device-to-device (ad-hoc) connection" checkbox:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-5.bmp.png)

In the Network Key tab, it's worth change the default "WEP" to "Disabled" in the Data Encryption drop-down list so that you and your clients don't end up having to enter a WEP key. After all, noone can do any harm to self-standing Pocket PC's via Wi-Fi because they have simply nothing to access (as opposed to desktop PC's) - not even their local file system.

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-6.bmp.png)

Then, just click OK; the PDA will start to listen to clients; this is why it says "Connecting":

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/HTCWizard-WiFi-7.bmp.png)

Now, the P2P network is given a name and you can start configuring your Pocket PC clients to connect to it. I show this on two Pocket PC's; the PL720 and the Dell Axim x51v.

On the latter (x51v), turn on Wi-Fi (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-1.bmp.png). Click the (large) Settings button so that you get into the Wireless tab of Network Cards (note that you can also go there, as usual, via Settings/Connections/ Network Cards/Wireless). Here, it's the best to choose "Only computer-to-computer" from the "Network to access:" drop-down list so that the Pocket PC will only try to connect/will only list p2p "servers":

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-2.bmp.png)

In the list above, you'll already see the "server" Pocket PC without explicitly entering its name into the client Pocket PC's:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-3.bmp.png)

Tap-and-hold it and choose 'Connect' from the context menu:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-4.bmp.png)

On the next screen, just click OK:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-5.bmp.png)

Then, the Pocket PC will attempt connecting and will, eventually, connect:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/x51v-WiFi-6.bmp.png)

On all the other WM2003+ Pocket PC clients, you need to do the same. That is, go to Settings/Connections/ Network Cards/Wireless, tap-and-hold the new P2P network from the list and choose Connect (example screenshot taken on PL720):

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/PL720ConnectToServer.bmp.png)

Then, the device will connect to the P2P network as can be seen in here (http://www.winmobiletech.com/032006WiFiP2P/PL720ConnectToServer-2.bmp.png).

Devices without Settings/Connections/ Network Cards/Wireless - that is, Pocket PC 2000/2002 devices

On all pre-WM2003 Pocket PC's (that is, Pocket PC's with the Pocket PC 2000 or the 2002 operating system), you must use the proprietary setter applet provided by the manufacturer of your wireless card. With the SanDisk client, you can access it (after you insert the wireless card) by clicking the http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-WiFiTodayIcon.png icon on the Today screen (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-WiFiToday.bmp.png).

Fortunately, these clients are pretty much the same as with the built-in Wireless support in WM2003+, usage-wise. That is, you make them scan (if they don't do it automatically) after, possibly, forcing them to list only P2P networks (in the SanDisk applet, it's in the "Config" tab that you can force the client to look for P2P networks only (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-SandiskAppAPBrowser-2.bmp.png)). The scanning screens are pretty similar to the ones I've presented in the post-PPC2k2 section; for example, like this (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-SandiskAppAPBrowser-1.bmp.png) (again, in the SanDisk applet).

The applets, in general, also display the IP (see the IP tab) (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-SandiskAppletIP.png) so that you don't need to use third-party applications (vxUtil – see its screenshot under PPC2k2 (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-OwnIP-vx.bmp.png)) to know your own IP.

Note that, unlike with WM2003+ operating systems, you can't get your current IP in the "traditional" way. If you go to Settings/Connections/ Network Adapters (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2NetworkAdaptersInsteadOfCards.bmp.png) (note the different icon and name of the applet! Under WM2003+, it's called Network Cards) and view the properties of the Wireless card (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-OwnIP-1.bmp.png), the IP won't be displayed (http://www.winmobiletech.com/032006WiFiP2P/PPC2k2-OwnIP-2.bmp.png).

Otherwise, under pre-WM2003 operating system, using Wi-Fi is exactly the same as in WM2003+.

P2P Wi-Fi connections are really flexible!

Note that it's only at the first occasion that client Pocket PC's need to explicitly connect to a "server". After this, whenever you enable the Wi-Fi unit on any of your Pocket PC's that have previously participated in a P2P connection, the P2P connection will be restarted. You won't even need to use the Pocket PC (in this example, the HTC Wizard) that, at first, hosted the connection, any more to participate in the P2P connection either. That is, the P2P connection will be automatically recreated when the Pocket PC's that have connected to each other see (at least some of) the other parties again.

Looking up a device's own IP address

In most cases, you'll also need to know the IP address some (or, in very few cases, all) of the Pocket PC's participating in a Wi-Fi P2P network. For example, when you use a P2P network to share an Internet connection on one of your PDA's with your other PDA's / desktop computers, you'll need to know the IP of the given PDA so that you can enter it on the other PDA's/computers in order for them to be able to find the server. It's only in very rare cases (for example, with the multiplayer game Warfare Incorporated, which uses broadcasting to find local clients on the local network and, therefore, requires no direct IP entering if used through LAN) that you won't need to do this.

Fortunately, as with the BT PAN networking scenario on the Pocket PC, once your device (automatically – don't let the fact mislead you that the operating system doesn't have a DHCP server!) gets an IP address in a P2P network, it will never change. That is, if a Pocket PC is assigned the (local) IP address, say, 169.254.212.228, it will stay the same in the same P2P networks that will be later recreated/restarted. That is, you won't ever need to look up your IP again or, for example, change the server IP in clients when you start the network again.

You can look up your IP's really easily. First, you can use the excellent and, what is more, free tool vxUtil (http://www.cam.com/vxutil.html) for this. Just go to Functions/Info and jot down the IP address at the top. Examples of three Pocket PC's:

Pocket Loox 720 (http://www.winmobiletech.com/032006WiFiP2P/PL720ConnectToServer-IP.bmp.png)
x51v (http://www.winmobiletech.com/032006WiFiP2P/x51vConnectToServer-IP.png)
HTC Wizard (http://www.winmobiletech.com/032006WiFiP2P/WizardConnectToServer-IP.png)

Alternatively, if you don't want to use third-party tools for that, go to the Network Adapters tab of the well-known Settings/Connections/ Network Cards applet, click the entry that corresponds to your Wi-Fi unit (unfortunately, its name can be pretty cryptic some time – for example, in the HTC Wizard, it's referred to as SDIO WLAN Adapter. Of course SDIO is pretty misleading here because the Wi-Fi unit isn't located on a SDIO card in the HTC Wizard) and jot down the contents of the, by default, not editable text field at the top:

PL720: screenshot-1 (http://www.winmobiletech.com/032006WiFiP2P/PL720ConnectToServer-IP-2.bmp.png) screenshot-2 (http://www.winmobiletech.com/032006WiFiP2P/PL720ConnectToServer-IP-3.bmp.png)

x51v: screenshot-1 (http://www.winmobiletech.com/032006WiFiP2P/x51vConnectToServer-IP-1.png) screenshot-2 (http://www.winmobiletech.com/032006WiFiP2P/x51vConnectToServer-IP-2.png)

Wizard: screenshot-1 (http://www.winmobiletech.com/032006WiFiP2P/WizardConnectToServer-IP-1.png) screenshot-2 (http://www.winmobiletech.com/032006WiFiP2P/WizardConnectToServer-IP-2.png)

After this, you can test your P2P network with any client-server application like a multiplayer game. With, say, the excellent multiplayer game Warfare Incorporated, you'll see P2P networking indeed works (http://www.winmobiletech.com/032006WiFiP2P/MPGameWithWiFip2p.bmp.png) with any number of participating Wi-Fi Pocket PC's (here, three). (Note that Warfare Incorporated uses auto-discovery over Wi-Fi (and BT); therefore, you won't need to enter the server IP address into the clients.)

Connected networks – Bluetooth PAN and Wi-Fi P2P working together?

You may ask the question "is it possible to utilize both Bluetooth PAN and Wi-Fi Peer-to-peer at the same time to connect both Wi-Fi and BT PAN clients to a server"? That is, is the following configuration possible:

Click for screenshot (http://www.winmobiletech.com/032006WiFiP2P/BothBTAndWiFiP2PConnAtTheSameTime.gif)

In this configuration, the Pocket PC that has both Wi-Fi and BT PAN support (with also support for them being able to co-exist – that is, it should be a BT 1.2 device or the still BT 1.1 ASUS A730(w), which also allows for parallel use of the two wireless radios) hosts a server (let it be a Microsoft Portrait client, a multiplayer game server or anything) that clients would like to connect to to.

As can be seen in both the above schema and in this screenshot (http://www.winmobiletech.com/032006WiFiP2P/PL720HostsBothBTPANandWifiP2P.png), the server PDA (in this case, the Pocket Loox 720) has two, entirely different IP addresses for the two local networks it participates in.

The answer to the original question is, unfortunately, no. Much as you can start host individual networks on your PDA capable of this (that is, a Widcomm BT 1.2 Pocket PC like the Pocket Loox 720), you can not host servers that would be accessible from both the Wi-Fi and the Bluetooth network on the same PDA. The sole reason for this is that server applications only listen to client requests on one IP address, which is generally the Wi-Fi P2P address. If you directly enter the BT PAN server IP address (in this case, 169.254.72.110) to the BT PAN client(s), the latter won't find the server application. You can't enter the "other", the Wi-Fi P2P server IP address (169.254.212.228) to the BT PAN client(s) either because it's a non-existing IP address in their own local network. That is, the BT PAN clients won't ever be able to connect to the server application – only Wi-Fi P2P-connected clients will be able to do this.

That is, any kind of multiple network interconnection is impossible.

I've tested this scenario with several applications to be absolutely sure this infrastructure won't work: MS Portrait, the multiplayer games from OmniGSoft (3D Mini-Jetfight 1.2 and Dogfight 1.5), the multiplayer game Quartz 2 1.2 and Warfare Incorporated 1.2. These games all have TCP/IP-based, LAN multiplayer capabilities and allow for more than two players at the same time. (There would be no point in using a networking architecture like this with multiplayer games that only support two players. Then, only one connection/networking type – BT PAN or Wi-Fi P2P – that is supported by both PDA's should be used.)

Image gallery of Wi-Fi P2P in some multiplayer games

In these usability, compatibility and stability tests, I've used my Pocket Loox 720, HTC Wizard, Dell Axim x51v and iPAQ 2210 (the latter with the SanDisk Connect Plus CF card).

Warfare Inc.with four players (game hosted on the Pocket Loox 720) (http://www.winmobiletech.com/032006WiFiP2P/WarfareIncFourWiFiPlayers.bmp.png). Excellent playability even with four players.

Quartz 2 with four players – screenshot one (http://www.winmobiletech.com/032006WiFiP2P/Quartz2FourWiFiPlayers.bmp.png) and two (http://www.winmobiletech.com/032006WiFiP2P/Quartz2FourWiFiPlayers-2.bmp.png). Excellent playability even with four players.

Mini Dogfight with four players – a screenshot of the server screen, showing the three other Pocket PC's have joined (http://www.winmobiletech.com/032006WiFiP2P/MiniDogfightFourWiFiPlayers.bmp.png); in-game screenshot, showing the four opponents (http://www.winmobiletech.com/032006WiFiP2P/MiniDogfightFourWiFiPlayers-2.bmp.png). Definite slowdown with four players – on the verge of playability.

Recommended links (in addition to the already-linked articles)

Fundamental ActiveSync networking differences between WM5 and previous WM versions (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=555&more=1)

Setting up a BT PAN and looking up the local IP address of the host (http://www.pocketpcthoughts.com/forums/viewtopic.php?p=371262) (alternatives: iPAQ HQ (http://www.ipaqhq.com/forums/showthread.php?p=117792), AximSite (http://www.aximsite.com/boards/showthread.php?p=869373), PPC Magazine (http://www.pocketpcmag.com/forum/topic.asp?TOPIC_ID=18904), FirstLoox (http://www.firstloox.org/forums/showthread.php?p=42475) or BrightHand (http://discussion.brighthand.com/showthread.php?s=&threadid=120872)).

Menneisyys
03-05-2006, 07:06 PM
I've heavily updated the tutorial: added a brand new section on PPC2k/PPC2k2; added a multiplayer game image gallery and slightly modified the x51v-related information. Make sure you read it again if interested.