chipKIT® Development Platform

Inspired by Arduino™

Send data between two wifi shields.

Created Fri, 29 Mar 2013 10:02:54 +0000 by romain.agaisse


Fri, 29 Mar 2013 10:02:54 +0000

**[color=#000000]Hi. I'm building a project which requires WiFi communication between TWO Chipkit Wifi Shield on Chipkit Uno32. The connection will then be used to send data between the two boards. I'm using ADHOC mode. I'm fairly new to MPIDE and also to networking protocols.

My problem is that I cannot establish a TCP server-client connection between the two boards. I have modified the WiFiTCPEchoClient and WiFiTCPEchoServer examples according to my own network's information, nothing else.

What seems to be working:

I can see the available WiFi AP-s.

Not working: There is no communication between a client and a server . Simply the client is unable to connect to the server.[/color] [color=#FF0000] What I noticed so far is that the WiFiTCPEchoClient example locks down in the 'if(tcpClient.isConnected())' line in the WRITE state. [/color]

[color=#000000]Is there anything I missed? Any help would be greatly appreciated.[/color]**


Sun, 31 Mar 2013 15:31:47 +0000

If you read "Ad Hoc WiFi network using DWIFIcK library" ADHOC mode is available but not supported. Some say they have got it going but not in this setup. For this setup to work, the client tells the server that it is available and so the server will see the tcpServer.availableClients > 0. If this is the case, the server will then need to tcpServer.acceptClient(). If this is not being sent back, then the 'if(tcpClient.isConnected())' will be false. These routines lie in the tcpServer.cpp and tcpClient.cpp files located in the DNETcK folder in the libraries of the MPIDE. From there you may need to follow the code (can be a bit hard to follow) as the TCP Infrastructure mode sometimes takes care of a few things in the background that ADHOC mode might not.

Hope this helps