Golang library and example command line tool for SEKONIC spectrometers remote control.
Based on original C# SDK for Windows from SEKONIC.
- Sekonic C-700
- Sekonic C-800
- Sekonic C-800-U (US Version. Basically the same as C-800)
- Sekonic C-7000 (supports extended measurement configuration: FOV and Exposure Time)
- Darwin
- Windows
- Linux
Currently only ambient measuring mode is supported.
TM-30, SSI and TLCI measurements are available for Sekonic C-7000 with FW version > 25 but parsing of these fields is not implemented yet.
Default implementation uses gousb wrapper for the libusb library.
You must have libusb-1.0 installed on your target system to be able to communicate with USB devices.
Installation for different platforms is covered in gousb documentation.
If you use Linux, you probably already have it. If you use Mac ot Windows and was using USB devices that needed custom driver, you also probably have it.
Alternatively you can provide custom USB implementation with simple interface close to io.Reader. See the default gousb based implementation for reference.
You need Go
programming language to be installed first.
See the Go's Download and install page for installation instructions for different OS.
On MacOS just use Homebrew:
homebrew install go
-
Connect your device.
-
Run one measurement:
go run ./cmd/skread measure -s
- Get info about other available options:
go run ./cmd/skread --help
go run ./cmd/skread measure --help
Go will take care of dependencies when running this script for the first time.
The example program can be also run as a web server:
go run ./cmd/skread webserver
By default it will start HTTP server on port 8080 and will be exposed to all network interfaces (i.e. accesible to anybody from the LAN):
🚀 HTTP server started at http://0.0.0.0:8080
Press ctrl+c to stop.
Then you can access it via browser or curl:
curl "http://0.0.0.0:8080/measure?name=My%20Measuremente¬e=Don't%20Panic"
To test it without connecting the device, you can use fake
flag:
curl "http://0.0.0.0:8080/measure?fake=1"
go build ./cmd/skread
This will create binary executable file named skread
in the same directory.
Run the executable:
./skread --help
Now you can run this file on any other machine with the same OS and architecture as the one you built it with. But remeber about USB driver dependency mentioned earlier, it is needed for program to run.
Note: the cmd/skread/main.go is just an example of the library usage. If more specific funtionality is needed, you always can create your own Go program and import the library in the same way as example does. Go will fetch it automatically.
Example:
- Create your project dir:
mkdir my_skreader && cd my_skreader
- Initialise Go module named
my_skreader
and addskreader
library as an external dependency:
go mod init my_skreader
go get github.com/akares/skreader
- Download
main.go
example file there (or create manually):
curl -OL https://raw.githubusercontent.com/akares/skreader/main/cmd/skread/main.go
- Run:
go run . --help
-
Modify the program according to your needs.
-
Build standalone executable (if needed):
go build -o my_skreader ./main.go
./my_skreader --help
You will still need to take care of the USB driver dependency mentioned earlier.
See the skread command implementation for details.
- Use
gofmt
- Ensure unit tests are okay:
go test ./...
- Ensure Go linter finds no errors:
golangci-lint run .
This project is licensed under the terms of the MIT license.
All product names, logos, and brands are property of their respective owners. All company, product and service names used in this package are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.
- SEKONIC is a registered trademark of SEKONIC CORPORATION.
- Google is a registered trademark of Google LLC.
- Windows is a registered trademark of Microsoft Corporation.
- Linux is the registered trademark of Linus Torvalds.