Reputation: 163
Is it possible to switch between client and server using an Arduino Wi-Fi shield?
That is, switch between server mode
and client mode
on the fly on a
WiFiServer server(80);
WiFiClient client;
This works for incomming clients, but if I try to use the client to connect to some site with client.connect(serverName, 80)
... client.stop()
, the Arduino will receive the page content of that page, then it will hang, it won't accept any new clients (it won't respond when I use the browser to connect to it.
I tried using a separate WiFiclient for the connect part, but with the same result:
client = server.available();
... After using connect, this part won't work anymore.
So, what I'm doing wrong?
Upvotes: 3
Views: 1177
Reputation: 163
It seems that my problem was caused by some bugs in the firmware.
The "old" firmware that was on the shield when I bought it had some problems dealing with client and server running both on the Arduino.
They fixed it and a bunch of other issues since then, so it's best to upgrade the shield's firmware to it's latest revision.
Here is a guide on how to do upgrade the firmware on the Arduino WiFiShield.
And here is a list with the issues they fixed.
Upvotes: 1