From 17421407f781629c557dc59dbd1e76d27f77465a Mon Sep 17 00:00:00 2001 From: engmung <122682380+engmung@users.noreply.github.com> Date: Tue, 22 Sep 2026 20:26:59 +0900 Subject: [PATCH 1/2] firmware: the panel is a network of its own - a hotspot, and the console on it. A panel with no known Wi-Fi in reach raises an access point named after itself (patternflow-a1b2, WPA2, password "patternflow" until changed), and the whole console is at http://192.168.4.1/ on it: patterns, knobs, the Wi-Fi page to add the next place's network, updates. Modes on /wifi and /api/hotspot: auto (the default - up fifteen seconds after the last link, down once a network is joined and nobody is on it), always, off. Status carries a hotspot object; the NETWORK screen shows the name while the hotspot is what there is. Core, not a feature: Wi-Fi is the device's. The bench ran six rounds before the phone loaded a page in under a second, and each round is a line in core_hotspot.h's header: - the channel comes from a scan (least loaded of 1/6/11), never a fixed one - channel 1 sat under three -33 dBm networks and the SSID flickered; - every console module waited for WL_CONNECTED before registering, so on the hotspot a phone got an address and port 80 never opened - PatternflowWifi::linkUp() is the condition now, for the core pages and the audio, microphone, clock and MQTT pages, and the hotspot raises the same link edge the station does; - a station interface that is merely present - scanning, retrying, idle - drags the AP's transmit to a crawl (a 13 KB page cut at 5.7 KB after 20 s), so alone the radio runs AP-only and the station comes back for a rare probe with nobody connected, or when credentials arrive; - the 13 dBm transmit cap made a phone beside the panel take 4-9 s per 10 KB page and under a second at full power: the cap is retired, the owner's call, conformance to be handled elsewhere; - answering the phone's internet probe with a 204 put a Samsung into its limited-connectivity state and it dropped the network; a DNS responder on the hotspot answers every name with the panel so the verdict comes in a second, and the probe gets the console's ordinary 404; - the web server waits one second, not five, for a connection that sends nothing - a browser's spare connections were holding the real requests. Verified on the bench board: home network joined at full power with the hotspot down in auto; always brings it up beside the station on its channel and auto drops it; the API's validation; the /wifi section. In the field scenario (no network) with the user's phone: joins first time, console pages 0.5-3 s, DNS answered, no drops over the session. Co-Authored-By: Claude Fable 5.1 --- AGENTS.md | 2 +- BUILD_GUIDE.md | 1 + CHANGELOG.md | 7 + FEATURE_GUIDE.md | 6 + docs/rest-api.md | 24 +- firmware/patternflow/console/wifi.html | 47 +- .../features/audio/core_audio_ws.h | 2 +- .../features/audio_in/core_audio_in_http.h | 2 +- .../features/clock/core_clock_http.h | 2 +- .../features/mqtt/core_mqtt_http.h | 2 +- firmware/patternflow/net_config.h | 51 +- firmware/patternflow/patternflow.ino | 30 +- firmware/patternflow/src/core_display_http.h | 2 +- firmware/patternflow/src/core_home_http.h | 2 +- firmware/patternflow/src/core_hotspot.h | 422 ++++++++++++++ firmware/patternflow/src/core_knobs_http.h | 2 +- firmware/patternflow/src/core_net_task.h | 1 + firmware/patternflow/src/core_ota.h | 2 +- firmware/patternflow/src/core_patterns_http.h | 2 +- firmware/patternflow/src/core_send.h | 4 + firmware/patternflow/src/core_status_http.h | 3 +- firmware/patternflow/src/core_web_update.h | 2 +- firmware/patternflow/src/core_wifi.h | 78 ++- firmware/patternflow/src/core_wifi_http.h | 2 +- .../patternflow/src/webserver/WebServer.h | 7 +- firmware/patternflow/src/wifi_index.h | 537 ++++++++++-------- firmware/toolchain/console_serve.py | 17 + 27 files changed, 993 insertions(+), 266 deletions(-) create mode 100644 firmware/patternflow/src/core_hotspot.h diff --git a/AGENTS.md b/AGENTS.md index 847d5b1f..e85dc47d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ It is standalone (not Eurorack), powered from a 5 V power bank through a screw t ## Repository map - `docs/` — contracts and long-form docs: `EDITIONS.md` (the firmware seam — read it before touching firmware), `rest-api.md` / `osc-spec.md` / `midi-spec.md` / `audio-ws-spec.md` (wire contracts integrations are built against), `pfst-v2-spec.md` (show files), `panel-compatibility.md`, `RELEASING.md`, `SERVICES.md` (production server ops), the assembly map (`docs/assembly/`), the manifesto, investigations, and media (build-guide images in `docs/build-guide/`). Root-level guides: `BUILD_GUIDE.md` (the **v3.0 board**), `BUILD_GUIDE_v2.md` (legacy v2.x board), `PATTERN_GUIDE.md` (community → deck → Pattern Lab → device), `FEATURE_GUIDE.md` (writing a firmware feature or edition), `AUDIO_GUIDE.md` (sound into the panel). The live roadmap is patternflow.work/journal and the `/roadmap` page. -- `firmware/` — PlatformIO/Arduino code for the ESP32-S3. Main sketch folder: `firmware/patternflow/` with `patternflow.ino`, `config.h` (pin mappings, brightness, limits, LED calibration), `net_config.h` (Wi-Fi / Improv / OTA / self-update defaults and the lane scale — core only; a feature's own tunables live in `features//_config.h`, and settings TUNE a feature, they never add one; per-device secrets in gitignored `patternflow_secrets.h`), and `pattern_registry.h` (function-pointer pattern table; compiles in Origin alone — the rest of the curated set ships as the Basics pack). Shared engine code lives in `firmware/patternflow/src/` (`core_display.h` HUB75 driver, `core_encoders.h`, canvas/color/math/noise helpers, Wi-Fi/OTA/web-console modules) — core only: OSC, audio, MQTT, weather, shows, MIDI and the clock all live in `features/`. `firmware/patternflow/abi/` is the frozen host ⇄ module contract. Curated patterns live in `firmware/patternflow/presets/` (`preset_origin.h`, `preset_wave_saw.h`, dated presets), each using its own pattern namespace; user patterns are `.pfm` modules uploaded to the device over Wi-Fi, built from `firmware/modules/` via `firmware/toolchain/build_module.py` (the old `custom1.h`–`custom3.h` root slots are gone). Features attach through `firmware/patternflow/features/` (named `addons/` until 2026-08-30; legacy spellings are shimmed for out-of-tree bundles — see docs/EDITIONS.md) — a directory and a descriptor of function pointers, with the core naming none of them (see its README). `firmware/bundles/` names firmwares built from the same tree (the shelf editions `audio` and `performance`, plus `clock` and `midi`, compositions the tree keeps buildable but does not publish; the default build has no bundle): two files each, saying which features compile in and what the build calls itself; `firmware/bundles/build.sh` builds the default or a named one, `shelf.sh` stages a publishable image. Device console pages are plain HTML in `firmware/patternflow/console/`, spliced into `*_index.h` by `firmware/toolchain/console_pages.py`. Tooling lives in `firmware/toolchain/` (repo-level scripts) and `firmware/patternflow/toolchain/` (PlatformIO `extra_scripts`, which must stay sketch-relative). Also: `firmware/encoder_test/` (standalone encoder diagnostic) and `firmware/CUSTOM_PATTERNS.md` (pattern authoring guide). +- `firmware/` — PlatformIO/Arduino code for the ESP32-S3. Main sketch folder: `firmware/patternflow/` with `patternflow.ino`, `config.h` (pin mappings, brightness, limits, LED calibration), `net_config.h` (Wi-Fi / Improv / OTA / self-update defaults and the lane scale — core only; a feature's own tunables live in `features//_config.h`, and settings TUNE a feature, they never add one; per-device secrets in gitignored `patternflow_secrets.h`), and `pattern_registry.h` (function-pointer pattern table; compiles in Origin alone — the rest of the curated set ships as the Basics pack). Shared engine code lives in `firmware/patternflow/src/` (`core_display.h` HUB75 driver, `core_encoders.h`, canvas/color/math/noise helpers, Wi-Fi/OTA/web-console modules, the hotspot in `core_hotspot.h`) — core only: OSC, audio, MQTT, weather, shows, MIDI and the clock all live in `features/`. `firmware/patternflow/abi/` is the frozen host ⇄ module contract. Curated patterns live in `firmware/patternflow/presets/` (`preset_origin.h`, `preset_wave_saw.h`, dated presets), each using its own pattern namespace; user patterns are `.pfm` modules uploaded to the device over Wi-Fi, built from `firmware/modules/` via `firmware/toolchain/build_module.py` (the old `custom1.h`–`custom3.h` root slots are gone). Features attach through `firmware/patternflow/features/` (named `addons/` until 2026-08-30; legacy spellings are shimmed for out-of-tree bundles — see docs/EDITIONS.md) — a directory and a descriptor of function pointers, with the core naming none of them (see its README). `firmware/bundles/` names firmwares built from the same tree (the shelf editions `audio` and `performance`, plus `clock` and `midi`, compositions the tree keeps buildable but does not publish; the default build has no bundle): two files each, saying which features compile in and what the build calls itself; `firmware/bundles/build.sh` builds the default or a named one, `shelf.sh` stages a publishable image. Device console pages are plain HTML in `firmware/patternflow/console/`, spliced into `*_index.h` by `firmware/toolchain/console_pages.py`. Tooling lives in `firmware/toolchain/` (repo-level scripts) and `firmware/patternflow/toolchain/` (PlatformIO `extra_scripts`, which must stay sketch-relative). Also: `firmware/encoder_test/` (standalone encoder diagnostic) and `firmware/CUSTOM_PATTERNS.md` (pattern authoring guide). - `hardware/` — Hardware designs. `case/` (Blender source in `source/`, STLs by printer bed size, `legacy_v2/` for the v2.x board), `pcb/` (KiCad 10.0 source, Gerbers per revision, schematic PDF), `bom/` (`bom_v3.9.csv` — **the BOM source of truth**; the guide's table is derived from it. `bom_v3.0.csv` is kept for the previous board). - `web/` — Next.js site at patternflow.work: landing page (`/`, `/pattern`, `/build`, `/inside` are tabs of one view), Pattern Lab (`/pattern-lab`), community (`/community/**`, SQLite + Drizzle + Better Auth, only on the Pi deployment), browser flasher (`/flash`), the edition shelf (`/editions`; `/variants` redirects there), the feature catalogue (`/features`, reels per feature), device update handoff (`/update`), journal, roadmap. `lib/pattern/` is the pattern runtime and annotations, `lib/lab/` the Pattern Lab, `lib/community/` the community, `lib/ai/` the Gemini client. Architecture doc: `web/ARCHITECTURE.md`. The JS presets in `web/src/lib/presets/` are the source of truth for firmware preset headers. - `tools/` — desktop-side helpers: `patternflow-audio-extension` (the browser audio-react extension — also the authoring source the device's `/audio-in` console page is assembled from), `patternflow-audio-android` (phone capture app), `rtpmidi-probe`. diff --git a/BUILD_GUIDE.md b/BUILD_GUIDE.md index b5810190..39d6f5c9 100644 --- a/BUILD_GUIDE.md +++ b/BUILD_GUIDE.md @@ -266,6 +266,7 @@ No installation required — desktop **Chrome or Edge** only (Web Serial; Firefo > 📶 **Changing Wi-Fi later.** The network you set during flashing is **saved on the device and reused on every boot** — it stays until you overwrite it. To move Patternflow to a different Wi-Fi, either **re-flash from the browser** (you'll set the new network during Improv provisioning), or in Arduino IDE do a **full erase** (Tools → *Erase All Flash Before Sketch Upload* → *Enabled*) and re-upload. A plain re-upload does **not** clear the stored credentials. +> 📡 **No Wi-Fi where you are? The panel is one.** About fifteen seconds after it finds no known network, the panel raises its own hotspot: `patternflow-xxxx` (the name on its NETWORK screen - hold K2), password `patternflow`. Join it from a phone or a laptop and open `http://192.168.4.1/` - the whole console, including the Wi-Fi page, so you can add the network for wherever you are next and the panel joins it at once. The phone will say the network has no internet; that is true, and it stays connected. Mode (`auto`, `always`, `off`) and the password are on the console's Wi-Fi page. *Photos from the v2 guide — the flashing flow is identical on v3.* diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a7d5b78..a8e35833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to Patternflow will be documented in this file, newest first ## [Unreleased] +### Firmware + +- **The panel is a network of its own.** With no known Wi-Fi in reach it raises a hotspot, `patternflow-a1b2` (its alias), WPA2, password `patternflow` until changed, and the whole console is at `http://192.168.4.1/` on it - patterns, knobs, the Wi-Fi page to add the next place's network, updates. Modes on `/wifi`: `auto` (default: up fifteen seconds after the last link, down once a network is joined and nobody is on it), `always`, `off`; `GET`/`POST /api/hotspot`, and a `hotspot` object in status. The NETWORK screen shows the name while the hotspot is what there is. What the bench decided (`src/core_hotspot.h` says why, line by line): the channel comes from a scan - the least loaded of 1/6/11 - never a fixed one; alone, the radio runs AP-only, and the station comes back only for a rare probe with nobody connected or when credentials arrive; a DNS responder on the hotspot resolves every name to the panel and the phone's internet probe fails within a second instead of timing out for twenty; the hotspot is 20 MHz. Pretending to be the internet was tried and put a Samsung into its limited-connectivity state, which drops the network. +- **Console services start on any link.** Every core page, and the audio, microphone, clock and MQTT pages, used to wait for `WL_CONNECTED` before registering - on the hotspot a phone got an address and port 80 never opened. `PatternflowWifi::linkUp()` is the condition now, the station or the hotspot, and the hotspot raises the same link edge the station does. +- **Full transmit power.** The 13 dBm cap from 2026-08 is retired (`PF_WIFI_TX_POWER` is the radio's 19.5 dBm again). Measured on the hotspot: a phone next to the panel took 4-9 s per 10 KB page at 13 dBm and under a second at full power - the phone's own transmitter had hidden the asymmetry, and a router's antenna had hidden it on the home network. Owner's decision. +- **The console's server waits one second, not five, for a connection that sends nothing.** A browser opens connections it never uses; each idle one held for 5 s put the page's real requests behind it, which on the hotspot was the console appearing only after the browser gave up on its spares. + ## [3.10.4] - 2026-09-19 ### Firmware diff --git a/FEATURE_GUIDE.md b/FEATURE_GUIDE.md index 1fbf221f..039ff177 100644 --- a/FEATURE_GUIDE.md +++ b/FEATURE_GUIDE.md @@ -103,6 +103,12 @@ section fully before writing code. with its reason, including `PF_VARIANT` / `PF_VARIANT_VERSION` (the name and version the panel reports; `shelf.sh` refuses an image whose version string doesn't match). +- **A server starts when `PatternflowWifi::linkUp()` says so, not on + `WiFi.status() == WL_CONNECTED`.** The link a phone reaches the panel over + may be the panel's own hotspot (`src/core_hotspot.h`), on which the station + is never connected. Every core page waits on `linkUp()`; a feature that + waits on the station instead is simply absent on the hotspot - which is how + the audio, clock and MQTT pages went missing there before 2026-09-22. - **Your HTTP handlers run on the network core, not the frame's.** Since 3.9.1 the console's server is serviced by a task on Core 0 while `loop()` renders on Core 1. A handler that reads a word of state, or writes a value diff --git a/docs/rest-api.md b/docs/rest-api.md index 7ceac8de..edb72a21 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -70,6 +70,7 @@ The numbers that explain a device when something is off. Requires `PF_STATUS_HTT | `panel` | Physical matrix, `"x"`. The closest thing to a model number. | | `host` | mDNS hostname, i.e. `PF_OTA_HOSTNAME`. **Not unique** — every device ships as `"patternflow"`. See [Identifying a device](#identifying-a-device). | | `network` | Since 1.5, when Wi-Fi is compiled in: `disconnects` counts sampled connected→disconnected edges; `retries` counts explicit retry attempts (including initial join failures); `reconnectMs` is the last sampled downtime, zero before a reconnect. `namesReady` means the core's local mDNS/service/alias and NetBIOS registrations succeeded; probing may still be in progress and it does not prove client reachability. `announcements` counts successful registration passes. Counters reset on boot. | +| `hotspot` | Since 1.5. The panel's own access point: `mode` (`off`, `auto`, `always`), `up`, `ssid` (the board alias, `patternflow-a1b2`), `ip` (`192.168.4.1` while up, else `""`), `channel`, `clients`, and `dns` (name queries answered on the hotspot since boot). | | `heapInternal` | Free internal DRAM. The scarce one: HUB75's DMA buffers live there, and below roughly 10 KB the console starts answering with headers and no body while Wi-Fi and OSC carry on looking healthy. Worth watching. | | `fsError` | Why the pattern storage is not mounted, in words; `""` while it is mounted, and before any mount has been tried. Since 1.5. The core's serial line says `Mounting FFat partition failed! Error: -1` whatever the cause, so the first failure in a boot reads the volume's boot sector and records what it found. `"not formatted"` is a freshly erased board — press Format on `/patterns`. `"format did not stick: …"` means a Format ran and reported success, but the flash did not keep what was written. `"no filesystem (boot sector …)"` shows the sector's first and last bytes. `"boot sector looks valid but does not mount"` means the data is on the chip and the read side refused it. A failed `POST /api/patterns/format` returns the same text as its `error`. | | `flashId` | The flash chip's JEDEC id as the driver detected it at boot, six hex digits: manufacturer, then device. `"c22018"` is a 16 MB Macronix part. Since 1.5. | @@ -383,6 +384,27 @@ Requires `PF_WIFI_HTTP_ENABLED` (default on). Up to `PatternflowWifi::MAX_NETWOR Passwords travel in the clear over LAN HTTP and are never sent back. Same trust model as `/update` and `/patterns`. +### Hotspot + +Since 1.5. The panel is a network of its own when it has none: an access point named after the +board (`patternflow-a1b2`, the alias the NETWORK screen shows), WPA2, password `patternflow` until +the owner changes it. The console is at `http://192.168.4.1/` on it, every route in this document +included, so a phone can add the next place's Wi-Fi from the hotspot. Modes: `off`; `auto` (the +default - up about fifteen seconds after the panel last had a network, down again once one is +joined and nobody is on the hotspot); `always` (up beside the station link too, on its channel). +The channel is the least loaded of 1/6/11 from a scan when the panel is alone. + +| Route | | +|---|---| +| `GET /api/hotspot` | `{ok:true, hotspot:{mode, up, ssid, ip, channel, clients, dns}, pass}` - the same object status carries, plus the password. | +| `POST /api/hotspot` (`mode=off|auto|always`, `pass=…`) | Either or both. `400` with an `error` for an unknown mode or a password outside 8-63 characters. A change is saved to NVS and applied at once: a hotspot that was up restarts, which drops whoever was on it. Replies like `GET`. | + +On the hotspot every DNS name resolves to the panel, so `patternflow.local` and any typed name land +on the console; the phone's own "is there internet" probe fails, on purpose, within a second - the +network says it has no internet, which is true, and the phone stays on it. A panel on its hotspot +runs the radio AP-only: the station interface comes back for a rare retry when nobody is connected, +and at once when `POST /api/wifi` brings credentials. + ## Shows (Sequences) `.pfs` cue tables live on the pattern volume under `/shows` and play on a wall clock — cues fire by `millis()`, not by frame. Format: PFST v1 (whole-second cues) and v2 (deciseconds + eased cues); see `docs/pfst-v2-spec.md`. @@ -450,7 +472,7 @@ In short: HTTP is the management and state transport, OSC and MIDI are the low-l ## Version history -- **1.5** (unreleased) — status gains `network` and `thumbs` diagnostics, `fsError` (why storage is not mounted) and `flashId`; a failed `POST /api/patterns/format` returns the reason as its `error`; `POST /api/wifi/reconnect` reconnects without a reboot; core name registration retries partial failures and preserves feature-owned services; the MIDI edition adds a `midiUsb` block to status ([`midi-spec.md`](midi-spec.md)); `GET`/`POST /api/knobs` and the `/knobs` page (encoder direction and edges per click, per knob, persisted). +- **1.5** (unreleased) — the hotspot (`hotspot` in status, `GET`/`POST /api/hotspot`); status gains `network` and `thumbs` diagnostics, `fsError` (why storage is not mounted) and `flashId`; a failed `POST /api/patterns/format` returns the reason as its `error`; `POST /api/wifi/reconnect` reconnects without a reboot; core name registration retries partial failures and preserves feature-owned services; the MIDI edition adds a `midiUsb` block to status ([`midi-spec.md`](midi-spec.md)); `GET`/`POST /api/knobs` and the `/knobs` page (encoder direction and edges per click, per knob, persisted). - **1.4** (2026-09-06) — `GET /api/patterns/file` gains `ext=thumb`; `GET /api/display` takes `brightness` and status reports it; status gains `resetReason` and `load.internal`/`load.psram`; console pages are served gzip-compressed (`Content-Encoding: gzip`); the page sender no longer truncates on a slow link; the server no longer trips the Core-0 watchdog on a request that stalls mid-header. - **1.3** (2026-09-04) — `GET`/`POST /api/clock` (Utility edition) and the `clock` block in status; `caps` gains `"clock"`. - **1.2** (2026-09-03) — the server is serviced on Core 0 (the one-connection rule stands; the render-pays rule is history); status gains `httpCore`, `netStackMin`, `loopSyncServed`/`loopSyncMaxUs`; `POST /api/params` documents `d1`..`d4` and how a held value reaches a legacy pattern; `GET /api/patterns/select` gains `step`; `GET`/`POST /api/audio` (Audio-React) are documented; `featureNav`'s microphone label is *Audio*. diff --git a/firmware/patternflow/console/wifi.html b/firmware/patternflow/console/wifi.html index 781d9830..57f5a4ea 100644 --- a/firmware/patternflow/console/wifi.html +++ b/firmware/patternflow/console/wifi.html @@ -111,6 +111,33 @@

Add a network

current connection immediately.

+
+

Hotspot

+

-

+
+ + +
+
+ + +
+
+ +
+
+

The panel as a network of its own: patternflow-????. + Join it from a phone or a laptop and open http://192.168.4.1/ — the + same console, anywhere. auto raises it about fifteen seconds after the panel + finds no network and drops it once one is joined; a network added above from the + hotspot is tried at once. The phone is told the network works, so it stays on it; + it has no internet through the panel.

+
+ \ No newline at end of file diff --git a/firmware/patternflow/features/audio/core_audio_ws.h b/firmware/patternflow/features/audio/core_audio_ws.h index f34e6b66..e5bb17d9 100644 --- a/firmware/patternflow/features/audio/core_audio_ws.h +++ b/firmware/patternflow/features/audio/core_audio_ws.h @@ -273,7 +273,7 @@ inline void setRuntimeEnabled(bool on) { inline void begin() { #if PF_AUDIO_ENABLED if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; PatternflowHttp::begin(); // idempotent; whoever is first starts it diff --git a/firmware/patternflow/features/audio_in/core_audio_in_http.h b/firmware/patternflow/features/audio_in/core_audio_in_http.h index 0e19931b..732e5ead 100644 --- a/firmware/patternflow/features/audio_in/core_audio_in_http.h +++ b/firmware/patternflow/features/audio_in/core_audio_in_http.h @@ -421,7 +421,7 @@ inline void handleReset() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/audio-in", HTTP_GET, handleIndex); server().on("/api/audio-in", HTTP_GET, handleGet); diff --git a/firmware/patternflow/features/clock/core_clock_http.h b/firmware/patternflow/features/clock/core_clock_http.h index d5c6315b..1d53b2c0 100644 --- a/firmware/patternflow/features/clock/core_clock_http.h +++ b/firmware/patternflow/features/clock/core_clock_http.h @@ -216,7 +216,7 @@ inline void handleConfig() { PFLoopSync::run([] { configOnLoop(); }); } inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/clock", HTTP_GET, handleIndex); server().on("/clock/glyphs.bin", HTTP_GET, handleGlyphs); server().on("/api/clock", HTTP_GET, handleGet); diff --git a/firmware/patternflow/features/mqtt/core_mqtt_http.h b/firmware/patternflow/features/mqtt/core_mqtt_http.h index 0215a252..1e0601d2 100644 --- a/firmware/patternflow/features/mqtt/core_mqtt_http.h +++ b/firmware/patternflow/features/mqtt/core_mqtt_http.h @@ -318,7 +318,7 @@ inline void handleForget() { PFLoopSync::run([] { forgetOnLoop(); }); } inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/mqtt", HTTP_GET, handleIndex); server().on("/api/mqtt", HTTP_GET, handleGet); diff --git a/firmware/patternflow/net_config.h b/firmware/patternflow/net_config.h index 74e7c8fd..59d509d5 100644 --- a/firmware/patternflow/net_config.h +++ b/firmware/patternflow/net_config.h @@ -49,23 +49,20 @@ #define PF_WIFI_PASS "YOUR_WIFI_PASSWORD" #endif // Maximum Wi-Fi transmit power, applied in core_wifi.h right after the join. -// The ESP32 default is WIFI_POWER_19_5dBm — the maximum — which with the -// WROOM-1 antenna's gain can sit at or over the EU 20 dBm EIRP limit, so a -// conformance failure on output power / EIRP is fixed here. +// The ESP32 default, 19.5 dBm, is the maximum the radio does. // -// ⚠️ Take the number from the test report, not from a guess. 13 dBm is a -// 6.5 dB cut from the default: uplink power drops ~4.5x and indoor range to -// very roughly 60%. Only the device→router direction is affected, so the -// RSSI reported by /status will NOT move — that is the downlink. If range -// regresses, WIFI_POWER_17dBm is the smaller first step. -// -// Valid values (WiFiGeneric.h): WIFI_POWER_19_5dBm, _19dBm, _18_5dBm, -// _17dBm, _15dBm, _13dBm, _11dBm, _8_5dBm, _7dBm, _5dBm, _2dBm. -// -// (This is the RADIO test — for EMC, see the note in core_display.h; Wi-Fi -// power is almost irrelevant there.) +// History: from 2026-08 to 2026-09-22 this was WIFI_POWER_13dBm, a cut taken +// from a radio test report against the EU 20 dBm EIRP limit. On 2026-09-22 +// the hotspot bench showed what that cost: a phone right next to the panel +// received the panel's data frames so badly that a 10 KB console page took +// 4-9 s over the panel's own AP, and 0.5-1 s at full power (the uplink, the +// phone's own 20 dBm, was fine either way; a router's antenna and receiver +// had hidden the asymmetry on the home network). The owner retired the cap: +// full performance, conformance to be handled elsewhere. Valid values +// (WiFiGeneric.h): WIFI_POWER_19_5dBm, _19dBm, _18_5dBm, _17dBm, _15dBm, +// _13dBm, _11dBm, _8_5dBm, _7dBm, _5dBm, _2dBm. #ifndef PF_WIFI_TX_POWER -#define PF_WIFI_TX_POWER WIFI_POWER_13dBm +#define PF_WIFI_TX_POWER WIFI_POWER_19_5dBm #endif // Wi-Fi is non-blocking (see core_wifi.h): boot never waits for the join. @@ -82,6 +79,30 @@ // in preference to the placeholders above on the next boot. See // src/core_improv.h. On by default; only compiled in when Wi-Fi is actually // used (i.e. at least one of OTA/OSC/audio is enabled). +// ── Hotspot ─────────────────────────────────────────────────────────── +// The panel as a network of its own (src/core_hotspot.h). `auto` raises +// it once the station has had no link for PF_HOTSPOT_AUTO_AFTER_MS and +// drops it when the station joins and nobody is on it; the mode and the +// password are settings on /wifi, these are their defaults. The SSID is +// the board alias (patternflow-a1b2). The password is the same on every +// panel by default, like FlowLocal's, so a person can join from memory; +// anyone who wants it private changes it on the console. +#ifndef PF_HOTSPOT_PASS +#define PF_HOTSPOT_PASS "patternflow" +#endif +#ifndef PF_HOTSPOT_AUTO_AFTER_MS +#define PF_HOTSPOT_AUTO_AFTER_MS 15000 +#endif +// Station retries while the hotspot is up and empty: each one is a scan +// with the AP off the air for a second or two, so they are rare. With +// someone on the hotspot there are none (core_wifi.h). +#ifndef PF_HOTSPOT_STA_RETRY_MS +#define PF_HOTSPOT_STA_RETRY_MS 300000 +#endif +#ifndef PF_HOTSPOT_MAX_CLIENTS +#define PF_HOTSPOT_MAX_CLIENTS 4 +#endif + #ifndef PF_IMPROV_ENABLED #define PF_IMPROV_ENABLED 1 #endif diff --git a/firmware/patternflow/patternflow.ino b/firmware/patternflow/patternflow.ino index c9619b6b..12bb6c2c 100644 --- a/firmware/patternflow/patternflow.ino +++ b/firmware/patternflow/patternflow.ino @@ -86,6 +86,7 @@ #include "src/core_ui_text.h" #include "src/core_encoders.h" #include "src/core_wifi.h" +#include "src/core_hotspot.h" #include "src/core_improv.h" #include "src/core_ota.h" #include "src/core_home_http.h" @@ -502,6 +503,7 @@ void setup() { // (and re-announced on reconnect), so patterns render immediately whether // or not Wi-Fi is up yet. PatternflowWifi::begin(); + PatternflowHotspot::begin(); PatternflowImprov::begin(); // The network task (Core 0): Wi-Fi, the console, Improv, OTA. Started now // so joining Wi-Fi never waits on the first frame; the HTTP server itself @@ -783,14 +785,26 @@ void drawNetworkInfo() { // Wi-Fi status + IP. A full IPv4 (up to 15 chars) doesn't fit one // portrait line — split after the second octet's dot. bool wifiUp = PatternflowWifi::isConnected(); - drawCenteredText(PatternflowWifi::statusText(), 50, wifiUp ? pfGreenC() : pfBlueC(), 1); - String ip = PatternflowWifi::ipString(); - if (ip.length() <= 10) { - drawCenteredText(ip.c_str(), 62, pfGrayC(), 1); + if (!wifiUp && PatternflowHotspot::up) { + // No station link, but the panel is a network of its own: the name to + // join, split at the dash so it fits the portrait width. The password + // is the documented default unless the owner changed it on /wifi. + drawCenteredText("HOTSPOT", 50, pfGreenC(), 1); + String name = PatternflowHotspot::name(); + int dash = name.indexOf('-'); + if (dash < 0) dash = name.length(); + drawCenteredText(name.substring(0, dash).c_str(), 62, pfWhiteC(), 1); + drawCenteredText(name.substring(dash).c_str(), 72, pfWhiteC(), 1); } else { - int cut = ip.indexOf('.', ip.indexOf('.') + 1) + 1; - drawCenteredText(ip.substring(0, cut).c_str(), 62, pfGrayC(), 1); - drawCenteredText(ip.substring(cut).c_str(), 72, pfGrayC(), 1); + drawCenteredText(PatternflowWifi::statusText(), 50, wifiUp ? pfGreenC() : pfBlueC(), 1); + String ip = PatternflowWifi::ipString(); + if (ip.length() <= 10) { + drawCenteredText(ip.c_str(), 62, pfGrayC(), 1); + } else { + int cut = ip.indexOf('.', ip.indexOf('.') + 1) + 1; + drawCenteredText(ip.substring(0, cut).c_str(), 62, pfGrayC(), 1); + drawCenteredText(ip.substring(cut).c_str(), 72, pfGrayC(), 1); + } } // Hints under a hairline rule. The rows above come from whatever features @@ -1320,6 +1334,7 @@ void loop() { // created does loop() poll them itself, as it did before 3.9.1. if (!PatternflowNetTask::isDualCoreActive()) { PatternflowWifi::tick(); + PatternflowHotspot::tick(); PatternflowImprov::handle(); PatternflowOta::handle(); PatternflowHttp::handle(); @@ -1339,6 +1354,7 @@ void loop() { PatternflowDisplayHttp::begin(); PatternflowWifiHttp::begin(); PatternflowKnobsHttp::begin(); + PatternflowHotspot::registerRoutes(); PatternflowNames::announce(); PFFeatures::onNetwork(); Serial.println("[NET] services started"); diff --git a/firmware/patternflow/src/core_display_http.h b/firmware/patternflow/src/core_display_http.h index c42bfe30..cbec6045 100644 --- a/firmware/patternflow/src/core_display_http.h +++ b/firmware/patternflow/src/core_display_http.h @@ -166,7 +166,7 @@ inline void handleDisplay() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/api/display", HTTP_GET, handleDisplay); diff --git a/firmware/patternflow/src/core_home_http.h b/firmware/patternflow/src/core_home_http.h index b954dd92..c7d7fb46 100644 --- a/firmware/patternflow/src/core_home_http.h +++ b/firmware/patternflow/src/core_home_http.h @@ -41,7 +41,7 @@ inline void handleRoot() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; PatternflowHttp::server().on("/", handleRoot); PatternflowHttp::begin(); // idempotent; whoever is first starts it initialized = true; diff --git a/firmware/patternflow/src/core_hotspot.h b/firmware/patternflow/src/core_hotspot.h new file mode 100644 index 00000000..4be8f758 --- /dev/null +++ b/firmware/patternflow/src/core_hotspot.h @@ -0,0 +1,422 @@ +// Hotspot — the panel as a network of its own. +// +// A panel that cannot join a network, or is somewhere with none, raises an +// access point of its own ("patternflow-a1b2", WPA2), and the console is at +// http://192.168.4.1/ on it: the same pages, the same API, patterns installed +// from a phone that carries them, a Wi-Fi network added for the next place. +// Core, not a feature: Wi-Fi is the device's, and every image has this. +// +// Three modes, kept in NVS and set on /wifi: `off`; `auto` (the default — +// up while the station has had no link for PF_HOTSPOT_AUTO_AFTER_MS, down +// again once the station joins and nobody is on the hotspot); `always`. +// +// What the bench taught on 2026-09-22, each of which is a line below: +// - The channel is chosen from a scan, never fixed. Hard-coding channel 1 +// put the beacon under three -33 dBm networks on channel 3 and the SSID +// flickered or never showed; the least loaded of 1/6/11 is quiet. +// - Every console service used to wait for WL_CONNECTED, so a phone joined, +// got an address, and port 80 was never open. PatternflowWifi::linkUp() +// is the condition now, and the hotspot raises the same link edge the +// station does; every begin() behind it is idempotent. +// - A station retry is a scan with the AP off the air, and the IDF's own +// auto-reconnect re-issues one after every failure. Retries are the +// tick's business while the hotspot is up: slow with nobody on it, none +// with someone on it (PatternflowWifi::tick()). +// - A phone treats a network without internet as suspect, and decides with +// a DNS lookup and an HTTP probe. Left unanswered, the lookup times out +// and the phone sits for twenty seconds before a browser on it does +// anything. So the hotspot answers DNS - every name resolves to the +// panel - and the probe fails at once with a plain 404: the verdict is +// "no internet" within a second, which is the truth, and the phone +// stays. Pretending to be the internet (a 204) was tried and put a +// Samsung into its limited-connectivity state, which drops the network. +// +// License: MIT +#pragma once +#include +#include +#include +#include +#include + +#include "../net_config.h" +#include "core_wifi.h" +#include "core_http.h" + +namespace PatternflowHotspot { + +enum Mode : uint8_t { OFF = 0, AUTO = 1, ALWAYS = 2 }; + +inline Mode mode = AUTO; +inline char pass[65] = PF_HOTSPOT_PASS; +inline char ssidBuf[40] = {0}; +inline bool up = false; +inline int channel = 0; +inline uint32_t startedAtMs = 0; +inline uint32_t staLastUpMs = 0; +inline uint32_t starts = 0; +inline uint32_t dnsAnswered = 0; +inline uint32_t dnsFailures = 0; +inline bool routesRegistered = false; + +inline WiFiUDP dns; +inline bool dnsUp = false; +inline uint32_t dnsRetryAtMs = 0; +inline uint32_t reportAtMs = 0; +inline int reportedClients = -1; +// The last probe request heard: a phone scanning, which is a phone about +// to join. Station probes (core_wifi.h) keep away from that moment. +inline uint32_t lastProbeReqMs = 0; +inline uint32_t probeReqs = 0; +inline bool eventsHooked = false; + +// Every association and probe request the AP sees, on the log with a +// stamp - the bench cannot see the radio any other way, and a field +// report with this line in it answers most questions. +inline void onWifiEvent(WiFiEvent_t e, WiFiEventInfo_t info) { + switch (e) { + case ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED: + lastProbeReqMs = millis(); + probeReqs++; + break; + case ARDUINO_EVENT_WIFI_AP_STACONNECTED: + Serial.printf("[HOTSPOT] client joined %02x:%02x:%02x:%02x:%02x:%02x (aid %d)\n", + info.wifi_ap_staconnected.mac[0], info.wifi_ap_staconnected.mac[1], + info.wifi_ap_staconnected.mac[2], info.wifi_ap_staconnected.mac[3], + info.wifi_ap_staconnected.mac[4], info.wifi_ap_staconnected.mac[5], + (int)info.wifi_ap_staconnected.aid); + break; + case ARDUINO_EVENT_WIFI_AP_STADISCONNECTED: + Serial.printf("[HOTSPOT] client left %02x:%02x:%02x:%02x:%02x:%02x\n", + info.wifi_ap_stadisconnected.mac[0], info.wifi_ap_stadisconnected.mac[1], + info.wifi_ap_stadisconnected.mac[2], info.wifi_ap_stadisconnected.mac[3], + info.wifi_ap_stadisconnected.mac[4], info.wifi_ap_stadisconnected.mac[5]); + break; + case ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED: + Serial.println("[HOTSPOT] client has an address"); + break; + default: break; + } +} + +// Someone scanned for us within the last two minutes: a join may be +// under way, and a station probe would take the AP off the air under it. +inline bool joinLikely() { + return lastProbeReqMs != 0 && (uint32_t)(millis() - lastProbeReqMs) < 120000; +} + +inline const char* modeName(Mode m) { + return m == OFF ? "off" : m == ALWAYS ? "always" : "auto"; +} + +inline bool parseMode(const String& s, Mode* out) { + if (s == "off") { *out = OFF; return true; } + if (s == "auto") { *out = AUTO; return true; } + if (s == "always") { *out = ALWAYS; return true; } + return false; +} + +// "patternflow-a1b2": the shared name plus the last two bytes of the station +// MAC - the same alias the NETWORK screen and the status page show. +inline const char* name() { + if (ssidBuf[0] == 0) { + uint8_t mac[6]; + WiFi.macAddress(mac); + snprintf(ssidBuf, sizeof(ssidBuf), "%s-%02x%02x", PF_OTA_HOSTNAME, mac[4], mac[5]); + } + return ssidBuf; +} + +inline bool validPass(const String& p) { + return p.length() >= 8 && p.length() <= 63; +} + +inline void load() { + Preferences p; + if (!p.begin("pf_hotspot", /*readOnly=*/true)) return; + uint8_t m = p.getUChar("mode", AUTO); + mode = (m <= ALWAYS) ? (Mode)m : AUTO; + String pw = p.getString("pass", PF_HOTSPOT_PASS); + if (validPass(pw)) strlcpy(pass, pw.c_str(), sizeof(pass)); + p.end(); +} + +inline void save() { + Preferences p; + if (!p.begin("pf_hotspot", /*readOnly=*/false)) return; + p.putUChar("mode", (uint8_t)mode); + p.putString("pass", pass); + p.end(); +} + +// ── Channel ───────────────────────────────────────────────────────────── +// +// The radio has one channel. With the station connected the AP shares its +// channel, so that is the answer. Alone, a scan says what is on the air here +// and the least loaded of 1/6/11 wins - every network within two channels of +// a candidate loads it, weighted by how loud it is. A scan costs ~1.5 s and +// some internal RAM, once, at the moment the hotspot comes up. +inline int pickChannel() { + if (WiFi.status() == WL_CONNECTED) return WiFi.channel(); + // A scan fails (-2) while a station attempt is in flight, and the tick + // may have issued one this very pass: abort it first, and try twice. + WiFi.disconnect(); + delay(100); + int n = WiFi.scanNetworks(false, true, false, 120); + if (n < 0) { delay(400); n = WiFi.scanNetworks(false, true, false, 120); } + if (n < 0) { + Serial.println("[HOTSPOT] scan failed twice - channel 6"); + return 6; + } + const int cand[3] = {1, 6, 11}; + int load[3] = {0, 0, 0}; + for (int i = 0; i < n && i < 40; i++) { + const int ch = WiFi.channel(i); + int w = WiFi.RSSI(i) + 100; + if (w < 1) w = 1; + for (int k = 0; k < 3; k++) { + if (ch >= cand[k] - 2 && ch <= cand[k] + 2) load[k] += w; + } + } + WiFi.scanDelete(); + int best = 0; + for (int k = 1; k < 3; k++) if (load[k] < load[best]) best = k; + Serial.printf("[HOTSPOT] %d network(s) around, load ch1=%d ch6=%d ch11=%d\n", + n, load[0], load[1], load[2]); + return cand[best]; +} + +// ── Up and down ───────────────────────────────────────────────────────── +inline void start() { + if (up) return; + channel = pickChannel(); + WiFi.mode(WIFI_AP_STA); + if (!WiFi.softAP(name(), pass, channel, /*hidden=*/0, PF_HOTSPOT_MAX_CLIENTS)) { + Serial.println("[HOTSPOT] softAP() failed"); + WiFi.mode(WIFI_STA); + return; + } + // 20 MHz: the narrower channel is the more robust one, and nothing here + // needs the width. Set before anyone joins - changing it later restarts + // the AP and drops every client. + esp_wifi_set_bandwidth(WIFI_IF_AP, WIFI_BW_HT20); + up = true; + starts++; + esp_wifi_set_event_mask(0); // probe requests are masked by default; hear them + startedAtMs = millis(); + dnsUp = false; + dnsRetryAtMs = startedAtMs + 1000; // the AP netif needs a moment before a socket on it answers + // The IDF would re-scan on every failed station attempt, taking the AP + // off the air each time; PatternflowWifi::tick() paces retries instead. + WiFi.setAutoReconnect(false); + PatternflowWifi::hotspotUp = true; + PatternflowWifi::hotspotClients = 0; + // Alone, the radio is the hotspot's: see PatternflowWifi::stationOff(). + if (WiFi.status() != WL_CONNECTED) PatternflowWifi::stationOff(); + PatternflowWifi::raiseLinkEdge(); // the console starts on this link too + Serial.printf("[HOTSPOT] \"%s\" pass \"%s\" ch%d at %s (%s)\n", name(), pass, channel, + WiFi.softAPIP().toString().c_str(), modeName(mode)); +} + +inline void stop() { + if (!up) return; + if (dnsUp) { dns.stop(); dnsUp = false; } + PatternflowWifi::hotspotUp = false; // before the mode change: stationOff() must not fire + WiFi.softAPdisconnect(true); // AP off, mode back to station-only + WiFi.mode(WIFI_STA); + WiFi.setAutoReconnect(true); + up = false; + PatternflowWifi::hotspotUp = false; + PatternflowWifi::hotspotClients = 0; + Serial.println("[HOTSPOT] down"); +} + +inline void begin() { + load(); + if (!eventsHooked) { WiFi.onEvent(onWifiEvent); eventsHooked = true; } + PatternflowWifi::hotspotJoinLikely = joinLikely; + staLastUpMs = millis(); // auto mode counts from boot + Serial.printf("[HOTSPOT] mode %s, name \"%s\"\n", modeName(mode), name()); +} + +// ── The DNS responder ─────────────────────────────────────────────────── +// +// Every A query from the hotspot's own subnet is answered with the panel's +// address; other types get an empty NOERROR so the client stops asking. +// Hand-built on WiFiUDP rather than the core's DNSServer, which stopped +// answering after minutes on core 2.x (the 2026-08 portal bench); a socket +// that fails to send is simply recreated. +inline bool fromHotspot(const IPAddress& from) { + const uint32_t a = (uint32_t)from, b = (uint32_t)WiFi.softAPIP(); + return (a & 0x00FFFFFF) == (b & 0x00FFFFFF); +} + +inline void dnsPump() { + if (!up) return; + const uint32_t now = millis(); + if (!dnsUp) { + if ((int32_t)(now - dnsRetryAtMs) < 0) return; + dnsUp = dns.begin(53); + if (!dnsUp) { dnsRetryAtMs = now + 2000; return; } + Serial.println("[HOTSPOT] dns responder up"); + } + int len = dns.parsePacket(); + if (len <= 0) return; + uint8_t q[512]; + int n = dns.read(q, sizeof(q)); + IPAddress from = dns.remoteIP(); + uint16_t port = dns.remotePort(); + while (dns.parsePacket() > 0) { /* drain anything queued behind it */ } + if (n < 17 || !fromHotspot(from)) return; + // The question: labels until a zero byte, then type and class. + int i = 12; + while (i < n && q[i] != 0) { + const int l = q[i]; + if (l >= 0xC0 || i + l + 1 >= n) return; // compressed or malformed: ignore + i += l + 1; + } + if (i + 4 >= n) return; + i++; + const uint16_t qtype = (uint16_t)(q[i] << 8) | q[i + 1]; + const uint16_t qclass = (uint16_t)(q[i + 2] << 8) | q[i + 3]; + const int qend = i + 4; + const bool answerA = (qtype == 1 && qclass == 1); + uint8_t r[512 + 16]; + memcpy(r, q, qend); + r[2] = 0x80 | (q[2] & 0x01); // response; recursion desired copied + r[3] = 0x80; // recursion available, no error + r[4] = 0; r[5] = 1; // one question + r[6] = 0; r[7] = answerA ? 1 : 0; + r[8] = r[9] = r[10] = r[11] = 0; + int rlen = qend; + if (answerA) { + const IPAddress ip = WiFi.softAPIP(); + const uint8_t answer[16] = {0xC0, 0x0C, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3C, + 0x00, 0x04, ip[0], ip[1], ip[2], ip[3]}; + memcpy(r + rlen, answer, sizeof(answer)); + rlen += sizeof(answer); + } + bool sent = dns.beginPacket(from, port) && dns.write(r, rlen) == (size_t)rlen && dns.endPacket(); + if (!sent) { + dnsFailures++; + dns.stop(); + dnsUp = false; + dnsRetryAtMs = now + 500; + return; + } + dnsAnswered++; +} + +// ── Policy, on the network task ───────────────────────────────────────── +inline void tick() { + const uint32_t now = millis(); + const bool sta = PatternflowWifi::isConnected(); + if (sta) staLastUpMs = now; + if (up) PatternflowWifi::hotspotClients = WiFi.softAPgetStationNum(); + bool want = false; + switch (mode) { + case OFF: want = false; break; + case ALWAYS: want = true; break; + default: + if (!sta) want = (uint32_t)(now - staLastUpMs) >= PF_HOTSPOT_AUTO_AFTER_MS; + else want = up && PatternflowWifi::hotspotClients > 0; // the station is back: keep it only for whoever is on it + break; + } + if (want && !up) start(); + else if (!want && up) stop(); + if (up) { + dnsPump(); + // One line when the client count changes, and one every five minutes + // regardless, so a serial log of a show says who was on the hotspot. + if (PatternflowWifi::hotspotClients != reportedClients || (int32_t)(now - reportAtMs) >= 0) { + reportedClients = PatternflowWifi::hotspotClients; + reportAtMs = now + 300000; + Serial.printf("[HOTSPOT] ch%d clients=%d dns=%lu scans=%lu mode=%d heap=%u\n", channel, + PatternflowWifi::hotspotClients, (unsigned long)dnsAnswered, + (unsigned long)probeReqs, (int)WiFi.getMode(), + (unsigned)ESP.getFreeHeap()); + } + } +} + +inline void appendStatus(String& json); + +// ── Settings routes ───────────────────────────────────────────────────── +// Registered on the console server like any core page, from the same edge. +// The phone's connectivity probe lands here too and gets the console's +// ordinary 404 - see the header for why that is the right answer. +inline void registerRoutes() { + if (routesRegistered) return; + if (!PatternflowWifi::linkUp()) return; + PatternflowHttp::begin(); // idempotent; whoever is first starts it + WebServer& s = PatternflowHttp::server(); + // Settings: GET the state, POST mode=off|auto|always and/or pass=... . + s.on("/api/hotspot", HTTP_GET, []() { + String json; + json.reserve(256); + json += "{\"ok\":true,"; + appendStatus(json); + json += "\"pass\":\""; + json += pass; + json += "\"}"; + PatternflowHttp::server().sendHeader("Cache-Control", "no-store"); + PatternflowHttp::server().send(200, "application/json", json); + }); + s.on("/api/hotspot", HTTP_POST, []() { + WebServer& srv = PatternflowHttp::server(); + bool changed = false; + if (srv.hasArg("mode")) { + Mode m; + if (!parseMode(srv.arg("mode"), &m)) { + srv.send(400, "application/json", "{\"ok\":false,\"error\":\"mode is off, auto or always\"}"); + return; + } + if (m != mode) { mode = m; changed = true; } + } + if (srv.hasArg("pass")) { + String pw = srv.arg("pass"); + if (!validPass(pw)) { + srv.send(400, "application/json", "{\"ok\":false,\"error\":\"password is 8 to 63 characters\"}"); + return; + } + if (pw != pass) { strlcpy(pass, pw.c_str(), sizeof(pass)); changed = true; } + } + if (changed) { + save(); + // A new password or a mode that says off takes effect now; the + // policy tick brings it back up if the mode still wants it. + if (up) stop(); + } + String json; + json.reserve(256); + json += "{\"ok\":true,"; + appendStatus(json); + json += "\"pass\":\""; + json += pass; + json += "\"}"; + srv.sendHeader("Cache-Control", "no-store"); + srv.send(200, "application/json", json); + }); + routesRegistered = true; +} + +// `"hotspot":{...},` for /api/status and /api/hotspot. +inline void appendStatus(String& json) { + json += "\"hotspot\":{\"mode\":\""; + json += modeName(mode); + json += "\",\"up\":"; + json += up ? "true" : "false"; + json += ",\"ssid\":\""; + json += name(); + json += "\",\"ip\":\""; + json += up ? WiFi.softAPIP().toString() : String(""); + json += "\",\"channel\":"; + json += up ? channel : 0; + json += ",\"clients\":"; + json += up ? PatternflowWifi::hotspotClients : 0; + json += ",\"dns\":"; + json += dnsAnswered; + json += "},"; +} + +} // namespace PatternflowHotspot diff --git a/firmware/patternflow/src/core_knobs_http.h b/firmware/patternflow/src/core_knobs_http.h index f36971d1..c36b59e2 100644 --- a/firmware/patternflow/src/core_knobs_http.h +++ b/firmware/patternflow/src/core_knobs_http.h @@ -111,7 +111,7 @@ inline void handleIndex() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/knobs", HTTP_GET, handleIndex); server().on("/api/knobs", HTTP_GET, handleGet); server().on("/api/knobs", HTTP_POST, handlePost); diff --git a/firmware/patternflow/src/core_net_task.h b/firmware/patternflow/src/core_net_task.h index bde4c1e5..07b9e5d0 100644 --- a/firmware/patternflow/src/core_net_task.h +++ b/firmware/patternflow/src/core_net_task.h @@ -54,6 +54,7 @@ inline volatile uint32_t iterations = 0; inline void netWorker(void*) { PFNetMaintenance::attach([] { PatternflowWifi::tick(); + PatternflowHotspot::tick(); if (servicesReady) PatternflowNames::tick(); }); while (running) { diff --git a/firmware/patternflow/src/core_ota.h b/firmware/patternflow/src/core_ota.h index ba1ec2bc..7dba653f 100644 --- a/firmware/patternflow/src/core_ota.h +++ b/firmware/patternflow/src/core_ota.h @@ -72,7 +72,7 @@ inline const char* hostname() { inline void begin() { #if PF_OTA_ENABLED if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; ArduinoOTA.setHostname(PF_OTA_HOSTNAME); // Name service startup/retry belongs to core_names.h on the network task. diff --git a/firmware/patternflow/src/core_patterns_http.h b/firmware/patternflow/src/core_patterns_http.h index 982ae213..bf4cba38 100644 --- a/firmware/patternflow/src/core_patterns_http.h +++ b/firmware/patternflow/src/core_patterns_http.h @@ -954,7 +954,7 @@ inline void handleSelect() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; // Custom headers are only readable when collected up front. Nothing else on // the shared server collects any, so this list is the whole set. diff --git a/firmware/patternflow/src/core_send.h b/firmware/patternflow/src/core_send.h index 32b7d054..8b3dad2c 100644 --- a/firmware/patternflow/src/core_send.h +++ b/firmware/patternflow/src/core_send.h @@ -128,6 +128,10 @@ inline void drain(WebServer& server, const uint8_t* src, size_t total) { } offset += wrote; lastProgressMs = millis(); + if (offset >= total) { + const uint32_t took = millis() - startedMs; + if (took > 500) Serial.printf("[SEND] %u bytes in %lu ms\n", (unsigned)total, (unsigned long)took); + } // A tick between slices rather than yield(): yield() gives way only to // tasks of equal or higher priority, and the one that has to get a turn // is IDLE0, which the watchdog watches. Costs a 17 KB page ~13 ms. diff --git a/firmware/patternflow/src/core_status_http.h b/firmware/patternflow/src/core_status_http.h index fc0893b8..6458873c 100644 --- a/firmware/patternflow/src/core_status_http.h +++ b/firmware/patternflow/src/core_status_http.h @@ -184,6 +184,7 @@ inline void handleStatus() { json += "\"hostAlias\":\""; json += PatternflowNames::alias(); json += "\","; + PatternflowHotspot::appendStatus(json); #ifdef PF_WIFI_NEEDED json += "\"network\":{\"disconnects\":"; json += PatternflowWifi::disconnects; @@ -543,7 +544,7 @@ inline void handleSleep() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/status", HTTP_GET, handleIndex); server().on("/api/status", HTTP_GET, handleStatus); diff --git a/firmware/patternflow/src/core_web_update.h b/firmware/patternflow/src/core_web_update.h index 490f5577..b47c00ba 100644 --- a/firmware/patternflow/src/core_web_update.h +++ b/firmware/patternflow/src/core_web_update.h @@ -242,7 +242,7 @@ inline bool isCompiledIn() { // PatternflowWifi; this runs on the connect edge. Idempotent. inline void begin() { #if PF_WEBUPDATE_ENABLED - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; if (initialized) { // Every reconnect, not just the first: the per-panel mDNS alias carries // an address and a new lease may have changed it (core_names.h). diff --git a/firmware/patternflow/src/core_wifi.h b/firmware/patternflow/src/core_wifi.h index cf54f482..73c66739 100644 --- a/firmware/patternflow/src/core_wifi.h +++ b/firmware/patternflow/src/core_wifi.h @@ -45,6 +45,32 @@ constexpr uint32_t RETRY_INTERVAL_MS = PF_WIFI_RETRY_INTERVAL_MS; inline bool started = false; inline bool connectedNow = false; inline bool justConnectedEdge = false; +// The hotspot (core_hotspot.h) keeps these current from the network task: +// whether the panel's own AP is up, and how many clients are on it. +inline bool hotspotUp = false; +inline int hotspotClients = 0; +// While the hotspot is up and the station has no link, the radio runs +// AP-only: a station interface that is merely present - scanning, +// retrying, idle - drags the AP's throughput to a crawl on this driver +// (2026-09-22: 13 KB pages cut at 5 KB after 20 s). The station comes +// back for one attempt at a time: a rare retry with nobody on the +// hotspot, or credentials from the console; if it fails, AP-only again. +// Set by the hotspot: true while a phone has just scanned for the AP. +inline bool (*hotspotJoinLikely)() = nullptr; +inline bool staProbing = false; +inline uint32_t staProbeEndsMs = 0; +constexpr uint32_t STA_PROBE_MS = 8000; + +inline void stationOn() { + if ((WiFi.getMode() & WIFI_MODE_STA) == 0) WiFi.mode(WIFI_AP_STA); +} +inline void stationOff() { + if (hotspotUp && (WiFi.getMode() & WIFI_MODE_STA)) { + WiFi.disconnect(); + WiFi.mode(WIFI_AP); + } + staProbing = false; +} inline uint32_t lastBeginMs = 0; inline bool retryCurrentNetwork = false; inline uint32_t connectedAddress = 0; @@ -329,6 +355,11 @@ inline void applyCredentials(const String& ssid, const String& pass) { connectedAddress = 0; retryCurrentNetwork = false; latchedFailure = WL_IDLE_STATUS; // stale failure was for the old creds + if (hotspotUp) { + stationOn(); + staProbing = true; + staProbeEndsMs = millis() + 3 * STA_PROBE_MS; // a real network deserves a longer look + } WiFi.disconnect(); WiFi.begin(activeSsid.c_str(), activePass.c_str()); lastBeginMs = millis(); @@ -356,6 +387,7 @@ inline void tick() { bool connected = (WiFi.status() == WL_CONNECTED); if (connected) { + staProbing = false; const uint32_t address = (uint32_t)WiFi.localIP(); if (!connectedNow) { connectedNow = true; @@ -392,9 +424,32 @@ inline void tick() { lastBeginMs = now; } - if (now - lastBeginMs >= RETRY_INTERVAL_MS) { + // A retry is a scan of every channel, one or two seconds with the hotspot + // off the air. Someone on the hotspot: no retries at all (credentials + // arriving through the console still connect at once, applyCredentials() + // does not pass here). Nobody on it: rarely. No hotspot: as before. + uint32_t interval = RETRY_INTERVAL_MS; + if (hotspotUp) { + if (staProbing) { + // One attempt is in flight; give it its window, then stand down. + if ((int32_t)(now - staProbeEndsMs) >= 0) { + stationOff(); + Serial.println("[WiFi] station probe found nothing - hotspot alone"); + } + return; + } + if (hotspotClients > 0) return; + if (hotspotJoinLikely && hotspotJoinLikely()) return; + interval = PF_HOTSPOT_STA_RETRY_MS; + } + if (now - lastBeginMs >= interval) { lastBeginMs = now; retryAttempts++; + if (hotspotUp) { + stationOn(); + staProbing = true; + staProbeEndsMs = now + STA_PROBE_MS; + } // With more than one network remembered, each retry tries the next one. // A present network normally authenticates well inside one 5 s window, and @@ -426,6 +481,21 @@ inline bool isConnected() { return WiFi.status() == WL_CONNECTED; } +// The link the console can be reached over: the station, or the panel's +// own hotspot. Every service that starts "once the network is up" asks +// this, not WL_CONNECTED - a phone on the hotspot with a lease and no +// port 80 was the 2026-09-22 bench in one line. +inline bool linkUp() { + return hotspotUp || WiFi.status() == WL_CONNECTED; +} + +// The hotspot coming up is a link too: the same edge loop() starts the +// services on. Every begin() behind it is idempotent, so the station's +// own edge later costs nothing. +inline void raiseLinkEdge() { + __atomic_store_n(&justConnectedEdge, true, __ATOMIC_RELEASE); +} + // True exactly once after each successful (re)connection. The caller uses // this to (re)start network services. inline bool consumeJustConnected() { @@ -472,6 +542,12 @@ inline bool removeNetwork(const String&) { return false; } inline bool setBootIndex(int) { return false; } inline int getBootIndex() { return 0; } inline bool isConnected() { return false; } +inline bool linkUp() { return false; } +inline void raiseLinkEdge() {} +inline bool hotspotUp = false; +inline int hotspotClients = 0; +inline void stationOn() {} +inline void stationOff() {} inline bool consumeJustConnected() { return false; } inline const char* statusText() { return "OFF"; } inline String ipString() { return String("-"); } diff --git a/firmware/patternflow/src/core_wifi_http.h b/firmware/patternflow/src/core_wifi_http.h index 0f879135..96024b15 100644 --- a/firmware/patternflow/src/core_wifi_http.h +++ b/firmware/patternflow/src/core_wifi_http.h @@ -191,7 +191,7 @@ inline void handleIndex() { inline void begin() { if (initialized) return; - if (WiFi.status() != WL_CONNECTED) return; + if (!PatternflowWifi::linkUp()) return; server().on("/wifi", HTTP_GET, handleIndex); server().on("/api/wifi", HTTP_GET, handleList); diff --git a/firmware/patternflow/src/webserver/WebServer.h b/firmware/patternflow/src/webserver/WebServer.h index d472d8d7..dfd1d36b 100644 --- a/firmware/patternflow/src/webserver/WebServer.h +++ b/firmware/patternflow/src/webserver/WebServer.h @@ -46,7 +46,12 @@ enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH }; #define HTTP_RAW_BUFLEN 1436 #endif -#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request +// PATTERNFLOW: 5000 upstream. This server takes one connection at a time, +// and a browser opens connections it never uses (preconnect); every idle +// one held for 5 s put the page's real requests behind it - a phone on +// the hotspot saw the console appear only after the browser gave up on +// its spares. A request line follows the handshake within a round trip. +#define HTTP_MAX_DATA_WAIT 1000 //ms to wait for the client to send the request #define HTTP_MAX_POST_WAIT 5000 //ms to wait for POST data to arrive #define HTTP_MAX_SEND_WAIT 5000 //ms to wait for data chunk to be ACKed #define HTTP_MAX_CLOSE_WAIT 2000 //ms to wait for the client to close the connection diff --git a/firmware/patternflow/src/wifi_index.h b/firmware/patternflow/src/wifi_index.h index 1fc7fed3..93e7bc2d 100644 --- a/firmware/patternflow/src/wifi_index.h +++ b/firmware/patternflow/src/wifi_index.h @@ -122,6 +122,33 @@ button.secondary:hover{border-color:var(--led);color:var(--led)} current connection immediately.

+
+

Hotspot

+

-

+
+ + +
+
+ + +
+
+ +
+
+

The panel as a network of its own: patternflow-????. + Join it from a phone or a laptop and open http://192.168.4.1/ — the + same console, anywhere. auto raises it about fifteen seconds after the panel + finds no network and drops it once one is joined; a network added above from the + hotspot is tried at once. The phone is told the network works, so it stays on it; + it has no internet through the panel.

+
+ )HTML"; // GENERATED by firmware/toolchain/console_pages.py build — do not edit. -// gzip -9 of WIFI_INDEX_HTML (10227 bytes → 3588 bytes), served with Content-Encoding: gzip. +// gzip -9 of WIFI_INDEX_HTML (12439 bytes → 4193 bytes), served with Content-Encoding: gzip. static const uint8_t WIFI_INDEX_HTML_GZ[] PROGMEM = { - 0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0xc5,0x5a,0xdb,0x72,0x1b,0x37, - 0x12,0x7d,0xe7,0x57,0xc0,0xf4,0xae,0x87,0x13,0xf1,0x2a,0x59,0xb2,0x3c,0x43,0xd2, - 0xe5,0x8b,0x5c,0xf1,0x56,0x92,0x4d,0xc5,0xda,0xda,0x97,0x54,0x6d,0x0d,0x39,0x20, - 0x89,0x68,0x6e,0x3b,0xc0,0x88,0x62,0x18,0x56,0xe5,0x23,0xf6,0x1b,0xf6,0xc3,0xf2, - 0x25,0x7b,0x1a,0x98,0x2b,0x2f,0xb6,0xe2,0xca,0xee,0xfa,0x41,0x22,0x81,0x46,0xa3, - 0x71,0xfa,0x74,0x37,0x1a,0xd6,0xf8,0x89,0x1f,0xcf,0xd5,0x26,0xe1,0x6c,0xa5,0xc2, - 0x60,0xda,0x1a,0xd3,0x2f,0x16,0x78,0xd1,0x72,0xd2,0xe6,0x51,0x9b,0x06,0xb8,0xe7, - 0x4f,0xc7,0x21,0x57,0x1e,0x9b,0xaf,0xbc,0x54,0x72,0x35,0x69,0x67,0x6a,0xd1,0xbb, - 0xa6,0x49,0x39,0x4f,0x45,0xa2,0x98,0x4c,0xe7,0x93,0xf6,0x20,0x59,0xf4,0xe6,0x71, - 0x24,0xe3,0x80,0xf7,0x7f,0x92,0xed,0xe9,0x78,0x60,0x66,0x21,0xa6,0x57,0x47,0x5e, - 0xc8,0x27,0xed,0x7b,0xc1,0xd7,0x49,0x9c,0xaa,0x36,0x83,0xac,0xe2,0x11,0xb4,0xad, - 0x85,0xaf,0x56,0x13,0x9f,0xdf,0x8b,0x39,0xef,0xe9,0x2f,0x5d,0x11,0x09,0x25,0xbc, - 0xa0,0x27,0xe7,0x5e,0xc0,0x27,0x23,0xda,0x4a,0x09,0x15,0xf0,0xe9,0xf7,0x9e,0x52, - 0x3c,0x8d,0x16,0x41,0xbc,0x66,0x3d,0xf6,0x77,0xd1,0x7b,0x2f,0xc6,0x03,0x33,0x05, - 0x6b,0xd4,0x86,0x7e,0x0f,0xbe,0x62,0xef,0xbc,0xf4,0x8e,0x89,0x48,0xaa,0x34,0x0b, - 0xb1,0x07,0x53,0xf1,0x1d,0x8f,0x24,0xfb,0xed,0xd7,0x7f,0x31,0xc9,0x39,0x4b,0x8c, - 0x16,0xf9,0x0f,0x11,0xf9,0xfc,0xa1,0xbf,0x62,0x8b,0x38,0x65,0x6a,0xc5,0x59,0x14, - 0x2b,0xde,0x67,0x5f,0x0d,0x5a,0x4e,0x1a,0xc7,0x6a,0xdb,0xeb,0xcd,0x53,0xee,0x85, - 0xce,0xd3,0xe1,0xdb,0xe1,0x9b,0xe1,0x4b,0xb7,0xd7,0x13,0xd1,0x9d,0xf3,0xf4,0xe6, - 0xdd,0xcd,0x8b,0x77,0x6f,0xf0,0x2d,0xcc,0x14,0xf7,0x9d,0xa7,0xd7,0xaf,0xaf,0xcf, - 0x5f,0x9c,0xe3,0xfb,0xc2,0x13,0x91,0x72,0x9e,0x5e,0xbe,0xbe,0xbc,0x7c,0x7e,0xe5, - 0xb6,0x7a,0xbd,0x34,0x0b,0xb8,0xf3,0xf4,0xfc,0xf9,0xf9,0x68,0x74,0xed,0x9a,0xaf, - 0x3d,0x19,0x2f,0x20,0x33,0x7a,0x33,0x7a,0x39,0x7a,0x8e,0xb1,0x80,0x34,0xbc,0x7f, - 0x7f,0xf9,0xf6,0xfc,0x06,0xdf,0x62,0xa8,0xbf,0x7c,0xf1,0xe6,0xfa,0xc5,0x7b,0x7c, - 0x49,0xbc,0x88,0x07,0x10,0xbd,0x18,0x8d,0x46,0x43,0x52,0x27,0xbd,0x48,0x3a,0xd6, - 0x07,0xe0,0x96,0x5a,0xdd,0x4c,0xe8,0xef,0x3d,0xc9,0x53,0xb1,0xe8,0xca,0x8d,0x54, - 0x3c,0xec,0x65,0xa2,0x5b,0x0d,0xd2,0x92,0x30,0x8e,0x62,0xc7,0xfa,0x0b,0x57,0x6f, - 0x52,0x18,0x27,0xd9,0xb7,0xf8,0xae,0xd7,0xd2,0x84,0x4c,0xbc,0x39,0xef,0x7e,0x7c, - 0x4f,0x83,0xbd,0x1f,0xf8,0x32,0x0b,0xbc,0xb4,0xfb,0x2d,0x8f,0x82,0xb8,0x5b,0x4e, - 0xef,0x5a,0x5f,0x6d,0x67,0xf1,0x43,0x4f,0x8a,0x9f,0x45,0xb4,0x74,0x66,0x71,0xea, - 0xf3,0xb4,0x87,0x91,0x5d,0x6b,0x16,0xfb,0x9b,0x6d,0xe8,0xa5,0x4b,0x11,0x39,0x43, - 0x77,0xe6,0xcd,0xef,0x96,0x69,0x9c,0x45,0xbe,0x73,0xef,0xa5,0x9d,0x1c,0x3b,0xdb, - 0x9d,0xc7,0x41,0x9c,0xe6,0x43,0x80,0xcf,0x76,0x17,0x70,0x3c,0xa0,0x0a,0x45,0xb0, - 0xc9,0x87,0xc9,0x64,0xdb,0x6d,0x05,0x22,0xe2,0xbd,0x15,0x17,0xcb,0x95,0x72,0x46, - 0xfd,0x4b,0xb7,0xb7,0xe6,0xb3,0x3b,0x01,0x59,0x5a,0x20,0x43,0x78,0x64,0x45,0x26, - 0x78,0x11,0x71,0x43,0x78,0x92,0xfb,0xbb,0x56,0x7f,0x9d,0x7a,0x09,0x8c,0x78,0x30, - 0xcc,0x71,0xae,0xae,0x87,0xc9,0x83,0x5b,0x18,0xc5,0xbc,0x4c,0xc5,0x6e,0xe2,0xf9, - 0x3e,0x2d,0xbc,0x38,0x4f,0x1e,0xd8,0x39,0xe6,0xd9,0xd5,0xf3,0x04,0xf6,0x13,0xb5, - 0x79,0xba,0xf5,0x85,0x4c,0x02,0x6f,0xe3,0x2c,0x02,0xfe,0xe0,0x42,0xf1,0x32,0xea, - 0x09,0x60,0x29,0x9d,0x39,0x27,0xa4,0xdd,0xa5,0x97,0x38,0xd7,0x50,0x9a,0xab,0xc1, - 0xd9,0x95,0x8a,0x43,0x67,0x04,0x6d,0x6e,0xab,0xc4,0xc3,0x8c,0x41,0x37,0x02,0x40, - 0xf8,0xcc,0x1c,0x8c,0x1c,0x6e,0xc3,0x48,0x1f,0x64,0x32,0xf6,0xbd,0xc0,0xa2,0xfc, - 0x88,0xf4,0xf1,0x00,0x34,0xd0,0xc1,0x76,0x73,0xa5,0xa9,0xe7,0x8b,0x4c,0x92,0x52, - 0xd8,0x3a,0xda,0x1a,0x18,0xc4,0xcf,0xdc,0x19,0x5d,0x62,0xa9,0xfe,0xba,0x36,0xaa, - 0xae,0x86,0xc3,0xf2,0xcc,0x2e,0x9d,0xc3,0x19,0x61,0x57,0x99,0xcd,0xb6,0x87,0x60, - 0x93,0x67,0x73,0x27,0x18,0x65,0xd0,0xdf,0x70,0x92,0x66,0x31,0xac,0x96,0x7c,0xae, - 0x44,0x1c,0xe5,0x1e,0xee,0xa9,0x38,0x71,0xce,0xaf,0xb4,0x2d,0xe7,0xdb,0xbd,0xe5, - 0xfb,0xb6,0x04,0x9c,0x02,0xac,0x47,0x04,0x22,0xe0,0xfb,0xc3,0x97,0x3c,0x74,0x15, - 0x7f,0x50,0x3d,0x95,0xc2,0xd7,0x08,0xb7,0xd0,0xc9,0x92,0x84,0xa7,0x73,0x78,0xd1, - 0x6d,0xd5,0x77,0xd7,0x31,0x65,0x57,0x1e,0x1c,0xb2,0x6b,0xda,0x33,0x0b,0xb6,0x81, - 0x90,0xd8,0x93,0x62,0xdc,0x89,0xe2,0x88,0x57,0x07,0x2e,0xfc,0x3b,0x2c,0x80,0x23, - 0x53,0x8f,0xb9,0x42,0xc7,0x1e,0x4e,0x16,0x88,0x47,0x39,0x7d,0x34,0xac,0xbc,0xee, - 0xbc,0x24,0xee,0x3c,0xce,0xe3,0x66,0x9b,0x3a,0xc4,0x17,0x74,0x84,0x40,0xb0,0x7e, - 0xf4,0xe5,0x0e,0x71,0x43,0x38,0xc1,0x90,0x88,0x38,0x9c,0xeb,0x0b,0xb7,0xc6,0xdd, - 0x6e,0x7c,0xcf,0x53,0x4a,0x8b,0xce,0x4a,0xf8,0x3e,0x8f,0x0c,0xda,0xe5,0x20,0x0f, - 0x02,0x91,0x48,0x21,0xdd,0xf5,0x0a,0xc7,0xd4,0x8e,0x21,0x14,0x29,0x78,0xdc,0xd6, - 0x23,0x4c,0x3a,0xa7,0x0d,0xfb,0xca,0x5b,0x3e,0xc6,0x7e,0x82,0xed,0x80,0x01,0x57, - 0x60,0x40,0xeb,0x24,0x05,0x0a,0x94,0x09,0xce,0x2b,0x8a,0x0b,0x0d,0xf2,0x01,0xba, - 0x31,0xd2,0x47,0xab,0x19,0x1d,0xe7,0x7b,0x60,0x41,0x04,0x99,0x29,0x83,0x73,0x0c, - 0xd6,0x8e,0x88,0x56,0x48,0x86,0xca,0x9d,0x67,0xa9,0x84,0x54,0x12,0x0b,0x72,0x70, - 0x21,0xd3,0xf7,0x79,0xb0,0xfd,0x04,0xf6,0x39,0x1d,0x6b,0x71,0xaa,0xb9,0xd7,0x3a, - 0x61,0xa0,0x0e,0x78,0xf7,0xd0,0xc2,0xe2,0x7c,0x94,0x81,0x34,0x9f,0xab,0xdd,0x9d, - 0x15,0x79,0x69,0x9b,0xaf,0xa9,0xef,0xad,0x73,0xc1,0xfe,0xc0,0xae,0x45,0xd0,0x55, - 0x69,0xb7,0x20,0xf2,0x32,0x15,0x7e,0xc5,0xda,0x2a,0x21,0x5e,0x5c,0x1b,0xb2,0x78, - 0x33,0x1c,0xb4,0x10,0x9e,0x05,0xf1,0xfc,0x6e,0xcf,0xbf,0xee,0xc9,0x28,0x2c,0xb8, - 0xae,0x59,0x2c,0xa2,0x24,0x2b,0x92,0xd9,0x68,0x38,0xfc,0xb3,0xdb,0x00,0xf9,0x11, - 0xec,0xb8,0xa8,0xc1,0x81,0x14,0xc8,0x5e,0xea,0xa0,0x3a,0x28,0x1e,0x5e,0xba,0x77, - 0xf8,0xc5,0xd2,0x76,0x7f,0x1f,0xea,0xb9,0xb1,0xce,0x22,0x9e,0x67,0x72,0x1b,0x67, - 0x8a,0x0a,0x8c,0xf1,0xdf,0x09,0xb4,0xc1,0x71,0x4f,0x27,0x3d,0xd9,0x4c,0x10,0x45, - 0x09,0x38,0x92,0x28,0xea,0xd9,0xb1,0xe6,0xd8,0x24,0x15,0x98,0xd9,0x6c,0x0f,0x0e, - 0xa6,0x4b,0x60,0x7d,0xdf,0xbc,0x4c,0x9e,0x38,0x9a,0x16,0x6f,0x9d,0x26,0x14,0x21, - 0x38,0xba,0x2a,0x52,0x70,0x2d,0xdb,0x34,0xed,0x28,0x48,0xf6,0xa9,0x72,0x73,0x04, - 0x8c,0xf9,0x8a,0xcf,0xef,0x0e,0xa1,0xb8,0x3a,0x0e,0xc5,0x67,0xf9,0x54,0x68,0x64, - 0x75,0x12,0x51,0x89,0xde,0xb5,0x9e,0x86,0x72,0x59,0xaf,0x34,0x5a,0xc3,0x23,0x73, - 0x25,0x25,0xc6,0xe2,0xda,0xa0,0x0b,0x14,0x29,0xeb,0xf3,0x34,0xdd,0x1e,0x39,0x12, - 0x5d,0xf1,0xb6,0x9f,0xb0,0xb4,0x48,0xb6,0x26,0xbe,0xe0,0x74,0x54,0x20,0x14,0xb4, - 0xc6,0xd5,0xe4,0xf9,0x25,0x45,0x21,0x14,0xa5,0x75,0x93,0x2f,0x6a,0x7e,0xa9,0xce, - 0xf0,0x99,0x92,0x64,0x3f,0x2a,0xfd,0x9e,0x2a,0xd1,0xde,0xf6,0x28,0xc8,0xc8,0xd3, - 0xfd,0x19,0x5d,0x60,0xff,0xaf,0xc9,0x3a,0xcf,0x21,0x9f,0xc9,0xd7,0x85,0xd1,0x92, - 0x07,0xb8,0x6f,0xd4,0x13,0xcb,0x5e,0x0e,0xfb,0xa2,0x44,0xd3,0xda,0xcf,0x34,0x07, - 0x11,0xa0,0x2f,0xd9,0x47,0x6e,0xa9,0x9f,0x4c,0x35,0xad,0x23,0xb9,0x26,0x0f,0x38, - 0xdc,0x9a,0xe2,0xc8,0xa7,0xd0,0xdf,0x33,0xe5,0x70,0x87,0x3f,0xa8,0xa6,0x14,0x29, - 0xe0,0xd0,0x84,0xdf,0x5d,0x5a,0xd0,0xb3,0xe9,0x1e,0x6a,0x3c,0x30,0x6d,0x1f,0xdd, - 0xf0,0xa7,0x63,0x5f,0xdc,0xb3,0x79,0xe0,0x49,0x89,0x5e,0x0d,0x17,0x86,0xa2,0x2b, - 0xe4,0xe9,0x74,0x0c,0xca,0x44,0xc5,0x1c,0x2e,0xb9,0xba,0xeb,0xc3,0xd0,0x74,0xbc, - 0x1a,0x4d,0xf3,0xee,0x0c,0x9f,0x1a,0x62,0xb8,0x95,0xb6,0x99,0xf0,0xf1,0x01,0xe2, - 0xbd,0x42,0x7e,0x90,0x6b,0x6c,0xb5,0xd0,0xc7,0x99,0x8b,0xe7,0xb4,0xc5,0xd8,0x78, - 0x75,0x3e,0xfd,0xe8,0xdd,0x73,0x9f,0x45,0x5c,0xad,0xe3,0xf4,0x4e,0x42,0xf2,0x5c, - 0xcf,0x64,0x81,0xd6,0x42,0xb7,0x42,0xda,0x36,0x0b,0xf4,0x68,0x52,0x6c,0x43,0x71, - 0x6e,0xf6,0x99,0x93,0xc9,0xe3,0x41,0x32,0xa5,0xe3,0x15,0xaa,0x0f,0x76,0x79,0x83, - 0x78,0x29,0x36,0x29,0xf7,0xa0,0x93,0x93,0x0a,0x0a,0x26,0xb4,0x3c,0x6d,0x1a,0xc4, - 0xb0,0x2e,0xa6,0xd4,0x34,0x9a,0x99,0xf6,0xf4,0x36,0xdd,0xb0,0x85,0x48,0xa5,0x62, - 0x71,0xc4,0x92,0x78,0x0d,0xb4,0xb3,0x64,0x3c,0xd0,0x72,0xf9,0x1a,0xc3,0xef,0x52, - 0x5b,0x9b,0x21,0xab,0x7a,0x33,0xc0,0x4e,0x90,0xe9,0xb9,0x5c,0xb0,0x86,0x76,0x5e, - 0x8b,0xda,0x4c,0x7b,0x65,0xd2,0xae,0xe7,0x47,0x44,0x44,0x6e,0x0e,0xd6,0x18,0xc7, - 0x97,0x08,0x17,0xfe,0x6f,0x33,0x6a,0xed,0xb1,0xa1,0x9e,0x6e,0x97,0x9b,0x4b,0x20, - 0x5a,0x33,0x80,0x00,0x66,0x34,0xce,0x92,0x94,0x2f,0x78,0xca,0xa3,0x39,0x1f,0x0f, - 0xcc,0xa2,0x13,0x5b,0xe4,0x65,0xe5,0xd8,0x06,0x29,0xdf,0x3b,0xdf,0x0f,0x7a,0xa0, - 0xa9,0x70,0x3c,0xc0,0x31,0xf3,0x8f,0x4d,0x97,0x4d,0x3f,0xaa,0x38,0x85,0xbf,0xb1, - 0x17,0x75,0xe4,0xe6,0x59,0xa0,0xcf,0x8c,0x12,0x34,0xf2,0xec,0x27,0x5c,0xe0,0xf4, - 0xd4,0x7c,0x15,0x4b,0x1e,0x15,0x3e,0xcb,0xf1,0x7f,0x16,0xfa,0x9e,0x5c,0xb9,0x5a, - 0xb3,0x16,0xca,0xd2,0x94,0x5e,0x00,0x24,0x97,0x12,0x58,0x32,0x21,0xa9,0xc9,0x67, - 0x72,0x2d,0x14,0x4a,0x91,0xcf,0x02,0x71,0xcf,0xfb,0x9a,0x1c,0xa5,0x51,0x9f,0x62, - 0xc9,0x6b,0xdf,0x67,0xde,0x01,0x4d,0x28,0x3f,0xea,0xb3,0x2f,0xda,0x95,0x13,0x4b, - 0xe4,0x6a,0x6c,0x81,0x0d,0x7e,0x7b,0xfa,0x5d,0x6e,0x31,0xbd,0x88,0x34,0x48,0x02, - 0x61,0x5d,0x19,0x4d,0x78,0x90,0x6c,0xfe,0x6a,0x62,0x3e,0x23,0x21,0x06,0x3c,0x5a, - 0xaa,0xd5,0xa4,0x7d,0x71,0xde,0xd6,0xbd,0xed,0x3c,0x0e,0x13,0x64,0x6f,0x88,0xc4, - 0x8b,0x45,0x9b,0xa5,0xfc,0x9f,0x99,0x00,0x7a,0x87,0x20,0x9f,0x30,0x28,0x01,0xf0, - 0xed,0xe9,0xf7,0xf8,0x09,0x8b,0xfc,0xd3,0xc6,0x68,0xb9,0xdc,0x18,0xf3,0xd9,0x38, - 0x3e,0xc9,0x57,0x36,0x8c,0xbb,0xba,0x38,0x66,0xdc,0x51,0x9b,0xf6,0x99,0xfe,0x38, - 0xba,0x21,0x85,0x84,0x02,0x61,0x47,0xc4,0x3d,0x20,0x6a,0x3d,0xd7,0xe8,0xdb,0x46, - 0xa9,0xb4,0x3c,0x91,0xd1,0xa2,0x27,0x29,0xaa,0xf5,0x09,0xd1,0x0c,0x21,0x4b,0xd4, - 0xa0,0xa1,0x81,0x66,0xe0,0x39,0xc3,0xf6,0xd4,0x10,0x07,0x1c,0x5a,0xef,0x83,0x65, - 0x12,0x59,0xf3,0x90,0xe3,0x01,0x51,0xa3,0x91,0x4a,0x70,0x35,0xa1,0x6c,0x54,0x08, - 0xec,0x93,0xbf,0x91,0xeb,0x98,0x97,0x72,0xa6,0x52,0x81,0x21,0x70,0x5e,0x67,0x71, - 0x58,0xe4,0xa5,0x0a,0x69,0x9f,0x2d,0xd2,0x38,0xd4,0x14,0xd7,0x81,0x21,0x03,0xfc, - 0xf0,0x66,0xc8,0xf7,0x5d,0xa8,0xa5,0x34,0x9d,0x90,0x90,0xa7,0xeb,0x4b,0x11,0x15, - 0x28,0x2b,0xb5,0xa0,0xd2,0x91,0x24,0x19,0x3a,0x42,0x20,0x81,0x3a,0x81,0x90,0xe3, - 0x4c,0x28,0x36,0x07,0x7e,0x0b,0x11,0xf9,0x5d,0x96,0x49,0xbe,0xa0,0x34,0xbb,0xc0, - 0x30,0xb4,0x86,0xd0,0x2e,0xd9,0x0c,0xc6,0x71,0xc4,0xdd,0x2a,0x0e,0x79,0x17,0xc1, - 0x20,0x55,0xe6,0x8b,0x98,0x79,0x11,0x45,0xc6,0x3d,0x8f,0x32,0x44,0xeb,0x6b,0x1c, - 0x61,0x5d,0x46,0x26,0x62,0x2e,0x8e,0x82,0x0d,0x24,0x29,0xb2,0x5d,0x16,0x70,0x9c, - 0x92,0x0e,0xcf,0xc3,0x06,0x9e,0xf8,0xca,0xb2,0x48,0x89,0xf9,0x1d,0x0e,0x4c,0xfa, - 0xd4,0x0a,0x4b,0x13,0x6f,0xc9,0xd9,0x1d,0xe7,0x09,0x4c,0x85,0x36,0x9c,0xaa,0xcf, - 0x6e,0x21,0x43,0xc7,0x83,0xb5,0x7e,0x1a,0x63,0x06,0xa7,0x82,0xc2,0x22,0xd8,0x91, - 0xfe,0x22,0x13,0xb7,0x4c,0x84,0x21,0xf7,0x85,0xa7,0x78,0xb0,0xe9,0x1f,0xd6,0x00, - 0x73,0x89,0x9b,0x8e,0x3d,0xb6,0x42,0xe6,0x9b,0xb4,0x07,0xed,0xe9,0xd7,0x31,0x05, - 0xa5,0x37,0x05,0x66,0x68,0xa4,0x63,0xe5,0xb2,0x6a,0x16,0xd8,0xab,0x4c,0x52,0x8a, - 0xa2,0xdf,0x24,0x45,0x0e,0xd6,0x2a,0x5a,0x45,0xf2,0x28,0x1e,0x3d,0x17,0x59,0x64, - 0x2c,0xf8,0x53,0x47,0xd8,0xdb,0x94,0xab,0x2c,0x8d,0x98,0x8f,0x4e,0x84,0x1e,0x24, - 0xfb,0x4b,0xae,0x6e,0x02,0x4e,0x1f,0xdf,0x6c,0x3e,0xf8,0x90,0xd8,0x55,0x0b,0xa4, - 0xb7,0xe9,0xa8,0x2e,0xae,0xaf,0xf6,0xf6,0x4f,0x1d,0x0b,0x7c,0xb1,0xec,0x3e,0xdd, - 0xc5,0xde,0xe6,0x0f,0xa6,0xca,0x2d,0x87,0x35,0x77,0xbe,0xa3,0xa8,0x84,0xf8,0x2b, - 0x0b,0x3f,0x2c,0xc7,0xb2,0x76,0xad,0x16,0x8a,0x3a,0x45,0xe4,0xe4,0xd2,0x6d,0x0d, - 0x06,0xec,0x16,0x3e,0xa7,0x3a,0x89,0xfc,0x10,0xc4,0x9e,0x2f,0x19,0xb9,0x7b,0xc3, - 0x2e,0x99,0x74,0x81,0x33,0x30,0x97,0x9a,0x76,0x89,0xd0,0x57,0x73,0x43,0x11,0xc0, - 0xea,0xc7,0xeb,0x88,0x85,0x19,0xd6,0xc9,0x2c,0xbd,0x47,0xa2,0x24,0x5d,0x6a,0xe5, - 0xa9,0x2e,0xb8,0x48,0xe9,0x37,0x96,0x9a,0x63,0x39,0xf9,0xe0,0x30,0xb4,0x32,0xf3, - 0x95,0x26,0x27,0x04,0x74,0x59,0x09,0x90,0xa3,0x65,0x91,0xae,0x29,0x93,0x6b,0xd3, - 0x88,0xb2,0xef,0x44,0xaa,0x36,0x93,0x85,0x17,0xd0,0x0b,0x50,0x75,0x7a,0x32,0xb0, - 0x63,0x6f,0xe1,0xcd,0x05,0x07,0x33,0x3a,0xd6,0xc0,0x4b,0xc4,0x60,0x2d,0x16,0x82, - 0x60,0x58,0xf1,0xa8,0x53,0x88,0x76,0xd2,0x12,0xd7,0xb4,0xff,0x93,0xc4,0x80,0xbd, - 0xdb,0x17,0xf1,0xb5,0x26,0xa6,0xb1,0xf0,0xfb,0xf8,0x69,0x2a,0x03,0x00,0x94,0x6a, - 0x0f,0x56,0xbf,0x9f,0xd3,0x86,0xfb,0xaf,0x3a,0x7e,0x5f,0x24,0xb6,0xe3,0xf7,0x8d, - 0xc7,0xcb,0x45,0x04,0x22,0x96,0x09,0xc8,0xa5,0x5f,0xdf,0x7e,0xfb,0xcd,0xc4,0xb2, - 0xcc,0x5c,0x71,0xa8,0x8f,0x3c,0x98,0x40,0x8e,0x3e,0x5a,0x76,0x35,0x45,0xf4,0xc5, - 0x06,0x34,0xfc,0xc1,0xcf,0x6d,0x10,0x8b,0x4e,0x09,0x43,0x6e,0xa5,0x11,0x06,0x8b, - 0x27,0x09,0xbd,0xb4,0x7f,0x88,0x54,0x27,0x57,0xda,0xbf,0xf7,0x82,0x8c,0x77,0x47, - 0xc3,0x5c,0xa9,0x5e,0xfe,0x44,0xc0,0xf7,0xdf,0x75,0x20,0x6f,0xdb,0x7a,0x07,0x7c, - 0x32,0xd3,0x3b,0xfd,0xb3,0x58,0x7b,0x68,0x2e,0x2d,0xf6,0xfb,0x45,0x9a,0xe9,0x9b, - 0xc4,0xdd,0x30,0x22,0x10,0x93,0x92,0xac,0xd4,0xa1,0x2a,0x9e,0xf3,0x95,0x40,0xb0, - 0x4a,0x2b,0x02,0x51,0xd7,0xde,0xc8,0xbd,0x51,0x58,0xa6,0xcf,0xc3,0xd6,0xa5,0x3d, - 0xa5,0x2b,0x2f,0x33,0xbc,0xdb,0x70,0x95,0x67,0x4f,0xab,0xd0,0x5b,0x61,0x8d,0x44, - 0xc6,0x23,0xff,0xed,0x4a,0x04,0x7e,0x27,0x10,0xe5,0xc6,0xc5,0xd9,0x8a,0x5b,0xc6, - 0x44,0xa5,0x19,0x77,0x73,0xe8,0x49,0x2d,0x96,0x1e,0xcc,0x99,0xab,0xc9,0xc1,0x4c, - 0x4d,0x65,0x83,0x94,0x1a,0x49,0xc6,0xf1,0x99,0x6d,0x4f,0x6d,0x6b,0x44,0x4f,0xec, - 0x5b,0x4e,0x1e,0x6e,0x5c,0xdf,0xa2,0x70,0x09,0xf9,0x70,0x3c,0xfc,0xe5,0x17,0xfa, - 0x3d,0x9d,0x1c,0xfa,0xe7,0x18,0x8b,0x6a,0x52,0x88,0xb9,0x1b,0x84,0x5f,0x45,0xfe, - 0xa8,0x2b,0xbe,0xc4,0xa7,0x24,0x1a,0x65,0xe1,0x49,0x59,0xf2,0x14,0xa4,0x21,0x52, - 0xcb,0x3f,0x56,0x64,0xe9,0x91,0x7a,0x44,0x89,0xb3,0x51,0x43,0xe7,0xe7,0x55,0x36, - 0x35,0x86,0x16,0x8d,0xd4,0x35,0xa2,0xb7,0xc1,0x4d,0xa8,0x46,0xbe,0x3a,0x3b,0xb0, - 0xbd,0xed,0xee,0x8f,0x85,0xf5,0x80,0xa9,0x85,0xf8,0xb3,0x67,0x46,0xd7,0x64,0x42, - 0x81,0x6f,0xea,0x46,0x09,0x96,0xb1,0x57,0x7d,0xce,0x5c,0x55,0xb7,0x16,0x3d,0xb7, - 0x85,0x91,0xba,0xb5,0x56,0xb9,0x5b,0xc9,0xeb,0x03,0xa3,0x55,0x69,0xdf,0xae,0x6e, - 0x67,0xee,0x63,0x58,0x27,0xf6,0xac,0x9a,0x7d,0xd6,0xac,0xd9,0xbe,0x5d,0x9a,0xb5, - 0x16,0x8d,0x37,0xac,0x33,0xa3,0xa7,0x0c,0x9b,0x1d,0x5a,0x46,0xdb,0xc7,0xc9,0xe9, - 0xfd,0x31,0x07,0xda,0x55,0x44,0xc2,0x77,0x93,0xb7,0x26,0x1f,0x71,0x89,0x89,0x96, - 0x1d,0xd1,0x98,0xaa,0x1b,0xd3,0x01,0x57,0xec,0x33,0xab,0xcf,0xac,0xb3,0xa6,0x8f, - 0xf3,0xb0,0xd0,0x40,0xd0,0x22,0xd3,0x2a,0x1d,0x89,0x5c,0x8a,0xca,0xba,0xfd,0x10, - 0x6e,0x30,0x7a,0x76,0xd2,0x6c,0x73,0x7f,0x24,0xe0,0xea,0xb8,0xf9,0x3c,0x00,0x64, - 0x4d,0xc4,0x10,0x61,0x28,0xdc,0x25,0x66,0xb3,0x7e,0x1c,0xcd,0x03,0x14,0xcd,0x49, - 0x19,0x72,0xf6,0x16,0xeb,0x3a,0xe6,0x08,0xf6,0xee,0x04,0x51,0x67,0xf6,0x23,0xd3, - 0xdc,0xce,0x2e,0x2b,0x0f,0x9a,0xd8,0x83,0x7a,0xb5,0x97,0x1f,0xce,0x2c,0x16,0x2f, - 0x00,0x20,0xaa,0x1c,0x3e,0x52,0x4d,0x96,0x74,0x83,0xf3,0xad,0xb3,0x7c,0xb7,0xce, - 0xc1,0x92,0xe9,0x04,0xc2,0xaf,0x2c,0xfd,0x1f,0xa3,0xe6,0x35,0x01,0x65,0x3c,0x46, - 0x09,0x4d,0x51,0xca,0x93,0xc0,0x9b,0xe7,0xb5,0x1b,0xb0,0x50,0x6b,0xcb,0xe9,0x76, - 0xa1,0x6d,0x42,0xa1,0x9d,0x7b,0xaa,0x9e,0x6c,0xf4,0x65,0xe5,0xa0,0xa8,0x5a,0x48, - 0x78,0x55,0x14,0xd0,0x79,0x76,0xad,0xfa,0x4d,0xe7,0x9e,0x53,0xdf,0xdd,0xa1,0xa2, - 0xad,0x79,0x0e,0x77,0x97,0xe5,0xb3,0x4c,0x96,0xf6,0x16,0xc3,0x5a,0xc4,0x14,0x77, - 0x4a,0x9d,0xb6,0x6b,0x4a,0x3f,0x71,0x93,0xdc,0x2b,0x10,0x2c,0x65,0xd1,0xac,0x54, - 0x34,0xca,0x26,0xb4,0x98,0x8a,0x09,0x61,0xdb,0xde,0xd2,0x3d,0xcb,0xd2,0x77,0x9e, - 0xb2,0xa3,0xb3,0xba,0x23,0xdb,0xfd,0xf4,0x66,0xfb,0xb7,0x92,0x81,0xde,0xa9,0xbb, - 0x0d,0xb9,0x5a,0xc5,0xbe,0x63,0x7d,0xff,0xd7,0x8f,0xb7,0x56,0x57,0x23,0x6e,0x9e, - 0x34,0xa4,0xb3,0xb5,0x72,0x38,0x7a,0xb7,0x68,0x3c,0x80,0x21,0x9c,0x0d,0xda,0x78, - 0x84,0xc1,0xe0,0xa1,0xb7,0x5e,0xaf,0x7b,0xd4,0x26,0xf4,0xb2,0x14,0x5e,0x99,0xc7, - 0x3e,0x21,0xd5,0xcd,0x2b,0xb8,0xbf,0x71,0xac,0x22,0x19,0x58,0x67,0x66,0xfa,0x6f, - 0x3f,0x7c,0x78,0x8b,0xd6,0x0a,0xfe,0xc0,0x59,0xe9,0x2c,0x3b,0x5b,0x4b,0x7f,0xf9, - 0xf5,0xa8,0xb8,0x11,0xc4,0x77,0x06,0x16,0x9f,0x5e,0x4f,0xe3,0xf4,0x97,0x5f,0x2c, - 0x94,0x6b,0x78,0xe0,0x11,0xb8,0x9c,0xac,0xa0,0x5a,0x77,0xb5,0x90,0xe2,0xb6,0x4b, - 0x46,0x17,0xb3,0x54,0x5f,0x8d,0x2f,0xaa,0x46,0xc6,0x3a,0xa3,0x73,0xe9,0x94,0x90, - 0xdf,0x11,0x88,0xa1,0x69,0xf9,0x06,0x40,0x00,0x6e,0xc0,0x44,0x73,0x59,0xdc,0xe5, - 0xc1,0x72,0x48,0x49,0xad,0xf6,0xd3,0x47,0xc8,0x39,0x59,0x51,0x06,0x31,0xbd,0xf2, - 0xa2,0x25,0xaf,0x07,0x75,0x75,0x30,0x32,0x1f,0x71,0xdd,0x2c,0xf8,0x47,0xd2,0x40, - 0x49,0x6d,0xdb,0x48,0x97,0x37,0x80,0x23,0xb2,0x86,0x9a,0x4f,0x10,0x27,0x0b,0x91, - 0x86,0x1d,0xab,0x7a,0x8f,0x29,0x3a,0x28,0x73,0xb7,0x36,0xa7,0x5f,0xd1,0xdf,0x2f, - 0x44,0xe8,0x52,0xd1,0x33,0xbd,0xb2,0x6c,0xdb,0xb8,0x80,0xd0,0x2c,0xf7,0x2c,0x75, - 0xc7,0x77,0x1a,0xea,0x6d,0x79,0xe9,0x83,0x83,0x2b,0x79,0xa6,0x5b,0x8d,0xdc,0x34, - 0xc4,0xbe,0x41,0xfd,0xc9,0x24,0xca,0x82,0x20,0x4f,0x0a,0x47,0x5c,0x42,0x29,0xe0, - 0xcc,0xfa,0xed,0xd7,0x7f,0x17,0x89,0xfe,0x20,0x22,0xf2,0xb3,0xee,0xc5,0xc4,0x31, - 0xff,0xec,0xf2,0x64,0x02,0x17,0xd4,0x7b,0x00,0xca,0xa1,0x3a,0x83,0x1e,0x40,0xf3, - 0x5e,0x67,0x60,0xd6,0xb6,0xce,0x68,0xfe,0xcc,0x6a,0xbf,0xfa,0x31,0xfa,0x31,0xfa, - 0xb0,0xa8,0xb7,0xb5,0xba,0xdd,0x34,0xbd,0x63,0xd9,0x81,0x2a,0xea,0x9b,0x37,0x92, - 0x95,0xb9,0xb0,0xf8,0x57,0xd5,0x68,0xdd,0x7a,0x06,0xe6,0xcf,0x40,0x90,0xc1,0x74, - 0x07,0xd4,0x6f,0xe0,0xbb,0x7f,0xd0,0x57,0xfa,0x02,0x71,0x34,0x2a,0xb5,0xf5,0x15, - 0x00,0xef,0x6e,0xbe,0xb9,0xb9,0xbd,0xb1,0xfe,0x80,0x38,0x35,0xd1,0x19,0xdf,0xbd, - 0xea,0xe8,0x6a,0xa4,0x1d,0xa3,0x37,0x73,0x0e,0x83,0xd6,0xee,0x9a,0x90,0xce,0xc3, - 0xc4,0x7d,0x6c,0x98,0x54,0x21,0xb1,0xd0,0x84,0x35,0xcf,0x2d,0x15,0x63,0xb9,0xb6, - 0x86,0xf7,0x93,0x14,0x7d,0x64,0xa4,0xde,0xf1,0x85,0x97,0x05,0xca,0x6c,0x40,0xb9, - 0x58,0xc3,0x42,0xd5,0x00,0xbf,0x8b,0x1c,0xdc,0xc7,0x0d,0x20,0xec,0x14,0x69,0xf8, - 0x89,0xf1,0xae,0xde,0x57,0xff,0xdf,0x51,0x95,0x82,0xf5,0x23,0x93,0x0e,0xd6,0x66, - 0x82,0x07,0xdb,0x49,0x27,0x7e,0x51,0xdf,0x4b,0x4f,0x37,0xdc,0xcf,0xb5,0x61,0xec, - 0xd9,0xb3,0x5a,0xf8,0x98,0x27,0x05,0xa4,0x89,0x8a,0x26,0x3a,0x58,0x88,0x2a,0xb7, - 0xe5,0x93,0xc2,0x5a,0x04,0x01,0x3d,0x49,0x24,0x88,0x2c,0x09,0xb7,0xe9,0xea,0x77, - 0xc0,0x0f,0x43,0x12,0xb1,0xc8,0x79,0xd1,0x78,0xd4,0xf0,0xc5,0x42,0xbf,0x96,0xaa, - 0xea,0x2d,0x86,0x9a,0x9a,0x4d,0x9c,0xe9,0x87,0x9b,0x38,0x6a,0xd2,0xc7,0xf4,0x88, - 0xfe,0x66,0x62,0x7d,0x86,0x37,0x67,0xd6,0x33,0x7a,0x57,0x3b,0x2e,0x01,0x0c,0x68, - 0xb2,0xc0,0xd5,0xae,0x30,0xb0,0x49,0xf9,0xd9,0xc4,0x7a,0x96,0x53,0x7a,0x32,0xb2, - 0x8e,0xb1,0xf6,0xbf,0x50,0xab,0x74,0x99,0xa2,0x1f,0xff,0x9b,0x42,0xd4,0x2c,0x3a, - 0x7b,0x80,0x50,0x8f,0xbb,0xc7,0xbd,0x7c,0xa8,0x41,0x9d,0x66,0x85,0x32,0x5b,0x99, - 0xb7,0x28,0xd0,0x00,0xc1,0x65,0xaa,0x8e,0x75,0xe6,0xf7,0x0d,0x83,0xcc,0xdf,0x8e, - 0x15,0x02,0x5d,0x70,0x26,0x47,0xd9,0xe4,0x1a,0xaf,0xcc,0xd5,0x96,0xed,0x1c,0xa3, - 0x10,0x5d,0xbf,0xf6,0x94,0xda,0x55,0x17,0xfd,0x05,0xf1,0x89,0x7c,0x99,0x2f,0x93, - 0x5c,0xe9,0x3f,0x09,0xc3,0x59,0x3b,0x34,0xd4,0xbd,0x1c,0x0e,0xe9,0xc2,0x53,0xfe, - 0x01,0xde,0x78,0x60,0xfe,0x1f,0x67,0xa0,0xff,0xc6,0xef,0x3f,0x89,0x01,0x91,0xc4, - 0xf3,0x27,0x00,0x00, + 0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x02,0xff,0xcd,0x5b,0xdb,0x72,0xdb,0x48, + 0x92,0x7d,0xe7,0x57,0x94,0xe9,0x59,0x83,0x68,0x91,0x20,0x29,0x5b,0xb2,0x0c,0x90, + 0x54,0xb4,0x6f,0xd1,0x9e,0x98,0xee,0xed,0x68,0x7b,0x63,0x5e,0x26,0x62,0x02,0x22, + 0x8a,0x44,0xb5,0x40,0x00,0x0b,0x14,0x44,0x73,0xd8,0x8a,0x98,0x8f,0xd8,0x6f,0xd8, + 0x0f,0x9b,0x2f,0xd9,0x93,0x55,0x85,0x1b,0x41,0x4a,0x1a,0xcf,0xcc,0xee,0xfa,0x81, + 0x04,0xaa,0xb2,0xb2,0xb2,0xf2,0x72,0x32,0x2b,0x29,0xcf,0x9e,0x05,0xc9,0x52,0xee, + 0x52,0xce,0x42,0xb9,0x89,0x16,0xbd,0x19,0x7d,0xb1,0xc8,0x8f,0xd7,0xf3,0x3e,0x8f, + 0xfb,0x34,0xc0,0xfd,0x60,0x31,0xdb,0x70,0xe9,0xb3,0x65,0xe8,0x67,0x39,0x97,0xf3, + 0x7e,0x21,0x57,0xa3,0x2b,0x9a,0xcc,0x97,0x99,0x48,0x25,0xcb,0xb3,0xe5,0xbc,0x3f, + 0x4e,0x57,0xa3,0x65,0x12,0xe7,0x49,0xc4,0x9d,0x5f,0xf3,0xfe,0x62,0x36,0xd6,0xb3, + 0x20,0x53,0xab,0x63,0x7f,0xc3,0xe7,0xfd,0x3b,0xc1,0xb7,0x69,0x92,0xc9,0x3e,0x03, + 0xad,0xe4,0x31,0xb8,0x6d,0x45,0x20,0xc3,0x79,0xc0,0xef,0xc4,0x92,0x8f,0xd4,0xcb, + 0x50,0xc4,0x42,0x0a,0x3f,0x1a,0xe5,0x4b,0x3f,0xe2,0xf3,0x29,0x6d,0x25,0x85,0x8c, + 0xf8,0xe2,0x67,0x5f,0x4a,0x9e,0xc5,0xab,0x28,0xd9,0xb2,0x11,0xfb,0xa3,0x18,0x7d, + 0x14,0xb3,0xb1,0x9e,0x82,0x34,0x72,0x47,0xdf,0xe3,0xef,0xd8,0x7b,0x3f,0xbb,0x65, + 0x22,0xce,0x65,0x56,0x6c,0xb0,0x07,0x93,0xc9,0x2d,0x8f,0x73,0xf6,0xb7,0xbf,0xfe, + 0x17,0xcb,0x39,0x67,0xa9,0xe6,0x92,0xff,0x59,0xc4,0x01,0xff,0xea,0x84,0x6c,0x95, + 0x64,0x4c,0x86,0x9c,0xc5,0x89,0xe4,0x0e,0xfb,0x6e,0xdc,0x73,0xb3,0x24,0x91,0xfb, + 0xd1,0x68,0x99,0x71,0x7f,0xe3,0x3e,0x9f,0xbc,0x9b,0xbc,0x9d,0xbc,0xf1,0x46,0x23, + 0x11,0xdf,0xba,0xcf,0x3f,0xbc,0xff,0xf0,0xfa,0xfd,0x5b,0xbc,0x6d,0x0a,0xc9,0x03, + 0xf7,0xf9,0xd5,0xf7,0x57,0xe7,0xaf,0xcf,0xf1,0xbe,0xf2,0x45,0x2c,0xdd,0xe7,0x17, + 0xdf,0x5f,0x5c,0xbc,0xba,0xf4,0x7a,0xa3,0x51,0x56,0x44,0xdc,0x7d,0x7e,0xfe,0xea, + 0x7c,0x3a,0xbd,0xf2,0xf4,0xeb,0x28,0x4f,0x56,0xa0,0x99,0xbe,0x9d,0xbe,0x99,0xbe, + 0xc2,0x58,0x44,0x1c,0x3e,0x7e,0xbc,0x78,0x77,0xfe,0x01,0x6f,0x09,0xd8,0x5f,0xbc, + 0x7e,0x7b,0xf5,0xfa,0x23,0x5e,0x52,0x3f,0xe6,0x11,0x48,0x5f,0x4e,0xa7,0xd3,0x09, + 0xb1,0xcb,0xfd,0x38,0x77,0xad,0x4f,0xd0,0x5b,0x66,0x0d,0x0b,0xa1,0xde,0x47,0x39, + 0xcf,0xc4,0x6a,0x98,0xef,0x72,0xc9,0x37,0xa3,0x42,0x0c,0xeb,0x41,0x5a,0xb2,0x49, + 0xe2,0xc4,0xb5,0x7e,0xcf,0xe5,0xdb,0x0c,0xc2,0xe5,0xec,0x47,0xbc,0xab,0xb5,0x34, + 0x91,0xa7,0xfe,0x92,0x0f,0x3f,0x7f,0xa4,0xc1,0xd1,0x2f,0x7c,0x5d,0x44,0x7e,0x36, + 0xfc,0x91,0xc7,0x51,0x32,0xac,0xa6,0xef,0x7b,0xdf,0xed,0x6f,0x92,0xaf,0xa3,0x5c, + 0xfc,0x45,0xc4,0x6b,0xf7,0x26,0xc9,0x02,0x9e,0x8d,0x30,0x72,0xdf,0xbb,0x49,0x82, + 0xdd,0x7e,0xe3,0x67,0x6b,0x11,0xbb,0x13,0xef,0xc6,0x5f,0xde,0xae,0xb3,0xa4,0x88, + 0x03,0xf7,0xce,0xcf,0x06,0x46,0x77,0xb6,0xb7,0x4c,0xa2,0x24,0x33,0x43,0x50,0x9f, + 0xed,0xad,0x60,0x78,0xa8,0x6a,0x23,0xa2,0x9d,0x19,0x26,0x91,0x6d,0xaf,0x17,0x89, + 0x98,0x8f,0x42,0x2e,0xd6,0xa1,0x74,0xa7,0xce,0x85,0x37,0xda,0xf2,0x9b,0x5b,0x01, + 0x5a,0x5a,0x90,0x6f,0x60,0x91,0x90,0x44,0xf0,0x63,0xf2,0x0d,0xe1,0xe7,0x3c,0xb8, + 0xef,0x39,0xdb,0xcc,0x4f,0x21,0xc4,0x57,0xed,0x39,0xee,0xe5,0xd5,0x24,0xfd,0xea, + 0x95,0x42,0x31,0xbf,0x90,0x89,0x97,0xfa,0x41,0x40,0x0b,0x5f,0x9e,0xa7,0x5f,0xd9, + 0x39,0xe6,0xd9,0xe5,0xab,0x14,0xf2,0x93,0x6b,0xf3,0x6c,0x1f,0x88,0x3c,0x8d,0xfc, + 0x9d,0xbb,0x8a,0xf8,0x57,0x0f,0x8c,0xd7,0xf1,0x48,0x40,0x97,0xb9,0xbb,0xe4,0xa4, + 0x69,0x6f,0xed,0xa7,0xee,0x15,0x98,0x1a,0x36,0x38,0xbb,0x94,0xc9,0xc6,0x9d,0x82, + 0x9b,0xd7,0xab,0xf4,0xa1,0xc7,0xc0,0x1b,0x01,0x20,0x02,0xa6,0x0f,0x46,0x06,0xb7, + 0x21,0x64,0x00,0x67,0xd2,0xf2,0xbd,0xc6,0x22,0x73,0x44,0x7a,0xec,0x28,0x0d,0xee, + 0x60,0x7b,0x86,0x69,0xe6,0x07,0xa2,0xc8,0x89,0x29,0x64,0x9d,0xee,0xb5,0x1a,0xc4, + 0x5f,0xb8,0x3b,0xbd,0xc0,0x52,0xf5,0xba,0xd5,0xac,0x2e,0x27,0x93,0xea,0xcc,0x1e, + 0x9d,0xc3,0x9d,0x62,0xd7,0xbc,0xb8,0xd9,0x77,0x95,0x4d,0x96,0x35,0x46,0xd0,0xcc, + 0xc0,0xbf,0x65,0x24,0xe5,0xc5,0x90,0x3a,0xe7,0x4b,0x29,0x92,0xd8,0x58,0x78,0x24, + 0x93,0xd4,0x3d,0xbf,0x54,0xb2,0x9c,0xef,0x0f,0x96,0x1f,0xca,0x12,0x71,0x0a,0xb0, + 0x11,0x39,0x10,0x29,0xde,0x99,0xbc,0xe1,0x1b,0x4f,0xf2,0xaf,0x72,0x24,0x33,0xd8, + 0x1a,0xe1,0xb6,0x71,0x8b,0x34,0xe5,0xd9,0x12,0x56,0xf4,0x7a,0xcd,0xdd,0x55,0x4c, + 0xd9,0xb5,0x05,0x27,0xec,0x8a,0xf6,0x2c,0xa2,0x7d,0x24,0x72,0xec,0x49,0x31,0xee, + 0xc6,0x49,0xcc,0xeb,0x03,0x97,0xf6,0x9d,0x94,0x8a,0x23,0x51,0x8f,0x99,0x42,0xc5, + 0x1e,0x4e,0x16,0x89,0x27,0x19,0x7d,0x3a,0xa9,0xad,0xee,0xbe,0x21,0xdf,0x79,0x9a, + 0xc5,0xf5,0x36,0x4d,0x15,0xbf,0xa4,0x23,0x44,0x82,0x39,0xf1,0xb7,0x1b,0xc4,0xdb, + 0xc0,0x08,0xda,0x89,0xc8,0x87,0x0d,0xbf,0xcd,0x5e,0x9b,0xdb,0x4b,0xee,0x78,0x46, + 0xb0,0xe8,0x86,0x22,0x08,0x78,0xac,0xb5,0x5d,0x0d,0xf2,0x28,0x12,0x69,0x2e,0x72, + 0x6f,0x1b,0xe2,0x98,0xca,0x30,0xa4,0x45,0x0a,0x1e,0xaf,0xf7,0x04,0x91,0xce,0x69, + 0x43,0x47,0xfa,0xeb,0xa7,0xc8,0x4f,0x6a,0xeb,0x78,0xc0,0x25,0x3c,0xa0,0x77,0xd2, + 0x05,0x4a,0x2d,0x93,0x3a,0x2f,0x29,0x2e,0x94,0x92,0x3b,0xda,0x4d,0x00,0x1f,0xbd, + 0x76,0x74,0x9c,0x1f,0x28,0x0b,0x24,0x40,0xa6,0x02,0xc6,0xd1,0xba,0x76,0x45,0x1c, + 0x02,0x0c,0xa5,0xb7,0x2c,0xb2,0x1c,0x54,0x69,0x22,0xc8,0xc0,0x25,0x8d,0x13,0xf0, + 0x68,0xff,0x80,0xee,0x8d,0x3b,0x36,0xe2,0x54,0xf9,0x5e,0xef,0x84,0x80,0x2a,0xe0, + 0xbd,0xae,0x84,0xe5,0xf9,0x08,0x81,0x94,0x3f,0xd7,0xbb,0xbb,0x21,0x59,0x69,0x6f, + 0xd6,0x34,0xf7,0x56,0x58,0x70,0x38,0x70,0xdf,0x23,0xd5,0xd5,0xb0,0x5b,0x3a,0xf2, + 0x3a,0x13,0x41,0xed,0xb5,0x35,0x20,0xbe,0xbc,0xd2,0xce,0xe2,0xdf,0xe0,0xa0,0x25, + 0xf1,0x4d,0x94,0x2c,0x6f,0x0f,0xec,0xeb,0x9d,0x8c,0xc2,0xd2,0xd7,0x95,0x17,0x8b, + 0x38,0x2d,0x4a,0x30,0x9b,0x4e,0x26,0xff,0xe6,0xb5,0x94,0xfc,0x04,0xef,0x78,0xd9, + 0x50,0x07,0x20,0x90,0xbd,0x51,0x41,0xd5,0x49,0x1e,0x7e,0x76,0x70,0xf8,0xd5,0xda, + 0xf6,0xfe,0x3e,0xad,0x1b,0x61,0xdd,0x55,0xb2,0x2c,0xf2,0x7d,0x52,0x48,0x4a,0x30, + 0xda,0x7e,0x27,0xb4,0x0d,0x1f,0xf7,0x15,0xe8,0xe5,0x6d,0x80,0x28,0x53,0xc0,0x11, + 0xa0,0x68,0xa2,0x63,0xc3,0xb0,0x69,0x26,0x30,0xb3,0xdb,0x77,0x0e,0xa6,0x52,0x60, + 0x73,0x5f,0x93,0x26,0x4f,0x1c,0x4d,0x91,0xf7,0x4e,0x3b,0x14,0x69,0x70,0x7a,0x59, + 0x42,0x70,0x03,0x6d,0xda,0x72,0x94,0x4e,0xf6,0x50,0xba,0x39,0xa2,0x8c,0x65,0xc8, + 0x97,0xb7,0x5d,0x55,0x5c,0x1e,0x57,0xc5,0xa3,0xfe,0x54,0x72,0x64,0x4d,0x27,0xa2, + 0x14,0x7d,0xdf,0x7b,0xbe,0xc9,0xd7,0xcd,0x4c,0xa3,0x38,0x3c,0x11,0x2b,0x09,0x18, + 0xcb,0xb2,0x41,0x25,0x28,0x62,0xe6,0xf0,0x2c,0xdb,0x1f,0x39,0x12,0x95,0x78,0xfb, + 0x07,0x24,0x2d,0xc1,0x56,0xc7,0x17,0x8c,0x8e,0x0c,0x84,0x84,0xd6,0x2a,0x4d,0x5e, + 0x5d,0x50,0x14,0x82,0x51,0xd6,0x14,0xf9,0x65,0xc3,0x2e,0xf5,0x19,0x1e,0x49,0x49, + 0xf6,0x93,0xe0,0xf7,0x54,0x8a,0xf6,0xf7,0x47,0x95,0x0c,0x9c,0x76,0x6e,0xa8,0x80, + 0xfd,0x3f,0x05,0x6b,0x83,0x21,0x8f,0xe0,0x75,0x29,0x74,0xce,0x23,0xd4,0x1b,0x4d, + 0x60,0x39,0xc0,0xb0,0x6f,0x02,0x9a,0xde,0x21,0xd2,0x74,0x22,0x40,0x15,0xd9,0x47, + 0xaa,0xd4,0x07,0xa1,0xa6,0x77,0x04,0x6b,0x4c,0xc0,0xa1,0x6a,0x4a,0xe2,0x80,0x42, + 0xff,0x40,0x94,0xee,0x0e,0xff,0xa4,0x9c,0x52,0x42,0x40,0x57,0x84,0xbf,0x3b,0xb5, + 0xe0,0xce,0xa6,0xee,0x50,0xb3,0xb1,0xbe,0xf6,0x51,0x85,0xbf,0x98,0x05,0xe2,0x8e, + 0x2d,0x23,0x3f,0xcf,0x71,0x57,0x43,0xc1,0x50,0xde,0x0a,0x79,0xb6,0x98,0xc1,0x65, + 0xe2,0x72,0x0e,0x45,0xae,0xba,0xf5,0x61,0x68,0x31,0x0b,0xa7,0x0b,0x73,0x3b,0xc3, + 0x53,0x8b,0x0c,0x55,0x69,0x9f,0x89,0x00,0x0f,0x20,0x1f,0x95,0xf4,0x63,0xc3,0xb1, + 0xd7,0xc3,0x3d,0x4e,0x17,0x9e,0x8b,0x1e,0x63,0xb3,0xf0,0x7c,0xf1,0xd9,0xbf,0xe3, + 0x01,0x8b,0xb9,0xdc,0x26,0xd9,0x6d,0x0e,0xca,0x73,0x35,0x53,0x44,0x8a,0x0b,0x55, + 0x85,0xb4,0x6d,0x11,0xa9,0xd1,0xb4,0xdc,0x86,0xe2,0x5c,0xef,0xb3,0x24,0x91,0x67, + 0xe3,0x74,0x41,0xc7,0x2b,0x59,0x77,0x76,0x79,0x8b,0x78,0x29,0x37,0xa9,0xf6,0xa0, + 0x93,0x13,0x0b,0x0a,0x26,0x5c,0x79,0xfa,0x34,0x88,0x61,0x95,0x4c,0xe9,0xd2,0xa8, + 0x67,0xfa,0x8b,0x2f,0xd9,0x8e,0xad,0x44,0x96,0x4b,0x96,0xc4,0x2c,0x4d,0xb6,0xd0, + 0x76,0x91,0xce,0xc6,0x8a,0xce,0xac,0xd1,0xfe,0x5d,0x71,0xeb,0x33,0xa0,0xaa,0x7f, + 0x03,0xb5,0x93,0xca,0xd4,0x9c,0x21,0x6c,0x68,0xdb,0xe4,0xa2,0x3e,0x53,0x56,0x99, + 0xf7,0x9b,0xf8,0x88,0x88,0x30,0xe2,0x60,0x8d,0x36,0x7c,0xa5,0xe1,0xd2,0xfe,0x7d, + 0x46,0x57,0x7b,0x6c,0xa8,0xa6,0xfb,0xd5,0xe6,0x39,0x34,0xda,0x10,0x80,0x14,0xcc, + 0x68,0x9c,0xa5,0x19,0x5f,0xf1,0x8c,0xc7,0x4b,0x3e,0x1b,0xeb,0x45,0x27,0xb6,0x30, + 0x69,0xe5,0xd8,0x06,0x19,0x3f,0x38,0xdf,0x2f,0x6a,0xa0,0xcd,0x70,0x36,0xc6,0x31, + 0xcd,0x63,0xdb,0x64,0x8b,0xcf,0x32,0xc9,0x60,0x6f,0xec,0x45,0x37,0x72,0xdd,0x16, + 0x70,0x98,0x66,0x82,0x8b,0x3c,0xfb,0x15,0x05,0x9c,0x9a,0x5a,0x86,0x49,0xce,0xe3, + 0xd2,0x66,0x46,0xff,0x2f,0x36,0x81,0x9f,0x87,0x9e,0xe2,0xac,0x88,0x8a,0x2c,0xa3, + 0x0e,0x40,0xce,0xf3,0x1c,0xba,0x64,0x22,0xa7,0x4b,0x3e,0xcb,0xb7,0x42,0x22,0x15, + 0x05,0x2c,0x12,0x77,0xdc,0x51,0xce,0x51,0x09,0xf5,0x90,0x97,0x7c,0x1f,0x04,0xcc, + 0xef,0xb8,0x09,0xe1,0xa3,0x3a,0xfb,0xaa,0x5f,0x1b,0xb1,0xd2,0x5c,0xc3,0x5b,0x20, + 0x43,0xd0,0x5f,0xfc,0x64,0x24,0xa6,0x8e,0x48,0xcb,0x49,0x40,0xac,0x32,0xa3,0x0e, + 0x0f,0xa2,0x35,0x5d,0x13,0xfd,0x0c,0x40,0x8c,0x78,0xbc,0x96,0xe1,0xbc,0xff,0xf2, + 0xbc,0xaf,0xee,0xb6,0xcb,0x64,0x93,0x02,0xbd,0x41,0x92,0xac,0x56,0x7d,0x96,0xf1, + 0xff,0x2c,0x04,0xb4,0xd7,0x55,0xf2,0x09,0x81,0x52,0x28,0xbe,0xbf,0xf8,0x19,0x9f, + 0x90,0x28,0x38,0x2d,0x8c,0xa2,0x33,0xc2,0xe8,0x67,0x6d,0xf8,0xd4,0xac,0x6c,0x09, + 0x77,0xf9,0xf2,0x98,0x70,0x47,0x65,0x3a,0xf4,0xf4,0xa7,0xb9,0x1b,0x20,0x64,0x23, + 0x10,0x76,0xe4,0xb8,0x1d,0x47,0x6d,0x62,0x8d,0xaa,0x36,0x2a,0xa6,0xd5,0x89,0x34, + 0x17,0x35,0x49,0x51,0xad,0x4e,0x88,0xcb,0x10,0x50,0xa2,0xa1,0x1a,0x1a,0x68,0x07, + 0x9e,0x3b,0xe9,0x2f,0xb4,0xe3,0xc0,0x87,0xb6,0x87,0xca,0xd2,0x40,0xd6,0x3e,0xe4, + 0x6c,0x4c,0xae,0xd1,0x82,0x12,0x94,0x26,0x84,0x46,0x25,0xc1,0xa1,0xf3,0xb7,0xb0, + 0x8e,0xf9,0x19,0x67,0x32,0x13,0x18,0x82,0xcf,0x2b,0x14,0x87,0x44,0x7e,0x26,0x01, + 0xfb,0x6c,0x95,0x25,0x1b,0xe5,0xe2,0x2a,0x30,0xf2,0x08,0x1f,0xfe,0x0d,0xf0,0x7e, + 0x08,0xb6,0x04,0xd3,0x29,0x11,0xf9,0x2a,0xbf,0x94,0x51,0x81,0xb4,0xd2,0x08,0x2a, + 0x15,0x49,0x39,0xc3,0x8d,0x10,0x9a,0x40,0x9e,0x40,0xc8,0x71,0x26,0x24,0x5b,0x42, + 0x7f,0x2b,0x11,0x07,0x43,0x56,0xe4,0x7c,0x45,0x30,0xbb,0xc2,0x30,0xb8,0x6e,0xc0, + 0x3d,0x67,0x37,0x10,0x8e,0x23,0xee,0xc2,0x64,0xc3,0x87,0x08,0x86,0x5c,0x16,0x81, + 0x48,0x98,0x1f,0x53,0x64,0xdc,0xf1,0xb8,0x40,0xb4,0x7e,0x8f,0x23,0x6c,0xab,0xc8, + 0x44,0xcc,0x25,0x71,0xb4,0x03,0x25,0x45,0xb6,0xc7,0x22,0x8e,0x53,0xd2,0xe1,0xf9, + 0xa6,0xa5,0x4f,0xbc,0xb2,0x22,0x96,0x62,0x79,0x8b,0x03,0x13,0x3f,0x19,0x62,0x69, + 0xea,0xaf,0x39,0xbb,0xe5,0x3c,0x85,0xa8,0xe0,0x86,0x53,0x39,0xec,0x0b,0x68,0xe8, + 0x78,0x90,0x36,0xc8,0x12,0xcc,0xe0,0x54,0x60,0x58,0x06,0x3b,0xe0,0x2f,0xd6,0x71, + 0xcb,0xc4,0x66,0xc3,0x03,0xe1,0x4b,0x1e,0xed,0x9c,0x47,0x73,0xc0,0x0f,0x80,0xc6, + 0x94,0xa0,0xca,0xc4,0xf5,0x91,0x64,0x12,0xe6,0x30,0x00,0x59,0x6a,0x54,0x82,0x46, + 0xed,0xcf,0x0d,0xe7,0x09,0xf3,0x4d,0x12,0x80,0xea,0x47,0x7c,0x9e,0xcc,0x03,0x25, + 0x51,0xe9,0x41,0x49,0xaa,0x44,0xbe,0xf3,0xa3,0x02,0x3e,0x47,0x11,0xd4,0x5f,0xd0, + 0x67,0x65,0xbe,0x22,0x85,0xb5,0x78,0xac,0x8c,0x45,0x76,0x54,0xb5,0x0b,0x0b,0x7d, + 0xc2,0xb4,0xb2,0x19,0xaa,0x99,0x9c,0xe2,0x19,0x6d,0xfd,0x1d,0xa2,0x4c,0x7f,0x3f, + 0x42,0xac,0x82,0x16,0x1f,0x6d,0xb2,0x66,0xb6,0xaa,0xdd,0xf8,0x84,0x12,0x1e,0x80, + 0x97,0x06,0xb8,0x18,0x3a,0x13,0x96,0x54,0x76,0x3e,0x01,0x4e,0x58,0x9e,0xf2,0x28, + 0x52,0x31,0x0c,0xdc,0xf5,0xa3,0x5c,0x2b,0xb2,0x25,0xd2,0x71,0x74,0x79,0x7a,0x2a, + 0x83,0xb1,0x29,0x53,0x76,0x70,0xa6,0xbd,0x89,0x31,0xe5,0x83,0x71,0xfd,0xa5,0xb2, + 0x16,0x8c,0x55,0x25,0x10,0x96,0x50,0x64,0x21,0x3a,0xb6,0xb1,0x0b,0xb1,0xca,0x3d, + 0x55,0x92,0x48,0xeb,0x4e,0xf7,0xe8,0x1a,0xff,0xb0,0xff,0xc2,0x01,0xe7,0xdf,0x53, + 0xfa,0x83,0xdf,0xab,0xf0,0xf7,0x59,0x1a,0x52,0xd4,0x26,0x19,0x1e,0x23,0x3f,0x45, + 0x65,0xa0,0x02,0x27,0x49,0x11,0xa0,0xb3,0x25,0xbc,0x6b,0x11,0x4a,0x99,0xba,0xe3, + 0xf1,0xf4,0xcd,0xb9,0x33,0xbd,0xbc,0x72,0x5e,0x39,0xd3,0xf1,0x6c,0xac,0x66,0x2a, + 0xb7,0xd2,0xc1,0x93,0x03,0xdc,0x99,0x69,0xe0,0x23,0xae,0xe3,0x1d,0x5c,0x2d,0x43, + 0x2c,0x53,0x94,0x92,0xfa,0x75,0x7c,0x66,0xbe,0x40,0x2a,0x25,0x01,0x00,0x36,0xb0, + 0xdf,0x4a,0xac,0x24,0xa1,0x81,0xae,0x39,0x70,0x36,0xbc,0x36,0x9c,0x13,0x7c,0x09, + 0x4a,0x94,0x83,0x96,0x87,0x26,0x01,0x75,0xd4,0x0a,0xaa,0x97,0x00,0x44,0x0a,0x78, + 0x72,0x85,0x47,0x84,0x0f,0xb5,0x7e,0x50,0xe1,0x12,0x14,0x10,0xac,0x55,0x78,0x07, + 0x96,0xa1,0x8e,0x53,0x5a,0xa3,0xd1,0xd1,0xd7,0x8c,0x00,0x0c,0xb4,0x71,0x68,0xf8, + 0xc9,0x24,0x0a,0x74,0x5b,0xdf,0xb0,0x53,0xa0,0x3a,0x24,0x14,0xc4,0xce,0x88,0xe3, + 0x1d,0x01,0x13,0x9e,0xa9,0x5c,0xc0,0x88,0x09,0x24,0xd5,0x1f,0xc2,0x12,0x2c,0x05, + 0x7a,0xae,0xc3,0xfa,0x34,0x47,0x10,0x44,0x5f,0x03,0x17,0x33,0x9f,0x85,0xa8,0x9d, + 0xe6,0xfd,0x71,0x1f,0x28,0x42,0x69,0xdd,0x27,0xfd,0x8a,0x00,0x45,0xb1,0xc7,0xea, + 0x59,0x02,0x8f,0x22,0xa7,0x22,0x87,0xbe,0x89,0x8a,0x52,0x84,0x62,0xd1,0x2b,0xcb, + 0x8f,0xf2,0x67,0x93,0x55,0x11,0x6b,0x0c,0xfb,0xdd,0x40,0xd8,0xfb,0x8c,0xcb,0x22, + 0x8b,0x59,0x90,0x2c,0xd5,0x4f,0x1a,0xce,0x9a,0xcb,0x0f,0x11,0xa7,0xc7,0xb7,0xbb, + 0x4f,0x01,0x28,0xee,0xeb,0x05,0xb9,0xbf,0x1b,0xc8,0x21,0x2e,0xc0,0xf6,0xfe,0x77, + 0x03,0x0b,0x9e,0x69,0xd9,0x0e,0x85,0xd5,0x3b,0xf3,0x93,0x8b,0xf4,0xaa,0x61,0xe5, + 0xa5,0x3f,0x51,0x5e,0x07,0xf9,0xb5,0x85,0x0f,0xcb,0xb5,0xac,0xfb,0x5e,0x0f,0xd7, + 0x02,0x0a,0xc2,0xf9,0x85,0xd7,0x1b,0x8f,0x95,0x5e,0xa9,0xd2,0x46,0x85,0x11,0x25, + 0x3e,0xec,0x49,0x18,0xb4,0x63,0x17,0x2c,0x87,0xb9,0x62,0xa0,0x76,0xae,0x12,0x57, + 0x2a,0xd4,0xe5,0x5e,0x27,0x19,0x98,0x38,0x80,0x67,0xb3,0x4d,0x81,0x75,0x79,0x91, + 0xdd,0xa1,0xd4,0x22,0x5e,0x32,0xf4,0xe5,0x90,0x5c,0x16,0x05,0x5c,0x92,0xab,0x2c, + 0x65,0xd2,0x17,0x1c,0x23,0xe3,0xfe,0x32,0x54,0xe9,0x0d,0x04,0xaa,0x30,0x8d,0x12, + 0x72,0x38,0x53,0xf0,0x51,0x2d,0xa8,0x44,0xa3,0xa4,0xf7,0x5e,0x64,0x72,0x37,0x57, + 0xb1,0xef,0xf5,0xea,0xd3,0x93,0x80,0x03,0x7b,0x4f,0xae,0xc7,0x91,0x5b,0x06,0xd6, + 0xd8,0x4f,0xc5,0x78,0x2b,0x56,0x82,0xd4,0x00,0xfc,0x1c,0x94,0xa4,0x83,0xac,0xd2, + 0x6b,0xe6,0xfc,0x9a,0x63,0xc0,0xbe,0x3f,0x24,0x09,0x14,0x27,0xa6,0x74,0x11,0x38, + 0xf8,0xd4,0xb5,0x25,0x14,0x98,0xcb,0x03,0xb5,0x06,0x8e,0x49,0x3c,0x3c,0xb8,0x1e, + 0x04,0x8e,0x48,0x6d,0x37,0x70,0xb4,0xc5,0xab,0x45,0xa4,0x44,0x2c,0x13,0xa0,0xcb, + 0x7e,0xf8,0xf2,0xe3,0x1f,0xe6,0x96,0xa5,0xe7,0xca,0x43,0x7d,0xe6,0xd1,0x1c,0x74, + 0xf4,0x68,0xd9,0xf5,0x14,0x25,0x40,0x6c,0x40,0xc3,0x9f,0x02,0x23,0x83,0x58,0x0d, + 0x2a,0x35,0x18,0x29,0x35,0x31,0xf2,0xe0,0x3c,0xa5,0xdf,0xea,0x3e,0xc5,0x72,0x60, + 0x98,0x3a,0x0a,0xd5,0x87,0xd3,0x89,0x61,0xaa,0x96,0x3f,0x13,0xb0,0xfd,0x4f,0x03, + 0xd0,0xdb,0xb6,0xda,0x01,0x4f,0x7a,0xfa,0x5e,0x7d,0x96,0x6b,0xbb,0xe2,0xd2,0xe2, + 0xc0,0x29,0x0b,0x15,0x47,0x63,0x75,0x4b,0x88,0x48,0xcc,0x2b,0x67,0xa5,0x1e,0x97, + 0xe4,0xc6,0x5f,0x49,0x09,0x56,0x25,0x45,0x24,0x9a,0xdc,0x5b,0xd5,0x5b,0xbc,0xa9, + 0x0a,0xb0,0x6e,0xf3,0xa3,0xbf,0xa0,0x4b,0x33,0xd3,0x7e,0xb7,0xe3,0xd2,0xd4,0x5f, + 0x56,0xc9,0xb7,0xd6,0x35,0x4a,0x21,0x1e,0x07,0xef,0x42,0x11,0x05,0x83,0x48,0x54, + 0x1b,0x97,0x67,0x2b,0xef,0x29,0x73,0x99,0x15,0xdc,0x33,0xaa,0x27,0xb6,0x58,0xda, + 0x99,0xd3,0x97,0x9b,0xce,0x4c,0x83,0x65,0xcb,0x29,0x95,0x26,0x19,0xc7,0x33,0xdb, + 0x9f,0xda,0x56,0x93,0x9e,0xd8,0xb7,0x9a,0xec,0x6e,0xdc,0xdc,0xa2,0x34,0x09,0xd9, + 0x70,0x36,0xf9,0xed,0x37,0xfa,0x5e,0xcc,0xbb,0xf6,0x39,0xe6,0x45,0x0d,0x2a,0xc4, + 0xdc,0x07,0x84,0x5f,0xed,0xfc,0xf1,0x50,0x7c,0x8b,0x4d,0x89,0x34,0x2e,0x36,0x27, + 0x69,0xc9,0x52,0xa0,0x06,0x49,0x03,0x7f,0xac,0xd8,0x52,0x23,0xcd,0x88,0x12,0x67, + 0xd3,0x16,0xcf,0xc7,0x59,0xb6,0x39,0x6e,0x2c,0x1a,0x69,0x72,0x8c,0x1d,0x4a,0xaf, + 0x0d,0xe7,0x6b,0x7a,0x07,0xb6,0xb7,0xbd,0xc3,0xb1,0x4d,0x33,0x60,0x1a,0x21,0xfe, + 0xe2,0x85,0xe6,0x35,0x9f,0x53,0xe0,0xeb,0xca,0xb3,0x52,0x96,0x96,0x57,0x3e,0x26, + 0xae,0x6c,0x4a,0x2b,0xfd,0xb5,0x85,0x91,0xa6,0xb4,0x56,0xb5,0x5b,0xe5,0xd7,0x1d, + 0xa1,0x65,0x25,0xdf,0x7d,0x53,0x4e,0x63,0x63,0x48,0x27,0x0e,0xa4,0xba,0x79,0x54, + 0xac,0x9b,0x43,0xb9,0x94,0xd7,0x5a,0x34,0xde,0x92,0x4e,0x8f,0x9e,0x12,0xec,0xa6, + 0x2b,0x19,0x6d,0x8f,0x62,0xf2,0xe4,0xfe,0xba,0xd0,0xac,0x1d,0x09,0xef,0x1a,0xb7, + 0xe6,0x9f,0x91,0xe8,0xe3,0xf5,0x40,0xb4,0xa6,0x9a,0xc2,0x0c,0xe0,0x2b,0xf6,0x99, + 0xe5,0x30,0xeb,0xac,0x6d,0x63,0x13,0x16,0x4a,0x11,0xb4,0x48,0x97,0xaf,0x47,0x22, + 0x97,0xa2,0xb2,0x29,0x3f,0x88,0x5b,0x1e,0x7d,0x73,0x52,0x6c,0x5d,0x19,0x92,0xe2, + 0x9a,0x7a,0x0b,0x78,0x04,0x95,0xb5,0x35,0x86,0x08,0x43,0xe2,0xae,0x74,0x76,0xe3, + 0xa0,0x6c,0x89,0x90,0x34,0xe7,0x55,0xc8,0xd9,0x7b,0xac,0x1b,0xe8,0x23,0xd8,0xf7, + 0x27,0x1c,0xf5,0xc6,0x7e,0x22,0xcc,0xdd,0xdb,0x55,0xe6,0x59,0xfa,0x69,0x27,0x5f, + 0x1d,0xe0,0xc3,0x99,0x45,0x15,0xa9,0x75,0x86,0x2c,0x87,0x47,0xca,0xc9,0x39,0xdd, + 0x01,0x03,0xeb,0xcc,0xec,0x36,0xe8,0x2c,0x59,0xcc,0x41,0x7c,0x6d,0xa9,0x3f,0xad, + 0xd0,0xfd,0x48,0xa4,0xf1,0x04,0x29,0x34,0x43,0x2a,0x4f,0x23,0x7f,0x69,0x72,0x37, + 0xd4,0x42,0x35,0x1a,0xa7,0xea,0x42,0xc9,0x84,0x44,0xbb,0xf4,0x65,0x13,0x6c,0x54, + 0xb1,0xd2,0x49,0xaa,0x16,0x00,0xaf,0x8e,0x02,0x3a,0xcf,0x7d,0xaf,0x59,0xe9,0xdc, + 0x71,0xea,0xdc,0x0d,0x28,0x69,0x2b,0x3f,0x87,0xb9,0xab,0xf4,0x59,0x81,0xa5,0xbd, + 0xc7,0xb0,0x22,0xd1,0xc9,0x9d,0xa0,0xd3,0xf6,0x74,0xea,0x27,0xdf,0x24,0xf3,0x0a, + 0x04,0x4b,0x95,0x34,0x6b,0x16,0xad,0xb4,0x09,0x2e,0x3a,0x63,0x82,0xd8,0xb6,0xf7, + 0x54,0x67,0x59,0xaa,0xe6,0xa9,0x4a,0x56,0x6b,0x38,0xb5,0xbd,0x87,0x37,0x3b,0xac, + 0x4a,0xc6,0x6a,0xa7,0xe1,0x7e,0xc3,0x65,0x98,0x04,0xae,0xf5,0xf3,0xbf,0x7f,0xfe, + 0x62,0x0d,0x95,0xc6,0x75,0x53,0x34,0x77,0xf7,0x96,0x51,0xc7,0xe8,0x0b,0x2e,0x29, + 0xd0,0x21,0x8c,0x0d,0xb7,0xf1,0x49,0x07,0xe3,0xaf,0xa3,0xed,0x76,0x3b,0xa2,0x46, + 0xc3,0xa8,0xc8,0x60,0x15,0x2a,0xee,0xa1,0xa9,0xa1,0xc9,0xe0,0xc1,0xce,0xb5,0x4a, + 0x30,0xb0,0xce,0xf4,0xf4,0x7f,0xfc,0xf2,0xe9,0x1d,0x6e,0x53,0xb0,0x07,0xce,0x4a, + 0x67,0xb9,0xb7,0x15,0xf5,0xb7,0x97,0x47,0x65,0x45,0x90,0xdc,0x6a,0xb5,0x04,0xf4, + 0xfb,0x4b,0x92,0xfd,0xf6,0x9b,0x85,0x74,0x0d,0x0b,0x3c,0x41,0x2f,0x27,0x33,0xa8, + 0xe2,0x5d,0x2f,0xa4,0xb8,0x1d,0x92,0xd0,0xe5,0x2c,0xe5,0x57,0x6d,0x8b,0xba,0x15, + 0x62,0x9d,0xd1,0xb9,0x14,0x24,0x98,0x1a,0x81,0x3c,0x34,0xab,0xba,0x88,0xa4,0xc0, + 0x1d,0x3c,0x51,0x17,0x8b,0xf7,0x26,0x58,0xba,0x2e,0xa9,0xd8,0x3e,0x7c,0x04,0xe3, + 0x93,0xb5,0xcb,0x20,0xa6,0x43,0x3f,0x5e,0xf3,0x66,0x50,0xd7,0x07,0x23,0xf1,0x11, + 0xd7,0xed,0x84,0x7f,0x04,0x06,0x2a,0xd7,0xb6,0x35,0x75,0x55,0x01,0x1c,0xa1,0xd5, + 0xae,0xf9,0x0c,0x71,0xb2,0x12,0xd9,0x66,0x60,0xd5,0x1d,0xdd,0xe6,0xa5,0xab,0x3c, + 0x7d,0x75,0x17,0x8d,0x93,0xed,0xb5,0x65,0xdb,0xda,0x04,0x9e,0xba,0x03,0x9a,0x3d, + 0x2b,0xde,0xc9,0xad,0x52,0xf5,0xbe,0x2a,0xfa,0x60,0xe0,0x9a,0x9e,0xa9,0xab,0x86, + 0x11,0x0d,0xb1,0xaf,0xb5,0xfe,0x6c,0x1e,0x17,0x51,0x64,0x40,0xe1,0x88,0x49,0x08, + 0x02,0xce,0xac,0xbf,0xfd,0xf5,0xbf,0x4b,0xa0,0xef,0x44,0x84,0x39,0xeb,0x41,0x4c, + 0x1c,0xb3,0xcf,0xbd,0x01,0x13,0x98,0xa0,0x79,0x07,0x20,0x0c,0x55,0x08,0xda,0x51, + 0xcd,0x47,0x85,0xc0,0xac,0x6f,0x9d,0xd1,0xfc,0x99,0xd5,0xbf,0xfe,0x53,0xfc,0xa7, + 0xf8,0xd3,0xaa,0xd9,0x18,0x53,0x0d,0x2b,0xdd,0x7d,0xaa,0x7a,0x58,0xe5,0x85,0xb1, + 0xc2,0xc2,0xf2,0x5f,0x9d,0xa3,0x55,0xf3,0x2a,0x32,0x37,0xce,0xaf,0xba,0x35,0xe5, + 0xb4,0xf4,0x7b,0x78,0xd0,0x6b,0x55,0x40,0x1c,0x8d,0x4a,0x25,0x7d,0xad,0x80,0xf7, + 0x1f,0xfe,0xf0,0xe1,0xcb,0x07,0xeb,0x9f,0x10,0xa7,0x3a,0x3a,0x93,0xdb,0xeb,0x81, + 0xca,0x46,0xca,0x30,0x6a,0x33,0xb7,0x1b,0xb4,0xf6,0x50,0x87,0xb4,0x09,0x13,0xef, + 0xa9,0x61,0x52,0x87,0xc4,0x4a,0x39,0xac,0x6e,0xd8,0xd6,0x1e,0xcb,0x95,0x34,0xdc, + 0x49,0x33,0xdc,0x23,0x63,0xf9,0x9e,0xaf,0xfc,0x22,0x92,0x7a,0x03,0xc2,0x62,0xa5, + 0x16,0xca,0x06,0xf8,0x2e,0x31,0xd8,0x41,0x05,0xb0,0x19,0x94,0x30,0xfc,0x4c,0x5b, + 0x57,0xed,0xab,0x7e,0x7d,0x6e,0x74,0x0d,0xa8,0x4d,0xad,0x82,0xb5,0x0d,0xf0,0xf0, + 0x76,0xe2,0x89,0x2f,0xba,0xf7,0x52,0xe3,0x88,0x07,0x86,0x1b,0xc6,0x5e,0xbc,0x68, + 0x84,0x8f,0x6e,0x4a,0x02,0x26,0x6a,0x37,0x51,0xc1,0x42,0xae,0xf2,0xa5,0x6a,0x4a, + 0x6e,0x45,0x14,0x51,0x53,0x33,0x45,0x64,0xe5,0x30,0x9b,0xca,0x7e,0x1d,0xff,0xd0, + 0x4e,0x22,0x56,0xc6,0x2f,0x5a,0x6d,0xd1,0x40,0xac,0xd4,0xef,0x2d,0xb2,0xee,0xe6, + 0xd2,0xa5,0x66,0x97,0x14,0xaa,0xf5,0x9b,0xc4,0x6d,0xf7,0xd1,0x77,0xc4,0x60,0x37, + 0xb7,0x1e,0xf1,0x9b,0x33,0xeb,0x05,0xb5,0xd4,0x8e,0x53,0x40,0x07,0x34,0x59,0xea, + 0xd5,0xae,0x75,0x60,0x13,0xf3,0xb3,0xb9,0xf5,0xc2,0xb8,0xf4,0x7c,0x6a,0x1d,0xf3, + 0xda,0x7f,0x41,0xae,0x52,0x69,0x8a,0x3e,0xfe,0x77,0x12,0x51,0x3b,0xe9,0x1c,0x28, + 0x84,0xee,0xb8,0x07,0xbe,0x67,0x86,0x5a,0xae,0xd3,0xce,0x50,0x7a,0x2b,0xdd,0xcd, + 0x86,0x1b,0x20,0xb8,0x74,0xd6,0xb1,0xce,0x02,0x47,0x7b,0x90,0xfe,0xeb,0xd3,0x92, + 0x60,0x08,0x9f,0x31,0x5a,0xd6,0x58,0xe3,0x57,0x58,0x6d,0xd9,0xee,0x31,0x17,0xa2, + 0xf2,0xeb,0x80,0xa9,0x5d,0xdf,0xa2,0xbf,0x21,0x3e,0x0f,0x7b,0x26,0xa6,0xfb,0xdd, + 0x6d,0x9d,0x98,0x76,0xdb,0x3f,0xd2,0x3d,0x21,0xcf,0x0d,0x51,0x70,0x1a,0x56,0x55, + 0x51,0xaa,0xbb,0x9d,0x07,0x25,0x5f,0xd8,0xa8,0xdf,0xe9,0x2e,0x53,0x56,0xdd,0xd4, + 0xc6,0xbd,0x2b,0xab,0xee,0x67,0xf3,0xb9,0x5a,0x4f,0x2d,0x74,0x04,0x49,0xe3,0xd9, + 0x98,0x2c,0x74,0xe8,0xf5,0x89,0x5c,0xb4,0xfd,0xed,0xc6,0xb3,0xe1,0x12,0x38,0xf4, + 0xda,0x94,0x97,0xda,0xff,0x1d,0x81,0x8b,0x14,0x16,0x2f,0x52,0x17,0xa6,0x09,0x4b, + 0x7b,0x53,0x8b,0x19,0x75,0x00,0x25,0x5a,0x1a,0x35,0xcf,0x67,0xd6,0x50,0xbf,0x46, + 0x02,0x4b,0x73,0xd0,0xe9,0x27,0x64,0xc7,0x6a,0x10,0x77,0x95,0xe9,0xb5,0x85,0xd0, + 0xc9,0x29,0x51,0x6a,0x7a,0xea,0x26,0x59,0xaa,0x9f,0x36,0xa0,0x57,0x3a,0xdb,0x99, + 0x65,0x5b,0x0f,0x94,0xd2,0xc7,0x65,0xb5,0x46,0xa6,0x88,0x6e,0x76,0x0b,0x7f,0xc8, + 0x1b,0xfd,0x42,0xd5,0xcb,0x3e,0xd6,0x31,0x2c,0x27,0x4e,0xf5,0x0c,0xf5,0x9e,0x27, + 0x0b,0x9a,0x16,0x80,0x91,0xfc,0x27,0xe1,0xa9,0x6d,0xc9,0x47,0xd1,0xac,0x6d,0x32, + 0xdb,0x3b,0xe1,0xbe,0x87,0xa8,0xf5,0xff,0x13,0xb0,0x60,0x8a,0x27,0x40,0x96,0x26, + 0xd4,0x70,0x00,0xcf,0xa9,0x02,0x4b,0xf9,0x05,0xdc,0xc7,0x4a,0x56,0x2b,0xcb,0x54, + 0x60,0x65,0xb7,0x9c,0x86,0xa8,0xf4,0xd2,0xd9,0xbc,0x8a,0xf6,0x07,0x41,0x83,0x36, + 0xe9,0xc0,0x86,0x01,0x9b,0x36,0x97,0x9c,0x4b,0xf5,0x87,0xe9,0xb0,0xc1,0x80,0x66, + 0x86,0x17,0x93,0xc9,0xa4,0x3b,0x6c,0x16,0x98,0xd9,0x5e,0xf5,0x9f,0x04,0x66,0x63, + 0xfd,0xb7,0x26,0x63,0xf5,0xff,0x10,0xfe,0x07,0x44,0x14,0x46,0x18,0x97,0x30,0x00, + 0x00, }; constexpr size_t WIFI_INDEX_HTML_GZ_LEN = sizeof(WIFI_INDEX_HTML_GZ); // diff --git a/firmware/toolchain/console_serve.py b/firmware/toolchain/console_serve.py index ec10c05e..100ebc4c 100644 --- a/firmware/toolchain/console_serve.py +++ b/firmware/toolchain/console_serve.py @@ -442,6 +442,23 @@ def api(self, path, q, p, delete=False): "paramActive": [False, False, False, False], }) + # -- hotspot: the panel's own network -- + if path == "/api/hotspot": + hs = getattr(d, "hotspot", {"mode": "auto", "pass": "patternflow", "up": False}) + if self.command == "POST": + if p.get("mode") in ("off", "auto", "always"): + hs["mode"] = p["mode"] + if "pass" in p: + if not 8 <= len(p["pass"]) <= 63: + return self.send_json({"ok": False, "error": "password is 8 to 63 characters"}, 400) + hs["pass"] = p["pass"] + hs["up"] = hs["mode"] == "always" + d.hotspot = hs + return self.send_json({"ok": True, "pass": hs["pass"], "hotspot": { + "mode": hs["mode"], "up": hs["up"], "ssid": "patternflow-a1b2", + "ip": "192.168.4.1" if hs["up"] else "", "channel": 6 if hs["up"] else 0, + "clients": 0, "dns": 0, "probes": 0}}) + # -- knobs: encoder direction and edges per click, with a readout that moves -- if path == "/api/knobs": inv = getattr(d, "knob_inv", [False, False, False, False]) From 1fc8e39cc9d2907f28652ce848c1d7a5a3d8919d Mon Sep 17 00:00:00 2001 From: engmung <122682380+engmung@users.noreply.github.com> Date: Tue, 22 Sep 2026 20:38:47 +0900 Subject: [PATCH 2/2] firmware: the hotspot gives the station its chance; reconnect wakes it; the host test knows the mode. Three things the first field use found. Booting in `always` mode raised the hotspot at one second and switched the station off under its own first attempt, so a panel with good credentials never joined - the station is dropped only after the fifteen-second grace now, in any mode, and never while a probe is in flight. The console's reconnect did nothing while the radio was AP-only - it brings the station back first. The "someone nearby is scanning" gate on station probes is gone: in a home or a venue somebody always is, and the panel would never have rejoined a network that came back; probes stay off only while a client is on the hotspot. check_network.py compiles core_wifi.h against a mock radio with -Werror: the mock learns getMode()/mode() and the mode constants, and the retry cadence has a fallback define for a build without net_config.h. Co-Authored-By: Claude Fable 5.1 --- firmware/patternflow/src/core_hotspot.h | 20 ++++++++++++-------- firmware/patternflow/src/core_wifi.h | 12 +++++++++--- firmware/toolchain/tests/network_test.cpp | 7 ++++++- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/firmware/patternflow/src/core_hotspot.h b/firmware/patternflow/src/core_hotspot.h index 4be8f758..c0171879 100644 --- a/firmware/patternflow/src/core_hotspot.h +++ b/firmware/patternflow/src/core_hotspot.h @@ -99,11 +99,6 @@ inline void onWifiEvent(WiFiEvent_t e, WiFiEventInfo_t info) { } } -// Someone scanned for us within the last two minutes: a join may be -// under way, and a station probe would take the AP off the air under it. -inline bool joinLikely() { - return lastProbeReqMs != 0 && (uint32_t)(millis() - lastProbeReqMs) < 120000; -} inline const char* modeName(Mode m) { return m == OFF ? "off" : m == ALWAYS ? "always" : "auto"; @@ -211,8 +206,6 @@ inline void start() { WiFi.setAutoReconnect(false); PatternflowWifi::hotspotUp = true; PatternflowWifi::hotspotClients = 0; - // Alone, the radio is the hotspot's: see PatternflowWifi::stationOff(). - if (WiFi.status() != WL_CONNECTED) PatternflowWifi::stationOff(); PatternflowWifi::raiseLinkEdge(); // the console starts on this link too Serial.printf("[HOTSPOT] \"%s\" pass \"%s\" ch%d at %s (%s)\n", name(), pass, channel, WiFi.softAPIP().toString().c_str(), modeName(mode)); @@ -234,7 +227,6 @@ inline void stop() { inline void begin() { load(); if (!eventsHooked) { WiFi.onEvent(onWifiEvent); eventsHooked = true; } - PatternflowWifi::hotspotJoinLikely = joinLikely; staLastUpMs = millis(); // auto mode counts from boot Serial.printf("[HOTSPOT] mode %s, name \"%s\"\n", modeName(mode), name()); } @@ -324,6 +316,18 @@ inline void tick() { } if (want && !up) start(); else if (!want && up) stop(); + // Alone, the radio is the hotspot's (PatternflowWifi::stationOff()): a + // station interface that is merely present drags the AP to a crawl. But + // only once the station has had its chance - `always` at boot used to + // switch it off before its first attempt could finish, and the panel + // never joined the network it had credentials for. A probe in flight + // ends on its own schedule (core_wifi.h). + if (up && !sta && !PatternflowWifi::staProbing && + (WiFi.getMode() & WIFI_MODE_STA) && + (uint32_t)(now - staLastUpMs) >= PF_HOTSPOT_AUTO_AFTER_MS) { + PatternflowWifi::stationOff(); + Serial.println("[HOTSPOT] no station link - radio is the hotspot's"); + } if (up) { dnsPump(); // One line when the client count changes, and one every five minutes diff --git a/firmware/patternflow/src/core_wifi.h b/firmware/patternflow/src/core_wifi.h index 73c66739..7ec7b9e4 100644 --- a/firmware/patternflow/src/core_wifi.h +++ b/firmware/patternflow/src/core_wifi.h @@ -55,8 +55,9 @@ inline int hotspotClients = 0; // (2026-09-22: 13 KB pages cut at 5 KB after 20 s). The station comes // back for one attempt at a time: a rare retry with nobody on the // hotspot, or credentials from the console; if it fails, AP-only again. -// Set by the hotspot: true while a phone has just scanned for the AP. -inline bool (*hotspotJoinLikely)() = nullptr; +#ifndef PF_HOTSPOT_STA_RETRY_MS +#define PF_HOTSPOT_STA_RETRY_MS 300000 +#endif inline bool staProbing = false; inline uint32_t staProbeEndsMs = 0; constexpr uint32_t STA_PROBE_MS = 8000; @@ -382,6 +383,12 @@ inline void tick() { const uint32_t now = millis(); if (reconnectRequested && (uint32_t)(now - reconnectRequestedAtMs) >= 500) { reconnectRequested = false; + if (hotspotUp) { + // AP-only while alone: the station has to exist before it can reconnect. + stationOn(); + staProbing = true; + staProbeEndsMs = now + 3 * STA_PROBE_MS; + } WiFi.reconnect(); } bool connected = (WiFi.status() == WL_CONNECTED); @@ -439,7 +446,6 @@ inline void tick() { return; } if (hotspotClients > 0) return; - if (hotspotJoinLikely && hotspotJoinLikely()) return; interval = PF_HOTSPOT_STA_RETRY_MS; } if (now - lastBeginMs >= interval) { diff --git a/firmware/toolchain/tests/network_test.cpp b/firmware/toolchain/tests/network_test.cpp index 917b0749..3cbec7ec 100644 --- a/firmware/toolchain/tests/network_test.cpp +++ b/firmware/toolchain/tests/network_test.cpp @@ -38,6 +38,9 @@ struct Preferences { }; enum wl_status_t { WL_IDLE_STATUS, WL_CONNECTED, WL_NO_SSID_AVAIL, WL_CONNECT_FAILED, WL_DISCONNECTED }; constexpr int WIFI_STA = 1; +constexpr int WIFI_MODE_STA = 1; +constexpr int WIFI_AP = 2; +constexpr int WIFI_AP_STA = 3; struct IPAddress { uint32_t value = 1; operator uint32_t() const { return value; } @@ -51,10 +54,12 @@ struct Radio { wl_status_t status() const { return state; } IPAddress localIP() const { return ip; } void persistent(bool) {} - void mode(int) {} void setHostname(const char*) {} void setSleep(bool) {} void setAutoReconnect(bool) {} + int modeValue = WIFI_STA; + int getMode() const { return modeValue; } + void mode(int m) { modeValue = m; } void begin(const char* ssid, const char*) { attempts.emplace_back(ssid); state = WL_DISCONNECTED; } bool setTxPower(int) { return true; } int getTxPower() { return PF_WIFI_TX_POWER; }