# Play and test apps over Mio Wi-Fi

The September Mio Make v0.1 can install an app from a phone once the base is on the board. Your phone requests the list from the Mio. The Mio asks the directory over your home Wi-Fi and sends the results back to the phone. Both connections stay active while you browse or install.

## On the phone

1. Turn on a Mio with the base installed. A fresh base opens **Hello, Mio Make!**, a button tester with directions for loading and making apps. Tap A or B to see its counter change. Once you install an app, that app starts automatically. If the Mio is asleep, tap **A** to wake it. For Wi-Fi, fit the external 2.4 GHz antenna while the board is unpowered and use a charged battery.
2. Hold **A+B** continuously for 15 seconds. When the release prompt appears, let go of both buttons in either order. Scan the Wi-Fi QR on the screen or join the displayed network using its password. If the setup page does not open, visit **http://192.168.4.1/**. Stay on this connection if the phone reports that the network has no internet.
3. On first use, choose **Connect Mio to home Wi-Fi**. Enter a 2.4 GHz network and return to Apps. The Mio remembers the credentials. Your phone talks directly to the Mio, and the Mio uses its own connection to the router for HTTPS downloads. The access point follows the router’s channel. If the setup page disconnects during setup, rejoin the same Mio network.
4. Browse or search by title or creator, or enter a QuickCode. Open the listing, read the instructions and controls, then choose **Install on this Mio**. A successful install restarts directly into the selected app. On the next normal boot or wake, that app starts again. Powering off while browsing or downloading returns to the previously selected app on the next start.
5. Open **Device settings** for brightness, dimming, display off, sleep, Wi-Fi and **Sleep now**. Settings and the installed app work without upstream internet. Browsing and installs require it. Release the portal using **Return to current app**, or press A on the device.

Opening Wi-Fi requires a battery reading of at least **3.70 V**, including on USB. Apps built with runtime `0.7.1-hotswap` show the reason if the switch to the library fails. Press **B** to retry or **A** to return to the app. The matching base also offers a retry if it cannot start the access point or setup page. With `0.7.0-hotswap`, the same failures can take you back to the app without a message. If that happens, charge the battery and try the hold again.

A public code such as `P-000-001` identifies a release. New unlisted projects use eight letters. Type them in either case. Previously issued T-codes still work. Anyone with that code can install its active revision. A newer revision or revocation during download can require a fresh lookup. Each installation request names an exact release and checks its size and SHA-256 before selection.

## Test an unpublished app with your agent

Connect your agent to **https://www.miomake.com/mcp** and choose **No authentication**. A fresh session can begin with “Help me test this app privately on my Mio. Give me its unlisted QuickCode.” The agent needs internet access. The phone can join the Mio’s Wi-Fi after the code is ready.

Call `open_test_workspace` once and save the returned `workspaceKey` with the maker’s private project files. Choose a stable project slug such as `moon-hop`. A later session needs the saved key and slug to update the same code or revoke it. Give testers only the private QuickCode. Anyone with it can install the active revision. Unlisted tests stay out of the public directory.

**Starting from SDK source on a phone**

1. Call `build_app_source` with the workspace key, an SDK app and a new request UUID. Retry that request with the same UUID and input. For a later revision, pass the creation ID and the previous version.
2. Poll `get_app_build` with the workspace key and the exact `requestId` and `revisionId` from the receipt.
3. When the build is ready, call `share_built_app` with that receipt, the workspace key, the listing, the project slug and `visibility: "test"`. Give the maker the returned `quickCode`.

**Starting from a compiled USB install file**

