In the configuration pictured below, multiple identically-configured Adafruit CircuitPython 8.0.0-beta.0 on 2022-08-18; Adafruit QT Py ESP32S2 with ESP32S2
are used to create a Redundant Array of mDNS http Servers. The devices could be physically together or scattered around, as long as they are on the same LAN. Once configured, no USB connection is necessary for operation.
Each is running CircuitPython 8 Web Workflow: https://docs.circuitpython.org/en/latest/docs/workflows.html#web
Web Workflow automatically connects to a Wi-Fi Access Point based on credentials in a /.env
file in the root of the CIRCUITPY
drive filesystem, and creates an HTTP Server (port can be changed with CIRCUITPY_WEB_API_PORT=
in the /.env
file; it's port 80 by default).
In code.py
, run an HTTP Server using (for example):
https://docs.circuitpython.org/projects/httpserver/en/latest/api.html
Make sure that the ports are different between the Web Workflow HTTP Server and the code.py
HTTP Server (e.g., set the code.py
HTTP Server to listen on port 8080).
This allows access to the Web Workflow HTTP Server for the CIRCUITPY
filesystem and the code.py
HTTP Server for arbitrary response bodies or file serving.
Further, since any one of these devices may respond to http://circuitpython.local:8080
due to automatic mDNS configuration as part of Web Workflow, there is redunancy on the LAN for the features of the code.py
server. Typically, hosts will cache the IP address associated with the .local
name for about two minutes, so access at any arbitrary time could get a response from any one of the RADS devices. RADS devices can be added or taken away (or go down) at will, but as long as one is up the server features are available.