WiFi101 - can not set fixed IP

I am unable to set a useable fixed/static IP address using an Arduino WiFi-101.

Environment: MacBook Pro, OSX 10.9.4, Arduino IDE 1.6.9, WiFi101 lib ver 0.9.1
Boards: Arduino Zero and Arduino WiFi101

The WiFi101 has been upgraded to fw level 19.4.4 - this is confirmed by running the WiFi101 example program “CheckFirmwareVersion”.

The Zero and the attached WiFi101 can associate with local WiFi net. This is confirmed setting the SSID and password for the local WiFi net and then running the WiFi101 example program “SimpleWebServerWiFi”. When executing this program I can access the Zero’s minimal web page on the DHCP supplied IP address and toggle the voltage on the Zero’s digital pin 9. This example program appears to have been lifted from the old (pre 101) Arduino WiFi examples since there is no pin 9 LED on the WiFi-101.

Then, using the example static IP code from the bottom of Arduino.cc’s web page

and setting the SSID, password, and IP, I tested setting a fixed ip of 192.168.0.200 on the Zero/WiFi101 pair. This failed - 192.168.0.200 did not respond to pings. The serial monitor shows the following on startup:

Attempting to connect to SSID: XXXXX (it does show the correct SSID which I have removed here)
IP Address: 3355486400

I have running a mixture of several UNOs, some with old style Arduino WiFI shields and some with the (apparently obsoleted) Arduino eth shields, all of which use fixed IPs - they all work as expected and show their IP address as a dotted quad on startup. I’ve never seen an Arduino (or anything else) report its IP address as a decimal.

Decoding the decimal IP, if I am not mistaken, yields the dotted quad 200.0.168.192 which is a by quad transpose of the IP specified in the code.

Does anyone have any suggestions or observations that would help me set a working fixed IP with the Arduino WiFi101?

Has anyone here successfully set a fixed IP address with the Zero/WiFi101 combination?

Setting fixed IP addresses is a requirement for this project.

Thanks for taking the time to read this and any comment you may offer,

Jmario
20160719.0243

Hi @jmario,

I just tried the example sketch from WiFi101 - Arduino Reference on a MKR1000 board which is equivalent to a Zero +WiFi101 shield. I was able to ping 10.0.1.42 after changing the ip to "IPAddress ip(10, 0, 1, 42);" in the sketch.

Could you please try this sketch on your board to see if that works.

Regarding the number being printed instead of the IP address, please try changing the following lines from:

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

to:

// print your WiFi shield's IP address:
Serial.print("IP Address: ");
IPAddress ip = WiFi.localIP();
Serial.println(ip);

Could you also please share the full sketch you are using? I would be happy to try it out for you with my boards.

Sandeepmistry

Thanks for your help - the change you suggested,

IPAddress ip = WiFi.localIP();
Serial.println(ip);

in place of

Serial.println(WiFi.localIP());

allows the program to print the IP in the usual dotted quad manner.

Since you were able to run the example code successfully on a mkr1000 which is essentially a duplicate of my Zero/WiFi101 combination, I thought I should perhaps start over. I again copied the static ip example code from WiFi101 - Arduino Reference and pasted it into the IDE, edited the SSID, password, and the IP - compiled, uploaded and it worked - I can ping the IP.

Not sure what went wrong the first time I tried it but it will be a pleasure to begin to move my efforts from the UNO's rather limited memory to the Zero's 256K world.

Thanks again for your help,
Jmario