Skip to content
thinkvpPublic

About

Android app: match Nanlite lights to ambient with the phone camera

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

LightSet

Android app for matching interview lights to the ambient light. Point the phone at a white or grey card, save the ambient as a reference, and LightSet adjusts Nanlite lights over Bluetooth until their colour matches it.

What it does

  • Meter: colour temp and tint (Duv) of the light on a card, from the phone's RAW sensor data. Exposure is metered on the sampled box and stepped down if it clips.

  • Calibration: one tap steps a trusted light (e.g. a Forza 60C) through 2700–6500 K and corrects the phone's colour matrices from what it reads. Manual calibration is also available.

  • Set ambient: one tap switches the lights off, reads the room until it's steady, saves it as the reference (named with the day and time) and turns the lights back on. Each reference shows its age, in amber after 3 hours. A reference more than 6 hours old isn't picked up when the app starts; it's offered with "Use last" instead.

  • Match: sets a light's CCT and G/M, reads it on the card with the ambient subtracted (the light blinks off once to read the ambient), and adjusts until it's within 5 mired and 1.5 tint. Brightness is left where you set it. If a light can't reach the tint (no G/M, or out of green at warm CCTs), it matches CCT and suggests a gel.

  • IM150: the Illuminati IM150 colour meter can be used instead of the phone (Phone / IM150 at the top of Match) for readings, references and Match. When it's connected, calibration uses its reading of the light as the target instead of the light's setting. The meter takes one connection at a time, so close the Illuminati app first.

  • Exposure: while the IM150 is connected, a bar at the bottom of the Lights tab (so it's in view while setting key and fill) works out aperture, ISO, shutter angle and ND from the meter's lux (or a light value set by hand), for a chosen frame rate. Lock the settings to keep; if they can't all be met, it says how much light to add or cut.

  • Lights: adds Nanlite lights to its own Bluetooth Mesh network (after a Bluetooth reset on the light), then controls brightness, CCT, G/M and colour (HSI) for each, with online/offline status. Each light can be switched off and back on to its previous settings, here and on the Match tab. When the app starts it asks before connecting, since connecting can put lights set up by hand back to the app's settings. Opening the Lights tab checks the lights (and reconnects) straight away.

  • Sun: where the sun will be and what the sky will do, in three views:

    • Camera (shown on opening): the day's sun path over the live camera, coloured for daylight, golden hour (+6° to −4°) and blue hour (−4° to −8°), with each hour as its forecast sky's icon, compass points along the horizon and the sun now. A slider painted with each hour's sky picks a time; the panel shows that hour's sky, rain chance, cloud, temperature and wind, and the sun's bearing and height as small dials. Phone compasses drift, so "line up" (the crosshair) lets you tap the real sun to correct it until the app closes.
    • Day: sunrise and sunset with compass directions, solar noon, golden and blue hour, a graph of the sun's height over each hour's sky, and an hourly list of the sky, rain chance and cloud (as icons), wind (an arrow the way it blows, speed and gusts) and temperature. Wind turns amber when gusts reach 40 km/h (25 mph), enough to trouble stands, frames and audio. Temperature and wind follow the phone's region: °F in the US, mph in the US and UK, °C and km/h elsewhere (Android 14's Regional preferences can override the temperature unit).
    • Map: the sun drawn around a place on an OpenStreetMap map (OpenFreeMap tiles): the day's path as a ring (higher is nearer the middle), sunrise and sunset lines, and the sun at the slider's time with its shadow. Hold the map to drop a pin, or search by name; Day then shows the pin too, in its own time zone.

    The sky is judged by how much of a clear sky's direct sunlight the Open-Meteo forecast says gets through (16 days ahead), so thin high cloud still reads as sun. The forecast is fetched again on opening the tab unless it's under 10 minutes old. It uses approximate location, and keeps the last place and forecast for use without signal. The APK is built for 64-bit ARM phones only, as the map's native code for every ABI would double its size.

  • Updates: when the app starts it checks GitHub for a newer release and offers to download it (installs over the current version), or to ask again tomorrow or in a week.

How the lights are controlled

Nanlite lights with Feasycom Bluetooth modules are Bluetooth Mesh nodes. They take the Nanlite "app protocol" (see vmedea's notes) inside vendor messages: opcode 0xC1 1111 plus an 8-byte short packet, or a segmented extended packet for set_mode (CCT ⇄ HSI). They use the Mesh specification's sample app key at index 0. Some firmware installs it on joining; for the rest LightSet adds it and binds the vendor model with the light's device key.

Quirks found so far:

  • Any write makes the light re-apply brightness, CCT and G/M from values its module stores, and those reset on reconnect. So the app owns each light's full state and sends all of it every time, with G/M last.
  • Knob changes on the light aren't reported back, and reads return the module's stored values, not the knobs'. A vendor read also makes the light re-apply those stored values, so the app never reads a light just to check it's there: it sends a Config message with the light's device key instead, which leaves knob settings alone. Lights added by other apps (no device key) still get a read, so add every light through LightSet.
  • Some lights (e.g. PavoTube) act on writes but don't answer reads, so status is checked with a configuration request instead.

Build

Tooling lives outside the repo in F:\AndroidTools (JDK 17, Android SDK, Gradle).

JAVA_HOME=/f/AndroidTools/jdk17 ./gradlew.bat :app:assembleDebug :app:testDebugUnitTest

Install on a USB-connected phone with USB debugging enabled:

/f/AndroidTools/sdk/platform-tools/adb.exe install -r app/build/outputs/apk/debug/app-debug.apk

Each install makes its own random mesh network key, stored on the phone.

About

Android app: match Nanlite lights to ambient with the phone camera

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages