Best wifi Arduino

I recently bought and completed some projects with a UNO Rev4
I like the wifi but was kinda disappointed with other features... the real time clock most of all.

Please suggest the best Arduino with wifi.
Thank you

What was the problem with that? Was the time not real enough?

Best in what way? Cheapest? Best WiFi range?

"Best" is subjective. Many people use ESP32. It has lots of resources and runs the FreeRTOS OS so you can also write muti-tasking applications if you're so inclined.

Thank you. I will look into that

Wireless data logger, while constantly connected?
Just use NTP (internet time).
That's just a few lines of code with an ESP32, and accurate to a few seconds.

#include <WiFi.h> // ESP32
unsigned long prevTime;
time_t now; // holds epoch
tm tm; // create time structure

void setup() {
  Serial.begin(115200);
  WiFi.begin("SSID", "PW"); // WiFi credentials
  configTzTime("NZST-12NZDT,M9.5.0,M4.1.0/3", "nz.pool.ntp.org"); // https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
}

void loop() {
  time(&now);
  if (now != prevTime) { // time has changed?
    prevTime = now; // remember
    localtime_r(&now, &tm); // compute local time
    printf("\n%02u:%02u:%02u", tm.tm_hour, tm.tm_min, tm.tm_sec); // print some of the time elements
  }
}

NTP on the R4 should be the same (no experience with the R4).
Leo..

Doesn't the R4 already have an ESP32 on-board?

A bit of Googling suggests that the RTC chip on the R4 is not very accurate. The ESP32 also has one built-in but apparently that is not very accurate either. If all that is needed is a more accurate RTC to track time when the Internet is not connected, then perhaps one option might be to just add a DS3231 module?

When connected to the Internet, using NTP as suggested by Wava is a good choice.

The code I posted keeps time within 1-2 seconds between the default 3-hourly automatic NTP updates. Tested on a Seeed XIAO ESP32C3.
Leo..

Thank you for the code.
Maybe a better question would be which arduino with wifi do you prefer?
I know … depends on the application

But maybe a preference with a reason why??

My current favorite is the Seeed XIAO ESP32C3.

  1. because it's small, and has enough I/O for my needs.
  2. I have a box full of them.
  3. The supplied stick-on aerial has a better range than most modules with a printed or chip aerial.
  4. Simple, I don't mind it's single-core ESP32 (like the ESP8266)
  5. good documentation.
    Leo..

Thank you. Perfectly logical and sensible reasons.

It also has a LiPo battery option with built-in charger.
Leo..

I had a requirement to kept time on an ESP32 when off-line so I wrotes this RTC_NTP_replacement library that makes a DS3231 run like as and NTP client keeping the ESP32 system time in sync with the RTC to within +/-5 ms and ensuring ESP32 system time never goes backwards for consistant timestamps.

The library provides locally served web pages to set the RTC time and the ESP32's time zone for a complete off-line solution.

There is also an option to sync the RTC from NTP if/when internet if available.

User code does not touch the RTC, just uses the usually ESP32 time functions as it would if you were running an NTP client.