Arduino nicla vision is not connecting to wifi

I uploaded this code to the Nicla vision,

#include <WiFi.h>

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;        // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;                 // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
// IPAddress server(93,184,216,34);  // IP address for example.com (no DNS)
char server[] = "example.com";       // host name for example.com (using DNS)

WiFiClient client;

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

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

    // wait 3 seconds for connection:
    delay(3000);
  }
  Serial.println("Connected to wifi");
  printWifiStatus();

  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET /index.html HTTP/1.1");
    client.print("Host: ");
    client.println(server);
    client.println("Connection: close");
    client.println();
  }
}

void loop() {
  // if there are incoming bytes available
  // from the server, read them and print them:
  while (client.available()) {
    char c = client.read();
    Serial.write(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting from server.");
    client.stop();

    // do nothing forevermore:
    while (true);
  }
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

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

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

The serial monitor output is

Hey, I had a similar problem, solved it by uploading the wifi firmware updater script.
Simply compile and load.
image

Hi Tom,
I updated the firmware by running the updater script. The output from the serial monitor shows like this.


I believe that the firmware has been updated properly.

But still, a problem exists, When I try to re-upload the Wi-Fi web client sketch from the Nicla vision examples(with proper SSID and pass) to Nicla vision, It is not connecting to the wifi.
It attempts a lot for connection but its not happening at all. [The below image shows the output from serial monitor]


What would be the reason?

Not yet

Hi, sorry for the late response, I just saw your message now.
Seems a bit odd, your firmware update looks ok...
A few questions:

  1. Have you connected the antenna? Are you sure you are in range?
  2. Have you written the the wifi network name in quotation marks like this?

  1. What frequency band is your Wifi? I personally have only tried 5Ghz and it worked for me.

  2. Do you have anything connected that might cause trouble?

Hope the issue is resolved by now.
Tom

Hi,

  1. I tried connecting with the antenna in the range but it is not connecting.
  2. Yes
  3. I tried with both 2.4Ghz and 5Ghz
  4. I tried with a lot of mobile hotspots and routers
    The problem still exists.

Sounds like you're doing everything well on the board side.
Your code checks out, just as well as your wifi update, and the printout you are getting while trying to connect.
Unless there is some critical damage to your module, I can't really see what could be wrong, could be a safety feature on your routers/hotspots or some weird character in your SSID or Password. Other than that , I would try:
1: Making sure the Arduino board on the boards manager is updated
2: Updating the Wifi again (just in case)
3: Trying to connect using IP rather than DNS
4: Disarming any firewalls that might be hindering connection
If none of these work, I'd try and contact some customer service and ask for a replacement/buy a new one.

Good luck,
Tom

Hi I had the same issue. For me writing
using namespace mbed;
in the top of my file solved the problem.

ok forget what I said. getting a connection is a gamble. Somtimes it works somtimes not.
Currently I get a very strange output, when I try to scan for all available networks.

Hi, I have the same problem with my Nicla Vision and the WiFi.h library. I tried the same code with a Nano 33 IoT and the WiFiNina.h library and works like a charm. I also updated the firmware as described above, but problem is still there: message, connection failed.

Any solutions or other try-out's?
Thanks Theo

Hi, I have also the same problem with Nicla Vision and WiFi.h library, any suggestion? Someone has found a solution?

Hi, i didn't solve the problem yet. Was well assisted by Arduino support and received a new board as well. First tests just had the same problem, so continued with different HW setup and once have some time left will experiment again. BTW found out that every now and then it connects ... but very rarely.

Same code, different days, I can't connect anymore, no way...before nicla Vision connects also if rarely. I've updated again all: bootloader, firmware and attempting for hours...

Hello!

For those having difficulties connecting Nicla Vision to WiFi please try this:

Update Nicla Vision Bootloader: follow this tutorial

Then, update WiFi firmware as explained in this thread above.

Try WiFi client sketch again.

If you still have the issue please contact Arduino Support.

Hello , I found the solution that works for me.

  1. First of all you have to follow up tomkag advice : ->WiFiFirmwareUpdater

  2. The clue settings is - from the board / com Menu "Select other board and port "

  • look for nicla vision -> you have there 2 versions

Arduino Nicla Vision - Arduino Mbed OS Boards
and
Arduino Nicla Vision - Arduino Mbed OS Nicla Boards

You have to select -> Arduino Mbed OS Nicla Boards

And it works :slight_smile:

Let me know your experience