Commit 9e4ff403 authored by vertighel's avatar vertighel
Browse files

control.html/init.html: enabling échelle; SbigSTL driver reference files



control.html: échelle mode station 3 abilitato in UI; fix refuso di
sintassi Jinja in widget_frame() introdotto aggiungendo Half/Small alla
lista frame (virgola diventata parentesi, rompeva il parsing di tutta
la pagina). init.html: sezione Cooling per la Camera - Échelle (scicam3).

external-software/SbigSTL/: copia di riferimento del driver SBIG v4.9.9
(da github.com/indilib/indi-3rdparty/tree/master/libsbig) con README su
come reinstallarlo — sostituisce il pacchetto Debian libsbigudrv2 (v2,
disallineato) che causava letture di temperatura ed esposizioni rotte
sulla STL-11000M collegata a fork.

Co-Authored-By: default avatarClaude Sonnet 5 <noreply@anthropic.com>
parent ab88b1f3
Loading
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
# Increase USBFS memory

# SBIG ST-7/8/9/10/2K cameras
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0d97", ATTR{idProduct}=="0001", \
RUN+="/sbin/fxload -I /usr/lib/firmware/sbigucam.hex -D $env{DEVNAME}"

# SBIG 4K camera
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0d97", ATTR{idProduct}=="0001", ATTRS{serial}=="3f980000.usb" \
RUN+="/sbin/fxload -I /usr/lib/firmware/sbigpcam.hex -D $env{DEVNAME}"

# SBIG ST-L cameras
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0d97", ATTR{idProduct}=="0002", \
RUN+="/sbin/fxload -I /usr/lib/firmware/sbiglcam.hex -D $env{DEVNAME}"

# SBIG ST-402/1603/3200/8300 cameras
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0d97", ATTR{idProduct}=="0003", \
RUN+="/sbin/fxload -I /usr/lib/firmware/sbigfcam.hex -D $env{DEVNAME} -t fx2"

# Make all SBIG Cameras accessible post enumeration
SUBSYSTEM=="usb", ATTR{idVendor}=="0d97", MODE="0666"
+57 −0
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.16)
project (libsbig)

set (SBIG_VERSION "4.9.9")
set (SBIG_SOVERSION "4")

option(INDI_INSTALL_UDEV_RULES "Install UDEV rules" On)
option(INDI_INSTALL_FIRMWARE "Install Firmware" On)

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules/")
include (GNUInstallDirs)
include(CMakeCommon)
include (InstallImported)

add_library (sbig SHARED IMPORTED)

set_target_properties (sbig PROPERTIES VERSION ${SBIG_VERSION} SOVERSION ${SBIG_SOVERSION})

if (APPLE)

  set (FIRMWARE_INSTALL_DIR "/usr/local/lib/indi/DriverSupport/sbig")

  set_property (TARGET sbig PROPERTY IMPORTED_LOCATION "SBIGUDrvOSX.bin")

  FIX_MACOS_LIBRARIES("libsbig" "SBIGUDrvOSX.bin" "SBIG")

