Water relay: browser-only setup

Use Cloudflare Workers Free. This setup uses a Worker and a small D1 database. No terminal, GitHub, or paid plan is required.

  1. Upload the site. In your existing Cloudflare Pages project, create a new production deployment and upload water-windows-pages-v6-relay.zip.
  2. Create the database. In the Cloudflare dashboard, open Storage & databases → D1 SQL database → Create database. Name it water-windows. Leave the location at its default and create it.
  3. Create the relay Worker. Open Workers & Pages → Create application → Start with Hello World (then Get started if shown). Name it water-relay and select Deploy.
  4. Connect the database. Open the new water-relay Worker. Go to Bindings → Add binding → D1 database. Set the variable name to DB, exactly uppercase. Select the water-windows database and add the binding.
  5. Add the relay code. In the Worker, select Edit code. Replace all the starter code in the main JavaScript file with the code below. Click Deploy. The database table is created automatically; no SQL commands are needed.
  6. Check the relay. Open the Worker's production https://water-relay.…workers.dev address. It should display Water relay ready inside a short JSON message. Copy that address, not the Cloudflare dashboard or preview address.
  7. Connect the iPads. Open your Pages site on both. Paste the same Worker address into Relay address. On the first iPad choose Create room. On the second, enter the 10-character room code and choose Join room. Both should say Both iPads connected. Plug the clicker into the first iPad and enter window view on both.

Worker code

During the event

Next / Down descends. Previous / Up stops smoothly. Reset jumps back without reversing. Cues, including Reset, are scheduled about 1 second after the server receives them, so both windows can act together. Slow internet can add delay. Rehearse the timing with the elevator.

Global animation settings are on the first iPad and apply to both. Hold the top-left corner for 1.2 seconds to return to setup. Keep Safari in the foreground and the iPads charged. The site requests a screen wake lock; verify that neither device locks during your rehearsal. At the end, select End session on the first iPad and Disconnect on the second.

Four hours and cost

One pair should fit the current free quotas for four hours. The first iPad contacts the relay every 2 seconds and the second every 0.5 seconds: at most about 36,000 routine Worker requests over four hours, plus each cue and occasional retries. A short timed-out request reduces the polling rate; it does not create a request burst. Database presence updates use about 10,800 writes, plus cues. Animation stays on the iPads; no video is streamed.

Workers Free currently includes 100,000 requests per day per account. D1 Free includes 5 million rows read and 100,000 rows written per day. Other Workers, earlier testing, extra browser tabs, or additional iPads use the same allowances. Check Cloudflare usage before the event and close unused tabs. Stay on the Free plan: reaching its limits stops requests rather than buying extra usage.

Rooms last 24 hours, so there is no four-hour session timeout. This is not a guarantee of uninterrupted operation: Wi-Fi in the elevator, battery, iPad temperature, screen locking, browser behavior, Cloudflare availability, and account quotas can interrupt it. A local two-window test and accelerated four-hour movement checks passed. A real four-hour test on your iPads and Emerson's network has not been performed.

If it does not connect

Binding error: confirm the database binding is named DB on the Worker, then deploy.
Relay timed out: open the Worker address directly on the affected iPad and check internet coverage.
Room not found: create a new room and join its new code.
Connection lost during a ride: descent pauses locally after loss is detected. Reconnection restores the shared position and may jump. Reset both windows before the next ride. Missed button presses are not replayed later.
Free quota reached: requests stop until the allowance resets. Do not leave spare test windows connected.

Eduroam no longer needs to allow the iPads to communicate directly. Both iPads still need ordinary HTTPS access to your Worker throughout the ride. Keep the room code private; anyone with it can join as a viewer. Only the first iPad holds the separate control credential.

Cloudflare references, checked October 20, 2026: dashboard setup, Workers limits, D1 pricing.