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

Connecting to Eduroam

Many schools and universities have trouble using the WiFi libraries because their schools implement WPA2 enterprise WiFi networks. The ESP32 WiFi library has methods for connecting using this protocol and the Nano ESP32 works pretty well on them.

What is Eduroam?

Many schools implement the eduroam network which enables scholars to connect using their home institution’s credentials at any other university that uses eduroam. To connect to eduroam, most universities use your school email address, e.g. username@university.edu, as your login, and your email password as your password. This makes it relatively easy to connect a WPA2 Enterprise-enabled Arduino at any university.

To connect to eduroam, you need a few extra credntials:

Make sure to NEVER EVER upload your credentials to a public server. On GitHub, a good solution is to keep a separate file called arduino_secrets.h in your Arduino project, and .gitignore that file, so that it’s never uploaded. This is how all the examples in this repository work.

Here’s the arduino_secrets.h file for a typical eduroam setup:

#define EAP_IDENTITY ""      // use identity@institution.domain in for most institutions 
#define EAP_USERNAME ""      // usually just a repeat of the identity
#define EAP_PASSWORD ""   // your  password
#define SECRET_SSID "eduroam"    // eduroam SSID

To test this, use the sketch WiFI_ESP_eduroam_connection. This sketch will connect, print out the board’s IP address and the SSID, and then print the WiFi signal strength once every two seconds. Depending on the institution, you may find that it takes several attempts for the board to connect.

Once you’re connected, you can use this same basic approach for connecting to eduroam for any application. The following examples should work over eduroam: