1

Here is our setup.

The documentation says that:

This allows for real "Socket" connection over WiFi...

and

... [the Wifi module] is a complete IEEE 802.11bgn WiFi client device

We have succeeded at the following:

  1. Connect the Wifi module to our home wireless network.
  2. Make an HttpWebRequest to an arbitrary Internet server.
  3. Open a socket to an arbitrary Internet server and receive data.

What we want to do now is to open a TCP socket to our Desktop Computer (ASUS A55A with a standard setup). Here are two options:

  • Connect the Cobra and the PC via the Internet (WAN). This seems like overkill.
  • Connect the Cobra and the PC via the Intranet (LAN). This seem preferable.

That's the question. How do we create a LAN between the Cobra and the PC? Here are some sub-questions:

  • Does this entail turning the Cobra into an Ad-Hoc Host?
  • Is the router required?
  • Or, can we circumvent the router and communicate directly between the Cobra and PC?

Diagram of the Goal

Application on Cobra II
   |
   |
   |
Wifi Module in Cobra II
   |
   |
   |
Wireless TCP Socket
   |
   |
   |
Router 
(required?)
   |
   |
   |
Wireless TCP Socket
   |
   |
   |
Wireless Card in Desktop Computer
   |
   |
   |
Application on Desktop
2

If two computers are going to communicate via Wifi without an access point, they need to be in ad-hoc or IBSS mode.

If you literally want to create a LAN, you will need a wireless bridge capable of running in AP mode. A typical consumer router does this, and also bridges the wireless interface to the wired, so it all is on the same network.


Consumer-level wireless routers are a couple devices in one:

  • a router
  • a wireless bridge that can work in AP mode
  • a wired switch

You don't need the first component of this. As long as you don't connect anything to the WAN port of the router, you ought not to be bothered by the actual routing functionality.

  • Don't forget they also function as a DHCP server, and a caching DNS server. – Bob Jan 24 '14 at 2:27
  • Then use ad-hoc or IBSS mode. Looking at the link you provided for your module, it seems to be supported. – LawrenceC Jan 24 '14 at 2:34
  • Based on your answer it seems that yes, it is possible to create a WiFi TCP Socket between two computers, but that this will not be a real LAN. Also, it entails turning the Cobra II Wifi Module into an ad-hoc host, and that this is equivalent to IBSS mode. We can circumvent the router and communicate directly between the Cobra and the PC. The answer then is to create a WiFi TCP Socket between the Cobra and the PC by setting the Wifi module to ad-hoc mode. – Shaun Luttin Jan 24 '14 at 2:37
  • See also How 802.11 Wireless Works – Shaun Luttin Jan 24 '14 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.