Even You Can Create an IoT Device

Have you ever wanted to create an IoT device that you could access from anywhere inside your home WiFi network or even reach from outside of your home network? Well, then you’ve come to the right place my friend.

In this post, I’ll show you how to set up a simple web server on your ESP32. If you ever thought that doing so was too hard, then think again, because it’s actually very simple. So… without any further delay, let’s jump right into it.

What is an ESP32?

The ESP32 is a low cost, low power system on a chip, with built in WiFi and integrated dual-mode bluetooth capabilities, created by Espressif Systems. The chip comes in different shapes and sizes, as many companies have adopted the ESP32 into their development chips, so that getting started with your IoT project is quick and easy. No soldering required when using micro controllers with an integrated ESP32. Isn’t that great? 👍

The micro controller that I have been using for my recent word clock project, which you can read more about here, is the Arduino MKR1010 WIFI, which you can pick up for about 30€, either on Amazon or directly from the Arduino store.

With that basic introduction to the ESP32, we can begin our basic IoT project.

Where do I Start?

How do I connect the chip to my local WIFI?

The library that we need is called “WiFiNINA”. Go ahead and install it through the library manager in the Arduino IDE.

Finished? Then we need three lines of code in the setup function of our sketch. The first two lines will be definitions for which WIFI network to connect to. Required are the SSID, the WIFI name, and the password for the network itself.

It’s that simple. If you also want to see the status of the connection of your WIFI connection, you can simply use the following function to see whether the chip is connected and also the IP address of the chip.

Don’t forget to start the serial monitor on a specific baud rate, so that you can see the connection status in the serial monitor.

What if I want to open my own WIFI network?

Now that you know how to connect to your local WIFI network and also create an access point on your ESP32 chip, you can get started with the real functionality for your IoT project.

Software Developer for ING Germany. Expanding my horizon in any way I can. https://felixseip.de

Software Developer for ING Germany. Expanding my horizon in any way I can. https://felixseip.de