Package: microspecgui
Install$pipinstallmicrospecguiThis installs:pygame: Python interface for SDL (Simple DirectMedia Layer),
a highly portable library for low-level access to graphics
hardware and input devices (keyboard/mouse/joystick)pygstuff: helpers to simplifypygameapplicationsmicrospeclib: Chromation's spectrometer dev-kit APIRunConnect the Chromation spectrometer dev-kit, then:$microspec-guiKeyboard Controlsq   - quit
a   - auto-expose (spacebar works also)
x   - decrease exposure time
X   - increase exposure time
h/l - navigate wavelength slow
j/k - navigate wavelength fast
0   - go to shortest wavelength
$   - go to longest wavelengthJoystick ControlsBACK - quit
A    - auto-expose
X    - decrease exposure
Y    - increase exposure
right-stick   - navigate wavelength slow
left-stick    - navigate wavelength fast
left-trigger  - go to shortest wavelength
right-trigger - go to longest wavelengthPlatform compatibilityDeveloped on Windows using Python3.8 andpygame 1.9.6. Tested
on:Windows 8Windows 10Linux Mint 19.3Raspberry Pi OS Lite on:Raspberry Pi v1.2 Model B+ 512MB (2014) -- GUI is slowRaspberry Pi 3 Model B+ (2017) -- GUI is good (like the desktops)Trouble installing pygame on LinuxWindows installs the pygame package with no trouble, but Debian
distributions (e.g., Linux Mint and Raspberry Pi OS) are usually
missing SDL build dependencies and are therefore unable to run
pygame out of the box. For example, on Raspberry Pi OS Lite, I
get this error when attempting topip install pygame(or
when attempting to installmicrospecgui, which in turn installspygame):ImportError:libSDL-1.2.so.0:cannotopensharedobjectfile:NosuchfileordirectoryThis is easy to fix. There are two steps: update the package
manager with source distributions, then install the pygame
build-dependencies.Configure the source listFirst, if you have never built anything from source on your Linux
system, you need to configure your package manager source list
withdeb-srcURLs.Thesources.listfile usually has bothdebURLs anddeb-srcURLs, but thedeb-srcones are commented out. The package
manager needs these sources for installing build dependencies.Open/etc/apt/sources.listand find the lines starting
withdeb-srcthat are commented out. Uncomment these lines.sources.list is a protected file, so you will need to prefix
your text editor command withsudo.sudovi/etc/apt/sources.listFor example, my Linux Mint/etc/apt/sources.listhas this line:# deb-src http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 PackagesI remove the comment:deb-src http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 PackagesSimilarly, on Raspberry Pi OS Lite, there is only one line
starting with# deb-src. Uncomment by erasing the#symbol,
and save the file.Update the package manager with the new sourcesNow doapt updateorapt-get updateto update the newly
configured sources.sudoaptupdateInstall SDL dependenciesNow install the SDL build dependencies:sudoapt-getbuild-deppython-pygameNote this does not install the python-pygame package, but
installs the dependencies for that package, which is exactly
what's needed topip install pygame.Install microspecguiNow finally microspecgui will install with the usual command:$pipinstallmicrospecguiBuild from sourceUnrelated to usingpygameormicrospecgui, your Debian system
is now empowered to build projects from source, for example:sudoapt-getbuild-depvim# powerful text editorThis only installs the necessary build dependencies. To actually
install Vim, clone the official repository and follow the
instructions to run the configure and build scripts.Installing software withsudo apt installis much faster than
building from source. But often, the Debian version is
considerably older than the latest stable version.For example, at the time of this writing, I ran into this with
both Python and Vim, where the available Debian versions were
considerably older and missing features I relied on. When this
happens, I build from source.Trouble running the GUI because it does not see the dev-kitIf the GUI cannot see the dev-kit it is a setup problem with USB.
Windows and Linux each have their own USB setup.Enable VCP driver on WindowsThe dev-kit uses FTDI# FT221X for USB communication. You should
not need to download drivers from the FTDI site, but you do need
to tell Windows toLoad VCPfor this device.This setup only has to be done once for the dev-kit, but if you
are using more than one dev-kit you need to do it for each one.open Device ManagerlocateUSB Serial Converter, right-click and selectPropertieson theAdvancedtab, check the box toLoad VCPGrant USB permission On Linux MintIf this user is communicating with an FTDI device over USB
for the first time, you probably need to add this user to thedialoutgroup. This grants the user permission to communicate
with the dev-kit over USB.This setup only has to be done once for the dev-kit. If you
are using more than one dev-kit, you do not need to do this setup
again.Check hardware is visibleconnect the dev-kit with a USB cableexpect:dev-kit indicator LEDs light uptwo yellow LEDsthree green LEDsdisplay messages from the kernel ring buffer that contain
stringFTDI:$dmesg|grepFTDI[101038.609497]usb3-1:FTDIUSBSerialDeviceconverternowattachedtottyUSB0Check if the current user is part of thedialoutgroup:$groups$USER|grepdialoutIf the user is already part ofdialout, a list of groups is
printed anddialoutis highlighted.If the user is not part ofdialout, nothing is printed.Add this user todialout:$sudoadduser$USERdialoutConfirm the user is part of thedialoutgroup:$groups$USER|grepdialoutFinally, logout and log back in (or simply restart the computer).
Even though the user is listed as a member ofdialout, this
change does not take effect until the user logs back in.