Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.93 KB

How-to-Create-a-simple-web-server-with-static-IP-and-control-builtinLED-using-WiFiNINA-library.md

File metadata and controls

53 lines (32 loc) · 1.93 KB
title id
How to Create a simple web server with static IP and control builtinLED using WiFiNINA library
360014905179

Overview

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

Requirements

  • WiFi Nina Compatible board
  • Arduino IDE installed in the computer
  • Wi-Fi connection.
  • USB cable to connect the board to the computer.

Steps

  1. Select the board you will be working with.

  2. In the Arduino IDE go to Files → Examples → WiFiNINA and click on SimpleWebServerWiFi example.

  3. Add the Wi-Fi details you wish to connect in the arduino_secrets.h file.

  4. Add IPAddress ip('/*add the selected static IP here*/'); under the included library section like the code below.

    Code Snippet

  5. Make sure you add WiFi.config(ip); inside void setup(), like in the code below.

    Code Snippet

  6. Put in the Wi-Fi details you wish to connect to in the arduino_secrets.h file.

  7. Check the LED details and make the required changes.

  8. Upload the sketch and open the serial monitor once the upload is done.

  9. 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.

  10. 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.

    Page with hypertext for controlling the state of the built-in LED