Remotely Controlled Microcontroller From a Browser

Summary of Remotely Controlled Microcontroller From a Browser


This project lets you control a PIC32-based Digilent BasysMX3 microcontroller from a web browser via an HTTPS Python server and an ESP32 Pmod. A simple Python HTTPS server serves a webpage with buttons that update a hidden file; the ESP32 connects over SSL, GETs that file, and changes LEDs accordingly. Repository includes MPLabX project and server code; you must set the server IP/port in simpleServer.py and the ESP32 target IP in main.c and provide a server.pem certificate.

Parts used in the Remotely Controlled Microcontroller From a Browser:

  • Digilent BasysMX3 development board (PIC32)
  • Pmod ESP32 (ESP32 WiFi/Bluetooth module)
  • Computer running Python with simpleServer.py
  • server.pem SSL certificate file
  • MPLabX IDE project files (BasysESP32.X)
  • USB connection for in-system programming/debugging
  • WiFi network for ESP32 connectivity

Interface with a microcontroller from a web browser, using HTTPS and a simple Python server.

Remotely-Controlled-Microcontroller-From-a-Browser

Story

Quick Solutions to Questions related to Remotely Controlled Microcontroller From a Browser:

  • How does the browser interface communicate with the microcontroller?
    The browser talks to a Python HTTPS server; button presses update a hidden file the ESP32 then GETs over SSL to change LEDs.
  • Can I visit the server address from my phone or laptop?
    Yes; visit https://server_ip:port (for example https://192.168.1.107:4443) though the browser may warn about the local certificate.
  • What files must I modify to use my own IP address?
    Edit simpleServer.py (line 95) to set the server IP/port and edit main.c (line 30) in the MPLabX project to point the ESP32 to that IP.
  • Does the project include an SSL certificate?
    The repository includes a server.pem, but the article recommends creating your own server.pem following the linked instructions.
  • How does the ESP32 determine what to do with the LEDs?
    The ESP32 establishes an SSL connection to the Python server and issues an HTTP GET for the hidden file; it modifies LED behavior based on that file's contents.
  • Do I need to configure WiFi in code for the ESP32?
    The article suggests connecting the ESP32 to WiFi beforehand manually, though the MPLabX project includes a function to connect to any WiFi network if desired.
  • Where are the project source files located?
    The MPLabX project files are in the repository under BasysESP32.X and the Python server files are also included in the repo.
  • What web programming is required to recreate the webpage?
    Only basic HTML and CSS were used in this example; more complex webpages can be added but are not provided.

About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.