Skip to content

Latest commit

 

History

History
64 lines (42 loc) · 5.27 KB

linux.md

File metadata and controls

64 lines (42 loc) · 5.27 KB

LightKeeper on Linux

The Qt window, background recorder and recorded-run viewer run on Ubuntu 24.04 x86-64 with Python 3.12. The Maya2000 Pro uses the Linux OceanDirect SDK. The USB650 uses PySeaBreeze with libusb. A simulator is available with the base installation.

Install and start

In the LightKeeper checkout, create a Python environment for LightKeeper. Install Ubuntu's python3-venv first if needed. A graphical desktop needs the system libraries for Qt's X11 or Wayland platform plugin. Qt Linux requirements

venv="${XDG_DATA_HOME:-$HOME/.local/share}/lightkeeper/venv"
python3 -m venv "$venv"
"$venv/bin/python" -m pip install -r requirements-ubuntu2404.txt
"$venv/bin/python" -m pip check
sh ./Launch_LightKeeper.sh

The launcher accepts an active virtual environment or an explicit LIGHTKEEPER_PYTHON=/absolute/path/to/venv/bin/python. The default data directory is ~/Documents/LightKeeper Runs. Set LIGHTKEEPER_DATA_ROOT to change the initial destination. Recovery records and logs use ${XDG_STATE_HOME:-$HOME/.local/state}/lightkeeper. Set LIGHTKEEPER_TZ to the observing site's IANA time zone if it differs from the default America/New_York. Recording timestamps are UTC nanoseconds.

Physical spectrometers

For the Maya2000 Pro, extract Ocean Optics' Linux OceanDirect SDK and point OCEANDIRECT_HOME at its root. LightKeeper expects python/oceandirect/OceanDirectAPI.py below that directory. The reference hardware run used OceanDirect 3.3.0 and Ubuntu's libusb 1.0 runtime. Follow the vendor's installation and USB access instructions for your recording account. OceanDirect downloads

export OCEANDIRECT_HOME=/absolute/path/to/extracted/OceanDirect
sh ./Launch_LightKeeper.sh

For the USB650, install its optional transport in the same environment and give the recording account read/write access to the spectrometer's USB device node. The Linux PySeaBreeze adapter selects the USB650 by USB product ID and serial. It preserves the detector's native pixel order and 12-bit count range.

"$venv/bin/python" -m pip install -r requirements-usb650.txt
"$venv/bin/python" -m pip check
sh ./Launch_LightKeeper.sh

On a native Ubuntu desktop using logind, an administrator can grant the active local user access to these two models by installing the following rules in /etc/udev/rules.d/70-lightkeeper.rules if existing vendor rules do not already grant access. Reload udev rules and reconnect the instrument between runs for the change to take effect.

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2457", ATTR{idProduct}=="102a", TAG+="uaccess"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="2457", ATTR{idProduct}=="1014", TAG+="uaccess"

On WSL2, physical acquisition requires forwarding the selected USB device to Ubuntu. Finish any active Windows recording first. The Maya2000 Pro USB ID is 2457:102a; the USB650 ID is 2457:1014. Only the operating system currently holding the device can record from it. Microsoft WSL USB instructions

Autonomous recording

Keep the Linux session and computer running during collection. Closing the window leaves the supervisor and recorder active. For the midnight prompt and the two kinds of saved spectra see the manual. Reopen LightKeeper to attach to an active recorder. The recorder owns the countdown even when the desktop is unavailable.

With a systemd user manager, LightKeeper installs a user timer while a run needs recovery. The timer checks for lost recorder/supervisor processes. An opted-in run can also resume after sign-in within its recovery window. Check systemctl --user status lightkeeper-watchdog.timer during an active run. LightKeeper asks logind to inhibit sleep during collection. System policies, laptop lid actions and WSL host sleep remain under control of the operating system.

On systems without the user manager, the detached supervisor can restart its recorder. After losing both processes or restarting the system, reopen LightKeeper and resume the interrupted run. The run log reports an unavailable watchdog timer.

For a separately mounted local data disk with a filesystem UUID, LightKeeper saves the UUID and the path within that filesystem. Recovery and daily rollover can find the disk at a new mount point. If the disk is absent or its identity is ambiguous, the recorder waits to start the next day. Paths on the system root, WSL Windows-drive mounts and network shares use their configured mount paths.

Verify the installation

Run the offscreen simulator acceptance check from the checkout. It creates a fresh test profile, writes a short run and checks its HDF5 channel axis, timestamps, dark sets, burst frames, figures and final journal.

"$venv/bin/python" -X utf8 tests/linux_sim_recording.py --evidence-dir "$HOME/LightKeeper-checks"
QT_QPA_PLATFORM=offscreen "$venv/bin/python" -X utf8 tests/gui_night_prompt.py

The Linux hardware adapters were exercised in earlier 0.4.4 bench recordings on Ubuntu 24.04 under WSL2. The 0.5.0 Linux checks use the simulator and USB transport tests. Live reboot recovery requires a systemd desktop session with access to the spectrometer.