Can I do this with a UNO R4 Wifi? (Add ESP8266 routines)

I have a couple of R4 wifi boards set up in my house to monitor various sensors, etc. Each of them acts as a webserver so that I can view nice webpages with PIN value displays, I can command PINs on/off and set values via the webpages as well. Each one also runs a UDP client to hit up an NTP server at startup with hourly refreshes. They also run some code to manipulate sensor values, set/clear alarm status, etc. with further enhancements and expansion planned.

I now want to add live PIN value graphing to the webpages these devices serve up. Almost all of the code examples I've seen (and I've looked at a lot) are designed around ESP8266 devices.

So a couple of questions:

  1. With what these devices are already doing, am I asking too much to also get them to serve up live graphs?
  2. If I am able to do this, does anyone know of a webserver or websockets library that can be used with these particular boards, to achieve the data transfer I'll need?

The library.properties file in the library you are using will tell you which boards it is compatible with. Many are * for ALL.

Are you referring to this in the library.properties file:

architectures=esp8266

So doing some more reading here on the forum, apparently the R4 wifi doesn't have the capability to run ESP routines. Bummer.

Why would it when it doesn't use an ESP32 processor, but that does not mean that there are not equivalent libraries for the R4 WiFi

Have you looked at the examples for the R4 WiFi in the IDE ? They will show when you set the target board to R4 WiFi

Yes, that's where I got much of the code for the existing webserver and NTP client.

All of that works fine... what I can't seem to find any examples for, specifically for the R4 wifi, is adding the auto-updating chart data via Chart.js, something like this example for the 8266):

Real-time graph

Yes.

Examples are to point you in the right direction with more in-depth for basics, not every use-case is in the examples, if they were coders would be unemployed.

Although the Uno R4 WiFi has an ESP32 onboard, this isn't programmed directly, but controlled via a "bridge" from the Renesas RA4M1. For this reason, the Uno R4 WiFi has it own specific WiFi library called WiFiS3. This means that code written specifically for the ESP8266 or the ESP32 will not work directly on the Uno R4 WiFi. It would require re-writing to work with the WiFiS3 library.

There is also a third party library that might be useful here:
https://github.com/cotestatnt/HTTPWebServer
Its also available and can be installed from within the Library Manager in the Arduino IDE. haven't tested it myself so can't vouch for its usefulness.

In either event, whatever code you already have will likely need to be re-written, so its not going to be as straightforward as simply copying an example for the ESP8266 or ESP32.

The IDE will present you with examples for the board selected as the target.

You topic has been moved to a more suitable location of the forum. You're talking about the Arduino Uno R4 WiFi but posted in UNO WiFi Rev2 - Arduino Forum.

Thank you. That's very helpful. Much appreciated!