Mkr WiFi 1010 Won't Connect to Wi-Fi

I have a brand new MKR WiFi 1010 that won't connect to my local Wi-Fi network and I can't figure out why. I'm using the code generated by the Arduino Cloud, and I've tried the SSID for my local public Wi-Fi network, and my Guest network.

#include <WiFi101.h>

/////// Wifi Settings ///////
char ssid[] = "my-network-ssid";
char pass[] = "my-network-password";

WiFiSSLClient sslClient;

void setup() {
Serial.begin (9600);

// attempt to connect to WiFi network:
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);

while (WiFi.begin(ssid, pass) != WL_CONNECTED) {
// unsuccessful, retry in 4 seconds
Serial.println("failed ... ");
delay(4000);
Serial.print("retrying: ");
Serial.println(ssid);
}

}

The sketch repeatedly fails, then retries over and over and over again. The Device is just a few feet from my HotSpot (Google Wi-Fi) and I've tried it across the room. I have a few devices in this room connected to the hotspot with no problems. I've unplugged the Google Wi-Fi device and plugged it back in again. I've unplugged the MKR 1010 and even held the reset button down to reset it.

Its a brand new board, but I think it's broken. There was a card in the box telling me the antenna is fragile, but you know, I can't find any picture or image that shows me what the antenna is. Looking at the back of the card, I see a diagram that I think is showing me the antenna, but I've not touched it.

It doesn't feel like there's a lot I can do to troubleshoot it. What am I missing?

OK, so I added this code to my sketch:

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

and when I run it, it tells me the shield isn't present. Bad board?

Found this article which says I need to use the WiFiNINA library, but that doesn't change anything.

Make sure you have the WiFiNINA examples loaded and use them only. Dont use the examples for the WiFi101 as they will not work due to the way the WiFi module talks to the SAMD MCU

You may want to try to a 2.4g wirless connection first to try those examples out.

And btw there is a specific section for the MKR series boards including the 1010.

@ballscrewbob, thanks, that advice worked. I took the WiFiNINA example web client and got connected to my Wi-Fi network.

@ballscrewbob, the way WiFiNiNA library talks to WiFi module is SPI, same as with WiFi101. even the low level protocol for exchange with firmware is almost the same.

here is the metamorphosis from 101 to 1010 (first name of the NINA library)

Hi Juraj

Agree its quite similar.

But as they say "Close but no cigar" LOL

Differences are enough that they are having to re-write the examples etc.

A belated reply...
I had the same issue. I had a Wifi sketch that worked on the MKR Wifi 1010, then I had to change Wifi router and then sketched stopped working. It could see the new router, but wouldn't connect.

Turned out the that the NinaFirmware was too old. The device was shipped with version 1.0.0 (even purchased in Oct 2019). Updating to version 1.2.4 solved the problem. (See:- Firmware Update 1.2.1 - available now, with BLE mode - MKRWIFI1010 - Arduino Forum )