Advertisement
hwthinker

Check firmware UNO R4 WiFi

Mar 29th, 2024
806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   Simple code to check WiFi Firmware on Arduino Uno R4 WiFi
  3.  
  4.   Wi-Fi support is enabled via the built-in WiFiS3 library that is shipped
  5.   with the Arduino UNO R4 Core.
  6.   Installing the core automatically installs the WiFiS3 library.
  7.  
  8.   ref: UNO R4 WiFi Network Examples
  9.   https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples
  10. */
  11. #include <WiFiS3.h>
  12.  
  13. void setup() {
  14.   delay(500);
  15.  
  16.   //Initialize serial and wait for port to open:
  17.   Serial.begin(9600);
  18.   while (!Serial) {
  19.     ; // wait for serial port to connect. Needed for native USB port only
  20.   }
  21.   delay(500);
  22.   Serial.println("- Check Arduino Uno R4 WiFi firmware version -");
  23.  
  24.   // check for the WiFi module:
  25.   if (WiFi.status() == WL_NO_MODULE) {
  26.     Serial.println("Communication with WiFi module failed!");
  27.     // don't continue
  28.     while (true);
  29.   }
  30.  
  31.   String fv = WiFi.firmwareVersion();
  32.   Serial.println("Your WiFi firmware version is:");
  33.   Serial.println(fv);
  34.   Serial.println();
  35.  
  36.   if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
  37.     Serial.println("Please upgrade the firmware");
  38.     Serial.println(WIFI_FIRMWARE_LATEST_VERSION);
  39.   }
  40.   else{
  41.     Serial.println("It's the latest version.");
  42.   }
  43. }
  44.  
  45. void loop() {
  46.   // put your main code here, to run repeatedly:
  47.  
  48. }
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement