WiFi Web Server

In this example, you will use the WiFi module of your board to create a simple Web server. Using the WiFi 1010 library, your device will be able to answer a HTTP request received from the WiFI connection. After opening a browser and navigating to your WiFi's IP address, your board will respond with just enough HTML for a browser to display the input values from all six analog pins.

This example is written for a network using WPA encryption. For WEP or WPA, change the Wifi.begin() call accordingly.

Hardware Required

Circuit

The WiFi module is integrated on your board and you don't need any special circuitry to get this tutorial to work.

MKR WiFi 1010 Arduino MKR WiFi 1010

Vidor Arduino MKR VIDOR 4000

UNO wifi Arduino UNO WiFi Rev.2

Please note: these three boards use dedicated pins to communicate and select the WiFi module, therefore you have no restriction in the usage of the available digital pins connected to the header pins.

Code

You should have access to a 802.11b/g wireless network that connects to the internet for this example. You will need to change the network settings in the sketch to correspond to your particular networks SSID.

For networks using WPA/WPA2 Personal encryption, you need the SSID and password. The shield will not connect to networks using WPA2 Enterprise encryption.

WEP network passwords are hexadecimal strings known as keys. A WEP network can have 4 different keys; each key is assigned a "Key Index" value. For WEP encrypted networks, you need the SSID, the key, and key number.

See Also:

Last revision 2018/07/12 by SM