GurgleApps Raspberry Pi Pico Web Server Gives You Control From Any Device

The GurgelApps Team is back with another cool Raspberry Pi Pico W project, a Pico W based web server. But this project not only serves web pages, it can also run Python code on Pico W via a web interface.
The web server can be accessed from any device with a web browser, either from the local network or from an external network. The project is coded in MicroPython and at a basic level he works with two files. Wi-Fi configuration details are stored in config.py and the project code is stored in main.py (MicroPython autoruns on power up).
The neat part of this project is the abstraction. Rather than bogging the user down with complexity, the team created her own web server module (gurgleapps_webserver.py) that the project code imports and uses.
Abstracting the code is a good way to familiarize users with the project/language before pulling back the curtain to reveal the complexities of a powerful language.
GurgleApps demonstrates a web server by bundling a project that controls Pico’s onboard LEDs using a fairly responsive web interface. By creating a custom URL, advanced users can directly access the functionality and control the LEDs. This advanced approach also returns a JSON object to the user. In this case, this indicates the current delay (blinking on/off) of the LED and the current state of the LED. Other sample projects include frequency generators used in physics experiments to visualize sand (or polenta) oscillations. Frequency data is also displayed on a small OLED screen.
Next, the team will detail how to create your own functions that can be called via the web interface. This detail is the selling point of this project—you can create his web interface for your robot and view real-time sensor data on a web page without too much code.
The user interface is created using HTML and CSS. These files are stored in the www directory of your project’s Pico download. Changing the user interface graphics and layout is a quick and easy task for most learners.
Great to see the GurgleApps team building simple yet powerful projects around our favorite microcontrollers. For more information on the project, GurgleApps Blog and find all this raw code GitHub repository.