Check WiFiNINA Firmware Version
This tutorial will guide you in the process of assessing the firmware release of your Arduino UNO WiFi Rev.2, Arduino MKR 1010 and Arduino MKR VIDOR 4000. It is important to check firmware version against WiFiNNINA library version so that they are both aligned. Having different versions of library and firmware may create compatibility issues.
Hardware required
- Arduino UNO WiFi Rev.2, Arduino MKR 1010 or Arduino MKR VIDOR 4000
Circuit
The board should be connected to the USB port of the computer.
Code
When you load the sketch on the board, it will wait for a serial monitor console to be opened on your computer, then it prints out the result of the check between the expected firmware and the one available. If everything is fine, then you can proceed with your tasks, otherwise you should update the firmware following this update procedure.
The complete sketch is 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
}
See Also
Last revision 2019/04/11 by SM