elseif (UNIX AND NOT WIN32)

  set (FIRMWARE_INSTALL_DIR "/usr/lib/firmware" CACHE STRING "sbig firmware installation directory")

  if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
    set_property (TARGET sbig PROPERTY IMPORTED_LOCATION "libsbig_armhf.bin")
  elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
    set_property (TARGET sbig PROPERTY IMPORTED_LOCATION "libsbig_arm64.bin")
  elseif (CMAKE_SIZEOF_VOID_P MATCHES "8")
    set_property (TARGET sbig PROPERTY IMPORTED_LOCATION "libsbig_x64.bin")
  endif ()

  # Install udev rules
  if (INDI_INSTALL_UDEV_RULES)
    set (UDEVRULES_INSTALL_DIR "/usr/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
    install (FILES 51-sbig-debian.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
  endif ()

endif ()

# Install header files
install (FILES sbigudrv.h DESTINATION include/libsbig)

# Install firmware
IF (INDI_INSTALL_FIRMWARE)
  install (FILES sbigucam.hex sbiglcam.hex sbigfcam.hex sbigpcam.hex stfga.bin DESTINATION ${FIRMWARE_INSTALL_DIR})
ENDIF()

# Install library
install_imported (TARGETS sbig DESTINATION ${CMAKE_INSTALL_LIBDIR})
+28 −0
Original line number Diff line number Diff line
Copyright (c) 2001-2014, Santa Barbara Instrument Group
All rights reserved.

Redistribution.  Redistribution and use in binary form, without 
modification, are permitted provided that the following conditions are 
met:

* Redistributions must reproduce the above copyright notice and the 
  following disclaimer in the documentation and/or other materials 
  provided with the distribution. 
* Neither the name of Santa Barbara Instrument Group nor the names of its
  suppliers may be used to endorse or promote products derived from this
  software without specific prior written permission. 
* No reverse engineering, decompilation, or disassembly of this software 
  is permitted.

DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
DAMAGE.
+89 −0
Original line number Diff line number Diff line
# SBIG STL driver (SBIGUDrv) — reference copy

Files here are mirrored from the INDI project's third-party repo:
https://github.com/indilib/indi-3rdparty/tree/master/libsbig

`SBIG_VERSION 4.9.9`, `SBIG_SOVERSION 4` (see `CMakeLists.txt`). This is the
build already installed via `apt` on snoopy (`libsbig-dev`/`libsbig4t64`,
soname `libsbig.so.4`) and now installed by hand on fork, replacing the much
older Debian package `libsbigudrv2`/`libsbigudrv2-dev` (soname `.so.2`)
that shipped with mismatched struct layouts — see the STL-11000M bring-up
notes for what that broke (garbled camera description, temperature query,
Start Exposure).

These files are for **reference only**`noctua/devices/stl.py` loads the
library from the system's standard library search path via `ctypes.CDLL()`
(candidates: `libsbigudrv.so.2`, `libsbig.so.4`, ...), it never reads
anything from this folder at runtime. Firmware upload (`fxload`) and the
udev rule are inherently system-level too. This mirrors how
`AtikCamerasSDK_*` and `VimbaX_*` are kept in this directory: the SDK/driver
lives here for reference and reinstall instructions, the actual runtime
bits are installed system-wide (see `atik.py`'s top-of-file docstring for
the same pattern).

## Files

- `sbigudrv.h` — driver header (struct layouts, `PAR_COMMAND` values);
  `stl.py`'s ctypes structs are transcribed from this file.
- `libsbig_x64.bin` — the actual driver shared library, x86_64 Linux. (The
  upstream repo also has `libsbig_arm64.bin`/`libsbig_armhf.bin` for ARM and
  `SBIGUDrvOSX.bin` for macOS — not mirrored here, fetch from the repo above
  if ever needed.)
- `sbigucam.hex`, `sbiglcam.hex`, `sbigfcam.hex`, `sbigpcam.hex` — EZ-USB
  firmware blobs uploaded via `fxload` on first USB plug-in, one per SBIG
  camera family (`sbiglcam.hex` is the one for the STL-11000M).
- `51-sbig-debian.rules` — udev rule: matches SBIG's USB vendor ID
  (`0d97`), runs `fxload` with the right `.hex` per product ID, and grants
  `MODE="0666"` on the device node regardless of pre/post-firmware PID.
- `LICENSE.firmware` — SBIG's license for the firmware blobs.
- `CMakeLists.txt` — upstream's own install layout (paths, symlink/soname
  scheme); kept for reference, not used directly.

## Installing on a new Linux machine (Ubuntu/Debian)

If a `libsbigudrv2`/`libsbigudrv2-dev` package is already installed, remove
it first — it's an older, ABI-incompatible build:

```bash
sudo apt remove --purge libsbigudrv2 libsbigudrv2-dev
```

Then, from this directory:

```bash
# Library (soname 4, version 4.9.9)
sudo install -m 755 libsbig_x64.bin /usr/lib/libsbig.so.4.9.9
sudo ln -sf libsbig.so.4.9.9 /usr/lib/libsbig.so.4
sudo ln -sf libsbig.so.4 /usr/lib/libsbig.so
sudo ldconfig

# Header
sudo mkdir -p /usr/include/libsbig
sudo cp sbigudrv.h /usr/include/libsbig/sbigudrv.h

# Firmware
sudo mkdir -p /usr/lib/firmware
sudo cp sbigucam.hex sbiglcam.hex sbigfcam.hex sbigpcam.hex /usr/lib/firmware/

# udev rule (remove any old/broken 99-sbig.rules first)
sudo rm -f /etc/udev/rules.d/99-sbig.rules /etc/udev/rules.d/99-sbig.rules.bak
sudo cp 51-sbig-debian.rules /etc/udev/rules.d/51-sbig-debian.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --action=add --subsystem-match=usb
```

No reboot needed — `udevadm trigger` re-processes already-connected USB
devices, which is enough to trigger the firmware upload without physically
unplugging the camera.

## Verifying

```bash
ldconfig -p | grep sbig      # should list libsbig.so.4
lsusb                        # SBIG camera should show "(with firmware)"
                              # in its product string after the trigger
```

`noctua/devices/stl.py`'s `_LIB_CANDIDATES` tries `libsbigudrv.so.2` before
`libsbig.so.4` — with the old package removed, it falls through to the new
library automatically. No code change needed for the switch itself.
+288 KiB

File added.

No diff preview for this file type.

Loading