Arduino UNO WiFi Network Problems

Hello :slight_smile:

I have been unsuccessful within the last 7 hours to get the arduino wifi connection going. I don’t know why it works the way it does - or rather, why it doesn’t do what it should.

I have 3 Arduino UNO WiFi devices. My goal is to connect all three to power and then have a status on a LOCAL network website to say “Device 1 = Connected, Device 2 = Connected…” and so on. I have Windows 7. Devices are connected on COM4,COM5 and COM6. I can connect all 3 devices at once, but for configuration of the wireless only one at a time.

Here is where I am stuck :

0.) I instruct router to give the 3 devices an IP (if certain MAC address)
1.) I plug in device
2.) Device powers up
3.) I see AP network
4.) I connect to Arduino-Uno-WiFi-cc7xxx network
5.) I go to 192.168.240.1
6.) I go to Wireless settings
7.) I choose my SSID and type password and click connected
8.) I wait.
9.) I then set IP to static (192.168.1.x , 255.255.255.0, 192.168.1.1)
10.) Or I first set IP to static and then SSID and password
11.) I wait
12.) I check the debug and it says “Wifi disconnected from ssid …, reason unspecified (203)”
13.) I check Wifi page … says “WiFi status connecting”
14.) I go to IDE
15.) Using this code :

#include <SPI.h>
#include <WiFi.h>

char ssid[] = "***";  //obviously with my real creds   
char pass[] = "***";

IPAddress ip(192, 168, 1, 120); 
IPAddress gateway(192, 168, 1, 1); 
IPAddress subnet(255, 255, 255, 0); 
IPAddress dns(192, 168, 1, 1);

void setup()
{
 WiFi.config(ip, dns, gateway, subnet);

 WiFi.begin(ssid, pass);
 Serial.begin(9600);
}

void loop () 
{
  Serial.println(WiFi.localIP());
  delay(2000);
 }

16.) output is always 0.0.0.0
15.) I tried resetting (button on device)
17.) I tried EEPROM clear.
18.) I tried reconnect device. (Plug out Plug in)
19.) I tried all 3 devices.
20.) I tried with DHCP
21.) I tried router restart

Any help would be really great ! What I would also like to know is how long resets take and how long the DHCP wifi actually takes to connect.

Please use code tags for code (</> button on the toolbar), not quote tags.

You’re using the wrong library. The WiFi library is for use with the Arduino WiFi shield, not the Uno WiFi.

As you can see from the “What is the library that it needs to use for the WiFi?” FAQ at the bottom of that link:

If you are using the Arduino 1.7.x then you need to use the ArduinoWiFi.h library that it is already included in the IDE.
Instead you are using the Arduino 1.8.x then you need to download the UNOWiFiDev.Edition library from Library Manager.

If you’re using Arduino 1.6.x or 1.8.x (which I highly recommend) then you can install the library by doing this:

  • Sketch > Include Library > Manage Libraries…
  • Wait for download to complete
  • In the “Filter your search…” box type: “Arduino Uno Wifi Dev”
  • Click on “Arduino Uno Wifi Dev Ed Library”
  • Click “Install”
  • Wait for installation to complete
  • Click “Close”

After that you will find example sketches for the library under File > Examples > Arduino Uno WiFi Dev Ed Library.

Thanks @pert. This worked nicely.

Glad to hear. Enjoy!