W
Warsha Everything Mobile
Documentation / BLE Studio / LAN Editor
Browse documentation

Using the Studio

Included with Warsha BLE Studio

v0.9.9

LAN Editor

On Android, the LAN editor exposes the script workspace to a browser on the same local network.

Trusted network only · traffic is not encrypted.

Connect

  1. Open Settings → LAN Editor and choose Start.
  2. Enter the displayed URL on the other computer.
  3. Enter the short pairing PIN shown by the app.

The port is fixed at 8765. The PIN limits accidental access but does not encrypt traffic. Do not use the editor on public Wi-Fi, guest networks, or any network where other people can inspect traffic.

Choose Restart with new PIN to invalidate the current browser session. Stop the server when you no longer need it.

More than one editor at a time

Several browsers can pair with the same PIN, and they all share one script library and one running peripheral: a deploy or a stop from any of them affects the device itself.

Settings → LAN Editor lists the editors connected right now, what each has open, and offers Disconnect for one of them without ending anyone else’s session. Closing a browser ends its own session within a few seconds; one that stops responding without closing — a laptop that sleeps, say — ends after five minutes. Either way, reopening the address and entering the PIN starts a new session.

Two tabs of the same browser share one session, because the pairing is remembered per browser rather than per tab. Two different browsers, or two devices, are two sessions.

If two people edit the same script, whoever saves second is told that it changed, and chooses between reloading what is stored and overwriting it. Nothing is overwritten silently. The same applies when the script is edited on the phone and in a browser at once.

On macOS the same editor is built into the app window, so the Mac does not serve it to other computers. To author in a desktop browser while a phone runs the peripheral, start the LAN editor in the Android app. Everything below works the same in both places.

Scripts made of several files

A script starts as one file. When it outgrows that, Split into files — in the script’s row in the library list, or Code ▸ Split into Files… on the desktop app — turns it into a set of files with one entry file that runs first.

The editor asks before it splits, and shows what would change meaning first: mainly that a top-level var or function stops being visible outside its own file. Splitting is permanent — deleting files afterwards does not undo it — so the confirmation is worth reading rather than clicking through.

Once split, a strip above the editor lists the files:

  • Click a name to switch files. Unsaved work in the file you leave is kept, so moving around inside a script never prompts and never loses anything.
  • + adds a file. Names are plain and flat: codec.js, not ./codec.js or lib/codec.js.
  • Remove deletes the file you are viewing. Make entry changes which file runs first, which also moves where the script’s header comment is read from.
  • A dot on a name means that file has unsaved changes. Save writes every changed file at once.

Deploy always runs what is stored, so it saves first. If that save cannot be written, the run is cancelled rather than quietly running the previous version.

Splitting appears once it is enabled for your build; until then a script that is already split still opens and can be read, but not edited or run.

See Real-time Authoring for deployment behavior and session semantics.