This tutorial is about making a web server with static IP, using the web server example from the WiFi NINA library. The boards which support the WiFi Nina library are:
- MKR 1010
- UNO WiFi rev2
- Nano 33 IoT
- MKR VIDOR 4000
What you’ll learn
- How to create a web server using static IP
- How to manage pins in the board using the web server
- WiFi Nina Compatible board
- Arduino IDE installed in the computer
- Wi-Fi connection.
- USB cable to connect the board to the computer.
Select the board you will be working with.
In the Arduino IDE go to Files → Examples → WiFiNINA and click on
Add the Wi-Fi details you wish to connect in the
IPAddress ip('/*add the selected static IP here*/');under the included library section like the code below.
Make sure you add
void setup(), like in the code below.
Put in the Wi-Fi details you wish to connect to in the
Check the LED details and make the required changes.
Upload the sketch and open the serial monitor once the upload is done.
The serial monitor shows the IP address board is connected to and also the link which you have to copy and paste in the browser.
Once you paste the link in the browser you will get a page that looks like the one in the image, where you can control the state of the built-in LED.