devices/director/isLocked doesn't meet the condition on an external iPad

Ableset 3.1.1, MacOS 26.5.1.

I’ve created a label in canvas that appears when the device is locked:

Very simple and works great on my laptop.

However, this label does not show on my connected iPad. I’ve tried locking/unlocking it on the iPad itself, and also using these various buttons on the laptop:

I’ve also tried accessing the canvas via another computer’s browser and the ‘Locked’ label doesn’t show either (despite being locked).

Any help would be much appreciated :slight_smile: It might be I’m not using this in the way it’s intended.

Adding here that I think I do have a pretty fundamental misunderstanding of how these variables work - showing the IP on the canvas shows that of the host device, not of the current device the canvas is shown on. Clearly I’ve got the wrong idea here.

But it does beg the question… how do we see information pertaining to the device in question? Would be very keen to know!

Hoping to get some enlightenment on the above as I think there’s a broader question about the ‘source’ of these canvases and information.

I had a gig the other night where I had mistakenly forgotten to move some lyric image files over to the B laptop, but they were present on A. The iPad showed an ‘image missing’ error until I put the images on B… so does that mean the canvas is relying on laptop B to source the image? Why would that be?

Hey @LewisDavie,

Please excuse my late reply!

Every browser (laptop screen, iPad, another computer’s browser) is a client connecting to one AbleSet host, the computer running AbleSet. All the OSC values live on that host and are the same for every client viewing it. So /network/ip returns the host’s IP no matter where you look, and ${osc("/devices/director/isLocked")} always reports on the device named “director”, regardless of which screen the canvas is on. On your laptop that name happens to be the thing you’re looking at, so it feels device-relative, but the iPad is reading the exact same host-side value.

Device-specific state does exist, but it’s always addressed by name:

/devices/[name]/isLocked
/devices/[name]/isNavigationLocked
/devices/[name]/isLockButtonHidden
/devices/[name]/page/path
/devices/[name]/battery/percentage

Names are set under Settings → Devices → click a device → OSC Device Names (a device can carry several, comma-separated, e.g. “ipad-1, stage”).

There’s no built-in “who am I” value, but you can make a canvas device-aware with a small workaround using a local variable, since those are stored per browser. Note this isn’t native functionality, just a handy trick. On each device, run this once from a Script button:

// run once per device, using the name that matches its OSC Device Name
setLocal("thisDevice", "ipad-1", true);

The true persists it across reloads. Then set the LOCKED label’s visibility condition to:

${osc("/devices/" + local("thisDevice", "") + "/isLocked")}

Now each device reads its own lock state. (Simpler alternative if you’d rather skip the setup: one canvas per device with the name hardcoded, each device pointed at its own.)

As for your other question, it’s the same “source” idea. Your iPad is connected to one host at a time. Canvas image resources live inside the project’s AbleSet folder (Canvas images in AbleSet/Canvases/Resources, lyrics images in the project folder), and they’re served by whichever host the iPad is connected to. Maybe that night the iPad was being served by laptop B, which didn’t have the files, thus “image missing”, even though A had them.

In an AbleNet setup the app state (playback, setlist, canvas layout) syncs between hosts, but file resources do not, each machine serves its own copy from disk. So as a rule of thumb, keep both machines identical: same session, same setlist, and the full AbleSet folder (images and all) copied to both. If the connected host crashes, AbleSet fails the iPad over to the other host automatically, which is exactly why the backup needs its own copy of everything, or you’d hit the same missing images.

You can always check which host a device is on via the Hosts menu or the URL bar.

Let me know if that helps clear things up!

1 Like

Thanks so much for the detailed and thoughtful reply, @agustinvolpe - I understand a lot better now how this all works!

I also spotted there’s a ‘preferred host’ button on the AbleSet Connect app which I assume means the iPad can have a preference as to which laptop it draws its information from.

The only thing I haven’t yet been able to figure is:

${osc("/devices/" + local("thisDevice", "") + "/isLocked")}

I got the local variable thisDevice set to be ‘Lewis-iPad’ and can see it on the iPad’s canvas editor view, but using the above code as the visibility condition doesn’t show the LOCKED label on the device. Am I missing something?

Hey @LewisDavie,

Yes, in AbleSet Connect the preferred host setting lets the iPad prefer a specific host to draw from, which ties right back into the image-source thing: it’ll pull its resources from whichever host it ends up on.

On the visibility condition not firing, the thing to know is that the local variable is just a string you picked. It doesn’t name the device on its own, it only works if it exactly matches the device’s OSC Device Name, which is set separately under Settings → Devices → (select the iPad) → OSC Device Names. So setting thisDevice to “Lewis-iPad” only helps if the iPad is also actually named “Lewis-iPad” there.

The quickest way to pin down where it’s breaking, drop a temporary Label on the canvas with this exact text (hardcoded, no local variable):

isLocked = ${osc("/devices/Lewis-iPad/isLocked")}

Then lock the iPad itself, using the iPad’s own lock, not the laptop’s Lock App toggle (that one locks the laptop). Watch the label:

  • Reads true when locked / false when unlocked → the name matches and locking works. The only thing left is the local variable in your condition. Add another label ${local("thisDevice", "MISSING")} on the iPad and confirm it reads exactly Lewis-iPad.
  • Reads nothing / undefined → the iPad’s OSC Device Name isn’t “Lewis-iPad” yet. Set it under Settings → Devices and the condition will start resolving.

Also, make sure you’re locking the iPad specifically. The Lock App toggle on the laptop locks the laptop (the “director” device), so /devices/Lewis-iPad/isLocked would stay false and the label would never show on the iPad, which matches what you’re seeing.

Let me know if this solves the issue!