1. In the toolkit, prepare the compatible app with `node scripts/library.mjs prepare install.json listing.json`. Omit the username. The output contains the listing, size and hashes. The publishing guide has an example listing. [Listing fields](https://www.miomake.com/docs/library.md)
2. Add `workspaceKey` and `project` to the prepared JSON and call `test_app` on the same MCP. Pipe the tool’s complete structured response privately to `node scripts/library.mjs upload install.json listing.json` on standard input. A terminal-capable agent can also redirect stdin from an owner-readable temporary file (mode `0600`) and remove it after use. Keep the grant out of chat and shell arguments.
3. Give the maker the `quickCode` from the upload result. This path also works for compatible native apps built locally with the firmware driver builder.

Use the same workspace key and slug when testing a new revision. The existing code moves to the new build when its upload succeeds. Call `revoke_test_code` with those two values to disable future downloads. To publish a hosted test, reuse the exact build receipt and call `share_built_app` with public visibility and the approved username and listing. For a local test, publish the same compiled install file. The test code can continue to follow later revisions. An approved release’s searchable `P-…` code identifies that exact release. [Public publishing instructions](https://www.miomake.com/docs/library.md)

### Hosted compiler configuration

For a hosted source build, configure the publisher and the existing workshop with the same server-only `WORKSHOP_PUBLISHER_BUILD_SECRET` (at least 32 characters), the workshop’s current runtime and isolated compiler contract, and its ordinary queue, storage, quotas and worker settings. The gateway is a fixed HTTPS endpoint on the Mio Make workshop. When the workshop uses private Site dispatch, set the site-scoped service credential in the publisher’s production environment as `WORKSHOP_PUBLISHER_SITE_TOKEN`. It authenticates the service request, derives a private owner namespace, and submits a saved-source build. The public build receipt carries no service credential. The device has no account or signing-key setup. The public catalog consumes the same verified application bytes independently of how publisher attribution evolves.

## USB install and recovery

Open the desktop USB installer, choose **Restore Mio Make base**, confirm the physical September board and install. On an unresponsive board, hold BOOT, tap RESET and release BOOT, then use the installer’s recovery connection. A restore reinstalls the included starter and resident and clears the boot selector. It preserves the standard NVS settings, saved counters and storage regions. Custom firmware can use different regions. A base restore over a custom partition table requires explicit acknowledgement and may overwrite custom data.

A compatible USB app installed on a managed board writes to the inactive app slot. Classic USB installations continue to work. **Replace the base with standalone USB firmware** explicitly selects the direct development-board workflow. Smaller native images using the linked hot-swap runtime can use either transport with byte-identical application data. The browser USB package also includes its bootloader and table.

In a local checkout, run `npm run welcome:release` followed by `npm run base:build` and `npm run site:build`. For serial recovery, first use `npm run devices` and confirm the physical board and serial number. Then use `python3 scripts/device.py restore-base --port PORT --expected-serial SERIAL --confirm-board mio-make-v01-camera-free-20260929`. This uses the bundled recovery release and the existing chip, memory and protection checks.

## Flash layout and trial behavior

| Region | Offset | Capacity |
| --- | --- | --- |
| NVS | 0x009000 | 24 KiB |
| App A | 0x010000 | 2 MiB |
| App B | 0x210000 | 2 MiB |
| Resident installer | 0x410000 | 1,984 KiB |
| Boot selector | 0x600000 | 8 KiB |
| Storage | 0x610000 | 10,176 KiB |

The stock rollback-capable bootloader uses OTA indices 0, 1 and 2. The resident saves the identity of the previously selected app, writes the inactive slot and checks its bytes before selecting it. The app core waits for display setup, input sampling, a presented frame and subsequent healthy loops before confirming a trial. A reset or watchdog fault during an unconfirmed trial allows the bootloader to return to the verified resident. The resident consults the saved slot before display or Wi-Fi startup. If that previous app also fails, the resident stops retrying and asks for USB recovery. USB trials keep the previous confirmed app’s selector record. A program that hangs or fails after it has confirmed may need a USB restore. Native code has full hardware access. The shared core supplies product behavior for compatible apps.

Run `npm test` and `npm run board:verify`. For a bootloader replay, run `python3 scripts/check-base-boot.py /path/to/qemu-system-xtensa` with Espressif’s ESP32-S3 emulator. The script builds a temporary flash image from the recovery release and exercises actual boot-selector transitions. Add `--gdb` with an Xtensa GDB path and `--nvs-python` with an IDF environment’s Python to run the resident, test its NVS journal, and verify that the saved previous app executes in both slot directions. That replay supplies a 4.0 V ADC reading and single-I/O reads to accommodate QEMU’s peripheral model. Board-level acceptance still requires phone pairing, channel changes, interruption during download and trial boot, sleep/wake, and an ESP-NOW match with two boards.
