Go Down

Topic: WiFi.config() - Static IP problem - RESOLVED (Read 4 times) previous topic - next topic


Jun 22, 2013, 10:03 pm Last Edit: Jun 23, 2013, 06:47 pm by Wi11turner Reason: 1
Hi all,

I am trying to make my arduino wifi shield gain a static ip on my network using the example:

Example code:
Code: [Select]
#include <SPI.h>
#include <WiFi.h>

// the IP address for the shield:
IPAddress ip(192, 168, 0, 177);    

char ssid[] = "yourNetwork";    // your network SSID (name)
char pass[] = "secretPassword"; // your network password (use for WPA, or use as key for WEP)

int status = WL_IDLE_STATUS;

void setup()
 // Initialize serial and wait for port to open:
 while (!Serial) {
   ; // wait for serial port to connect. Needed for Leonardo only

 // check for the presence of the shield:
 if (WiFi.status() == WL_NO_SHIELD) {
   Serial.println("WiFi shield not present");
   while(true);  // don't continue


 // attempt to connect to Wifi network:
 while ( status != WL_CONNECTED) {
   Serial.print("Attempting to connect to SSID: ");
   // Connect to WPA/WPA2 network. Change this line if using open or WEP network:    
   status = WiFi.begin(ssid, pass);

   // wait 10 seconds for connection:

 // print your WiFi shield's IP address:
 Serial.print("IP Address: ");

void loop () {}

When I do this, I have the error of:

'class WifiClass' has no member named 'config'

I have updated the wifi library, there is probably something simple I am doing wrong but I have read some discrepancy in the capabilities of the static IP feature of the arduino wifi board.

Does anyone know why I am getting this error?
Has anyone had any experience in doing this?



Have you got Arduino 1.0.5?

Note: Someone recently posted that, although they were able to call WiFi.config(ip), it did not set a static IP address.  They had to update the firmware on the WiFi Shield to get it to work.  You may run into that same problem once you get the WiFi.config() call to be recognized.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e


Thanks John,

I have installed 1.0.5 and was able to call and upload WiFi.config(ip).

Despite this it does not set a static IP, rather a dynamic one, as the next available on the network.

I will look into the firmware.


The WiFi.config() now works after:

1. Downloading and using Arduino 1.0.5.
2. Firmware updated following Arduinos instructions:

I found the Arduino instructions to be rather non-intuitive, especially if you are not friendly with command prompt.

Basically to upgrade the firmware on the shield you have to:
1. Upgrade HDG104 named "wifi_dnld.elf"
2. Upgrade T32UC3 named "wifiHD.elf"

I used this tutorial to help with a non command prompt update method:

I hope this helps anyone with similar problems.


Good morning

I have read your post, and I want to ask you some question on my project.
I want to implement a sketch to interface Wifi shield with my tablet (I have ad Android o.s.). I think to use the WiFi library (it's the best documented that I have found).
I have read about some problem on compatibilty between the Shield and library, so please I ask you suggestion to the kind and version I have to use to avoid the problem:

- Wifi Shield

- Wifi library

- IDE version (I think it's the 1.0.5, but I'm not sure)

Tanks a lot

Go Up