Picture

Trial and error: Arduino and Wi-Fi connectivity part 2

Day 7 of trying to control my Arduino over a website. In this blog, I'll try to control an Arduino Uno Wi-Fi Rev2 through a website.

  • # Wi-Fi
  • # Uno Wi-Fi Rev2
  • # Web Server
Picture

After a long time of struggeling with the ESP 8266 Wi-Fi module, I decided to switch to an Arduino with built-in Wi-Fi. According to my research, this board has a more stable internet connection than the other options. Moreover, you can also find better tutorials and demos for this board, it is better supported and there is a good online library (WiFiNINA). The Arduino can serve as either a server accepting incoming connections or a client making outgoing ones.

I started from an example of the WiFiNINA library to set up a basic web server. The html code is sent to the browser via 'client.print()' on the Arduino (all the code can be found on my Github repo). The html code is very simple.

Picture

Now this is just to turn a light off and on, but later I want to use this way to send custom text to the Arduino. Everyone connected to the same network can then browse to the IP address and see the following:

Picture

This was the first solution that succeeded, I was also able to control the light via my cell phone (or PC). The big disadvantage is that you have to be on the same internet network and you have to surf to the local IP address of the Arduino. So since I want to send messages from other houses or from my 4G this solution will never be sufficient. But at least I already managed to connect my Arduino to a Wi-Fi network.

In part 3 I will try to use my Arduino as a Wi-Fi Client instead of a Web Server.

Picture