Skip to content

Instantly share code, notes, and snippets.

@anecdata
Last active September 3, 2025 20:11
Show Gist options
  • Save anecdata/bddc29b0d21f03c339e8641794addeca to your computer and use it in GitHub Desktop.
Save anecdata/bddc29b0d21f03c339e8641794addeca to your computer and use it in GitHub Desktop.
Web Workflow OTG

Using iOS to place files onto a CircuitPython [CP] device has been possible for several years: https://blog.adafruit.com/2019/09/19/program-circuitpython-devices-with-iphone-ios-13/ https://learn.adafruit.com/use-circuitpython-devices-with-iphone-ipad/copy-edit-paste

However, iOS doesn't support USB CDC, so there is no REPL or serial capability.

Goal:

A "traveling light" configuration for setting up and using CircuitPython Web Workflow https://docs.circuitpython.org/en/latest/docs/workflows.html#web without a large computer. Basic ingredients would be an iPhone, one or two small CP microcontrollers (QT Py ESP32-S2 for example, but perhaps including a device without native-USB, like ESP32-C3 or ESP32), and assorted accessories.

Originally discussed here: https://discord.com/channels/327254708534116352/537365702651150357/1007651444867993610

This configuration could be used away from a user's "home" network, and therefore a way to install or edit a settings.toml file is needed.

Options:

(A) Edit settings.toml on iPhone, MSC it to the native-USB CP device, then serial transfer it from the native USB CP device to the serial-only CP device. Several issues with this approach:

  • USB host is needed for the two devices to communicate over USB (not implemented yet for most ports)
  • even for a native-USB CP device, iOS doesn't like dot files, so there's a challenge in creating a .env file edit: moot point with the CP8 migration to settings.toml
  • a powered adapter is needed for devices advertising > 100mA (one remedy could be a "drop-box" feature on the CP device that looks for a certain file name and moves it to settings.toml)
  • also when the adapter is plugged in, iOS thinks it's a keyboard, so the onscreen keyboard goes away

(B) Use serial to transfer the data from the native-USB CP device to the serial-only CP device. This may be possible, but troubleshooting when the two devices are interconnected could be difficult. Proving it out on devices that already have web workflow enabled could simplify troubleshooting.

(C) Set up a wifi AP on the serial-only CP device in advance and create a settings.toml file or info upload feature always running in code.py

(D) Set up a wifi AP on the native-USB device and allow a station (e.g., non-MSC CP device) to connect to it (e.g., using an HTTP server) and download the settings.toml file or info

(E) Support web workflow over wifi AP adafruit/circuitpython#6795

@anecdata
Copy link
Author

anecdata commented Aug 21, 2025

(F) Create a Personal Hotspot on iPhone (may be better to enable Maximum Compatibility). The Personal Hotspot means you don't have to know in advance the credentials for the various wifi networks that may be available away from your "home" network. Have those credentials pre-loaded into settings.toml (iPhone name SSID + Personal Hotspot password) so the device will auto-connect and allow Web Workflow. Reset the CircuitPython board. On the iPhone, connect to the likely IP address of the device in the browser (e.g., 172.20.10.2 or perhaps an increment above that in the last octet, but you can check this ahead of time), and use Web Workflow as usual, including the websocket-based serial console. Plug the device into the phone if you want direct file access (the phone may think it's a keyboard, and you'll have to paste in commands). Plug the device into power-only nearby if you only want it to be available via mobile browser.

IMG_1808 IMG_1809 IMG_1810 IMG_1811_redact IMG_1812 iPhone Web Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment