Wifi_Examples

Examples for Arduino WiFi-enabled boards: MKR1000, MKR1010, Nano 33 IoT, Nano ESP, Uno Rev 4 WiFi, and others

Library Include line
Credentials Header file
WiFi Connection
Arduino HTTP Clients
HTTP Servers
TCP and UDP Examples
OSC Examples

This project is maintained by tigoe

Wifi Examples

These examples are for the Arduino WiFi libraries. These examples will work with: the Arduino MKR1000 board; the MKR1010; Nano 33 IoT board; Uno WiFi rev 2 boards; the Uno R4 WiFi board; and the Nano ESP32 board.

The libraries for these boards should be API-compatible with each other in these examples, though some will have features that others do not. Any library-specific examples in this repository are noted as such.

Many of these examples are also compatible with the ESP8266WiFi library, which has a similar API to these libraries.

Many of these examples also use the ArduinoHttpClient and Arduino_JSON libraries.

Library Include line

All of these examples require you to include the WiFi library for their board at the top of the code. Not all of the examples have been updated for the newest boards, however. Here’s a guide to including the right library:

Board Library #include line
MKR1000 WiFi101 library #include <WiFi101.h>
MKR1010, Nano 33 IoT, and Uno WiFi rev 2 WiFiNINA library #include <WiFiNINA.h>
Uno R4 WiFi WiFiS3 library #include <WiFiS3.h>
Nano ESP32 WiFi library for the Nano ESP32 #include <WiFi.h>

Credentials Header file

All of these examples expect you to add an arduino_secrets.h header file to the sketch with the following information:

#define SECRET_SSID "" // your WiFi access point name
#define SECRET_PASS "" // your WiFi password

Some sketches will add other constants to that file as well. These files are ignored by the git repo using .gitignore.

WiFi Connection

Arduino HTTP Clients

HTTP Servers

TCP and UDP Examples

OSC Examples