big scanlight / scanlight v4 control interface documentation

July 11, 2026 ยท View on GitHub

firmware releases

All scanlight hardware revisions now run the same firmware, with hardware support defined by compile-time flags. The old scanlight v2 firmware (firmware_sl2 folder) and web app (app_sl2 folder) are deprecated.

versioncommitFW_VERSION_IDnote
1.043c54250initial release for big scanlight v1
1.107a1f8f1add compatibility for scanlight v4
1.251309042add compatibility for scanlight v4 rev. b PCB, scanlight v2/v3

The information in this document is current as of firmware version 1.2.

USB connection

Scanlight enumerates as a USB Serial CDC device, which can be accessed by, for example, the WebSerial API or PySerial.

communication protocol overview

Both host-to-device and device-to-host communications use the same packet format. The data length byte may be zero, in which case it is the last byte in the packet.

byte indexdescription
0start byte (always 0xFE)
1packet header
2packet data length
>= 3packet data

valid packet headers

host-to-device

PKT_H2D_SET_COLOR = 0
PKT_H2D_GET_DEFAULT_RGB = 1
PKT_H2D_GET_FW_VERSION = 2
PKT_H2D_SHUTTER_PULSE = 3
PKT_H2D_DFU_MODE = 4
PKT_H2D_SET_TRIM = 5
PKT_H2D_GET_TRIM = 6
PKT_H2D_SET_FOCUS = 7

device-to-host

PKT_D2H_LED_TEMP = 1
PKT_D2H_VBUS = 2
PKT_D2H_FW_VERSION = 3
PKT_D2H_DEFAULT_RGB = 4
PKT_D2H_TRIM = 5

web app initial communication flow

  1. Host sends PKT_H2D_GET_FW_VERSION and waits for response. If device firmware version ID is less than LatestFWVersionID (defined in config.js), notify user. LatestFWVersionID is only updated when API-breaking changes are made or significant new firmware features are added.
  2. Host sends PKT_H2D_GET_DEFAULT_RGB and PKT_H2D_GET_TRIM and waits for response. Response values are used to populate GUI.

packet reference

host-to-device

PKT_H2D_SET_COLOR

properties
header0
data length6
data byte indexdescription
0red channel value (0 to 255)
1green channel value (0 to 255)
2blue channel value (0 to 255)
3white channel value (0 to 255)
4IR channel value (0 to 255)
5save preset flag (0 to 1)

Requests the device to update the LED driver state. The device firmware performs input validation, ensuring that maximum power is reduced if operating more than one channel at a time with an insufficient power supply and preventing the white and IR channels from being operated at the same time as the RGB channels. If the 'save preset flag' byte is set to 1, the red, green, and blue channel settings will be saved to nonvolatile memory as the default RGB setting which is used at power-on. The application software should only set this byte to 1 when absolutely needed, as the nonvolatile memory has a finite write cycle lifespan. Note: IR channel value is ignored by the scanlight v4 firmware variant.

PKT_H2D_GET_DEFAULT_RGB

properties
header1
data length0

Requests the device to respond with PKT_D2H_DEFAULT_RGB.

PKT_H2D_GET_FW_VERSION

properties
header2
data length0

Requests the device to respond with PKT_D2H_FW_VERSION.

PKT_H2D_SHUTTER_PULSE

properties
header3
data length1
data byte indexdescription
0shutter pulse length in 10-millisecond units (0 to 255)

Requests the device to output a camera shutter trigger pulse. Timing of pulse length is handled by the device firmware, and timing between pulses is to be handled by the application software. With Fujifilm mirrorless cameras, the minimum shutter pulse length is around 300ms and the minimum pulse interval is around 1000ms in single-shot drive mode. Using a bracketing or continuous drive mode on the camera is necessary for faster shutter actuation. Experimentation with other camera brands is needed.

PKT_H2D_DFU_MODE

properties
header4
data length0

Requests the device to enter device firmware upgrade (DFU) mode. USB serial connection will be lost when this packet is processed by the device.

PKT_H2D_SET_TRIM

properties
header5
data length4
data byte indexdescription
0red channel value (-127 to 127 - two's complement format)
1green channel value (-127 to 127 - two's complement format)
2blue channel value (-127 to 127 - two's complement format)
3white channel value (-127 to 127 - two's complement format)

Requests the device to set the red, green, blue, and white channel trimming settings (the difference between the left and right side LED driver PWM levels). New trimming settings are automatically saved to nonvolatile memory when received. Note: this packet is ignored by the scanlight v4 firmware variant.

PKT_H2D_GET_TRIM

properties
header6
data length0

Requests the device to respond with PKT_D2H_TRIM. Note: this packet is ignored by the scanlight v4 firmware variant.

PKT_H2D_SET_FOCUS

properties
header7
data length1
data byte indexdescription
0focus signal state

Requests the device to set the state of the camera focus control signal (equivalent to half-pressing the shutter button). Setting this signal may be necessary for some cameras to actuate the shutter. On some cameras it may cause the shutter to respond more quickly (good), and on some cameras it may cause undesired autofocusing even when the camera is in manual focus mode (bad), therefore it should be independently controllable from the shutter. Note: this packet is ignored if the hardware does not support controlling the camera focus signal. Currently, only scanlight v4 with the 26a902b PCB revision supports this.

device-to-host

PKT_D2H_LED_TEMP

properties
header1
data length4
data byte indexdescription
0-3LED temperature in millidegrees Celsius (32-bit signed integer in two's complement format)

Telemetry packet sent automatically by the device every 200ms. Note: not supported on big scanlight rev1 hardware (driver PCB PN 25d902a)

PKT_D2H_VBUS

properties
header2
data length4
data byte indexdescription
0-3power USB port VBUS voltage in millivolts (32-bit signed integer in two's complement format)

Telemetry packet sent automatically by the device every 200ms. Note: there is no need for the application software to do anything in response to this packet. USB port voltage changes are handled by the device firmware.

PKT_D2H_FW_VERSION

properties
header3
data length4
data byte indexdescription
0-1device firmware version ID (16-bit unsigned integer)
2-3device hardware version ID (16-bit unsigned integer)

Reports the device firmware and hardware version IDs.

PKT_D2H_DEFAULT_RGB

properties
header4
data length3
data byte indexdescription
0red channel value (0 to 255)
1green channel value (0 to 255)
2blue channel value (0 to 255)

Reports the default RGB settings (used at power-on) stored in nonvolatile memory.

PKT_D2H_TRIM

properties
header5
data length4
data byte indexdescription
0red channel value (-127 to 127 - two's complement format)
1green channel value (-127 to 127 - two's complement format)
2blue channel value (-127 to 127 - two's complement format)
3white channel value (-127 to 127 - two's complement format)

Reports the current channel trimming settings stored in nonvolatile memory. Note: only supported by the big scanlight firmware variant.