Week 11 - Interface and Application Programming

Try to work out a simple web app that lets me control lights on my ESP32 via

Never made a webapp before so I'm excited but I think I've learned enough skills through the semester to quickly make one over Thanksgiving. Did not make a PCB because I did this at home, I just bought some simple electronics on the plane and hope that is all I need.

We learned about MQTT in class so I start by following a tutorial about MQTT protocols in ESP32.

For using the MQTT protocol we will need two more libraries WiFi and pubsubclient. I'm not sure which wifi library so i installed Arduino Uno Wifi Dev Ed Library and WifiNINA

These WiFi libraries did not feel right so I do some digging and I found The WiFi library.

Oh no... it says "this library was retired and is no longer maintained." WHAT?? How can they just remove WiFi like that... Neil's hello world webapp code (and so many others) also use this library but this library is gone now?? Ok I have to look for another tutorial.

Found another tutorial which is EXACTLY what I want to do... but it also uses the WiFi library. yikes.

A while later... Ok might’ve found a workaround to still install the retired WiFi library since I can’t find it in the Arduino library manager for Arduino IDE version 2.2.1 There’s an option to download the ZIP file for the library from the library website actually. I downloaded version 1.2.7. To download the library in the IDE, in the menu bar, go to Sketch > Include Library > Add . ZIP Library.

During this process I asked a few friends what they did. The first friend told me they used the WiFi library and see it in the library manager but they are on an older verison of Arduino IDE (1.8.15). Bu then someone else told me they didn't even bother installing the library... and they're on the same Arduino version as me. LOL. I think I overthought this WAY TOO MUCH.

Conclusion on the problem: I think Arduino retired the library because they implemented it directly into their new IDEs because it is such an essential feature. I wasn't able to find documentation on this so spent too much time figuring it out myself.

I based my code off of the second tutorial and my pinout is super simple, D10 on ESP32-C3 to resistor (10 ohm, it was the only one I had...) to LED (cathode) and LED (anode) to GND on ESP

Final code. I'm happy with how fast I was able to implement and debug the code. I removed my WiFi credentials cause you don't need to know my WiFi, just fill in with your WiFi and it works!

Video Demo!


Week 11 Final Thoughts

Yay I learned how to make a simple webapp! Overthought the process again but I'm happy with how my coding skills have developed over this semester. I tried implementing this for my final project for my other design class (4.031) but unforunately the 4 pin LED strips (APA102) have a compatibility issue with the ESP32-C3. I can use another microcontroller or another brand of LED strips.