
How it works
The UNO R4 WiFi runs your sketch on its RA4M1 and reaches Wi-Fi through the board's companion radio module, using the official WiFiS3 library as on the real board. WiFi.begin("BreadboardNet") joins the bench's virtual open network. client.connect() opens a TCP connection to api.open-meteo.com on port 80, and the sketch sends a plain HTTP/1.1 GET for the current weather at latitude 51.5 and longitude -0.12, which is London. It then copies the response to Serial byte by byte, up to 4,096 bytes, and stops waiting after 15 seconds.
By default the sandbox answers the sketch’s weather request locally, so the loaded bench can run it offline and without an account. With Real internet on, the request goes through Breadboard's secure gateway, which allows only approved destinations and adds HTTPS on the way out. The sketch uses the ordinary WiFiClient API in both modes, not WiFiSSLClient, so the code does not change when you go live.
What to watch
Serial prints UNO R4 HTTP: sandbox by default and a line about Real internet. In Sandbox, Serial prints the response beginning with HTTP/1.0 200 OK and ends with HTTP request finished. The request runs once, from setup(); loop() is empty.
What's on the bench
- Arduino Uno R4
The code
This Arduino C++ sketch lives in Code; sign in and press Compile & upload to build real firmware for the emulated board.
// SPDX-License-Identifier: MIT // UNO R4 WiFi: one HTTP request using the public WiFiS3 client. // Sandbox is the default. In the board's Wi-Fi inspector, signed-in Pro // users can select Real internet, give consent, then restart this sketch. // The secure gateway supplies HTTPS to the approved destination. This // sketch uses WiFiClient, not WiFiSSLClient or native board TLS. #include <WiFiS3.h> const char HOST[] = "api.open-meteo.com"; const char PATH[] = "/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"; WiFiClient client; void setup() { Serial.begin(115200); Serial.println("UNO R4 HTTP: sandbox by default"); Serial.println("Real internet: select the board, enable it in Wi-Fi, consent, then restart."); if (WiFi.begin("BreadboardNet") != WL_CONNECTED) { Serial.println("Wi-Fi join failed"); return; } if (!client.connect(HOST, 80)) { Serial.println("HTTP connection failed"); client.stop(); return; } client.print("GET "); client.print(PATH); client.print(" HTTP/1.1\r\nHost: "); client.print(HOST); client.print("\r\nConnection: close\r\n\r\n"); const unsigned long started = millis(); unsigned int printed = 0; while (millis() - started < 15000 && (client.connected() || client.available())) { while (client.available() && millis() - started < 15000) { const int value = client.read(); if (value >= 0 && printed < 4096) { Serial.write(static_cast<uint8_t>(value)); printed++; } } delay(1); } const bool timedOut = millis() - started >= 15000; client.stop(); Serial.println(); Serial.println(timedOut ? "HTTP response timed out" : "HTTP request finished"); if (printed == 4096) Serial.println("Serial output limited to 4096 bytes"); } void loop() {}
Firmware licence
Notice: this firmware uses the LGPL-licensed Arduino core library
arduino-unor4wifi-http-gallery.bin is statically linked with ArduinoCore-renesas 1.6.0, in Breadboard's port of its UNO R4 WiFi variant to Renesas FSP 5.3.0. Parts of that core are licensed under the GNU Lesser General Public License, version 2.1 or (at your option) any later version ("the Library"). Breadboard distributes this firmware under terms that permit you to modify the work for your own use and to reverse engineer it for debugging such modifications.
- Relink package: arduino-unor4wifi-http-gallery-relink.zip (385 KB)
- Corresponding source: ArduinoCore-renesas-1.6.0-fsp53-source.zip (3.7 MB)
- Licence texts and relink instructions
Try this
- With a verified Pro account and the gateway enabled, select the board, choose Real internet under Internet access in Wi-Fi, then press Restart. The response now comes from the live Open-Meteo service.
- Open Code and change latitude and longitude in PATH to your own city, then sign in and press Compile & upload. With Real internet on, the response holds that city's current weather.
- Open the Wi-Fi sniffer and press Restart to follow the board's packets as it joins the network and sends the request.



