Error Opening Serial Port in Check WiFiNINA Firmware Version from Serial Monitor

Hi,
Noob question here. I am just starting to work with the Uno WiFi Rev 2 board and I am running the code to check the firmware version of the radio section using the code listed at https://www.arduino.cc/en/Tutorial/CheckWiFiNINAFirmwareVersion. I consistently get “Error opening serial port ‘COM2’. (Port not found)” error when I try to open the Serial Monitor to check the results. I have tried moving to another open port with the same error.

I tried a basic serial monitor test program with the same result. The port works because the sketch downloads, verifies and apparently starts correctly. The code is below for reference.

Suggestions?

Thanks in advance!
Greg

--------- code below ---------
/*

  • This example check if the firmware loaded on the NINA module
  • is updated.
  • Circuit:
    • Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and UNO WiFi Rev.2)
  • Created 17 October 2018 by Riccardo Rosario Rizzo
  • This code is in the public domain.
    */
    #include <SPI.h>
    #include <WiFiNINA.h>

void setup() {

// Initialize serial

Serial.begin(9600);

while (!Serial) {

; // wait for serial port to connect. Needed for native USB port only

}

// Print a welcome message

Serial.println(“WiFiNINA firmware check.”);

Serial.println();

// check for the WiFi module:

if (WiFi.status() == WL_NO_MODULE) {

Serial.println(“Communication with WiFi module failed!”);

// don't continue

while (true);
}

// Print firmware version on the module

String fv = WiFi.firmwareVersion();

String latestFv;

Serial.print("Firmware version installed: ");

Serial.println(fv);

latestFv = WIFI_FIRMWARE_LATEST_VERSION;

// Print required firmware version

Serial.print("Latest firmware version available : ");

Serial.println(latestFv);

// Check if the latest version is installed

Serial.println();

if (fv >= latestFv) {

Serial.println(“Check result: PASSED”);

} else {

Serial.println(“Check result: NOT PASSED”);

Serial.println(" - The firmware version on the module do not match the");

Serial.println(" version required by the library, you may experience");

Serial.println(" issues or failures.");

}
}

void loop() {

// do nothing
}

Do you have the "WiFi101/WiFiNINA firmware updater" window open? If so, try closing it.

The Arduino Uno WiFi Rev2 is special in that, unlike other Arduino boards like the classic Uno, it has a built-in mEDBG programmer that doesn't use a serial port. So even if you have the wrong port selected, the upload will still work!

Thanks for the fast response! That's good to know. Nothing open except the IDE. When I check the port via iTools -> Ports in the IDE it is listed as "COM2 (Arduino Uno WiFi Rev2)" Device Manager on windows shows "mEDBG Virtual Com Port (COM2)" so that looks okay to me.

Other suggestions?

Greg

Try restarting your computer. Sometimes a port will get stuck in a bad state and restarting fixes that.

(embarrassed look on my face). After a reboot all is well. I should know better with Windows. Thanks for helping bet me up and going.

You're welcome. I'm glad to hear it's working now. Enjoy!
Per