[argyllcms] Re: [DIY Colorimeter] Identification and communication with a device.

  • From: Marc Clarac <clarac.marc@xxxxxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Tue, 15 Feb 2022 09:57:49 +0100

Hello,
Thanks for your fast and complete answer!

Marc Clarac wrote:

Hi,

I plan on
using an AMS AS7341 color sensor, and a microcontroller I already have
like
an Arduino Leonardo or Teensy 3.2.

the AMS AS7341 is an interesting device, although it probably won't
make a very accurate colorimeter due to it's limited number of
spectral bands (i.e. you can't emulate the standard observer
sensitivity curves very accurately with the limited number of bands.)
The Colorhug device uses 4 bands (RGB+clear). I also have a Spyder2pro.
It also uses a 3 band sensor. One of the evolutions of Datacolor
colorimeters
was the use of 7 filters/sensors on the Spyder4 device.
That's why I thought using this sensor could give me better results than
with
my colorhug1 or the old Spyder2pro I have.
For a while I have been thinking of building a diy spectrometer using a
diffraction grate, a ccd sensor and writing simple python software. Is this
kind of
device better than a colorimeter for display calibration ?
Do I call it "colorimeter" wrongly ?
A challenge in making your own instruments is figuring out how
to calibrate them.
It is ! And that's where I had so much fun on another project :
A friend of mine is a teacher in a school with persons with sensory
impairments.
In his classroom, she has achromats pupils.
We've worked on a portable device to help them "see color".
I used an arduino, the TAOS TCL3200 sensor (used in colorhug) and a
display.
I spend a lot of time calibrating it to get good results, using color paper
first,
then colorcharts for cameras. This was the most thrilling part of the
project.

1) I don't understand (nor have found yet) how argyllCMS knows whether an
usb device is a colorimeter or any device it can communicate with. I know
USB devices are identified by PID and VID but I'm not sure it is enough.
Is
there any documentation about the identification of a device for
ArgyllCMS ?

Most of the code is in the source sub-directory spectro, with the core
definitions in spectro/inst.h. There is no comprehensive documentation,
just working code and examples. If you are writing a new driver you
should use one of the existing drivers as an example, i.e.
spectro/colorhug.c.

I've put a general overview of the API here: <https:/
www.argyllcms.com/instlib.api.txt>,
and I'll also include it in the spectro directory in future releases.

2) I've partially read the colorhug 1 and 2 source code on github. It
uses
a protocol made of bytes commands and the answers are variable length
arrays of bytes, containing the answer of the sensor. The answers sent by
the sensor are also described in the source code.
Is there any argyllCMS protocol already documented I should use and if
it's

There is no standard protocol. A lot of early instruments and many of the
high end instruments use a human readable text protocol. Cheaper
instruments
have tended to use binary protocols. Sticking to HID USB has advantages
in terms of driver support on MSWindows, and there is some out of the
box support for this on Teensy (although you have to delve into it
a bit if you want a custom VID/PID - I can tell you more about that
if you are really interested.) If you use HID then it's best to
formulate a protocol in terms of 64 byte messages.
If I can use human readable protocol, such as simple serial communication,
I'll use it.
Most of my previous projects uses serial communication between computer and
devices.
I quickly skimmed the header files of some devices (colorhug, hcfr, huey,
dtp51).

I'm a bit lost for now.

Sounds like a worthwhile project if you want to learn about how
to create a USB peripheral and how to get software talking to it,
but you will have to get your head around a few different things
to make it work.
I appreciate this encouragement. I don't feel lost anymore ! Many thanks for
your answers ! I will go on this project, even if the final device does'nt
meet
my expectations, I'm sure I will have learned something.
Best regards,
Marc.

Cheers,
       Graeme Gill.

Le lun. 14 févr. 2022 à 23:10, Graeme Gill <graeme@xxxxxxxxxxxxx> a écrit :

Marc Clarac wrote:

Hi,

I plan on
using an AMS AS7341 color sensor, and a microcontroller I already have
like
an Arduino Leonardo or Teensy 3.2.

the AMS AS7341 is an interesting device, although it probably won't
make a very accurate colorimeter due to it's limited number of
spectral bands (i.e. you can't emulate the standard observer
sensitivity curves very accurately with the limited number of bands.)

A challenge in making your own instruments is figuring out how
to calibrate them.

1) I don't understand (nor have found yet) how argyllCMS knows whether an
usb device is a colorimeter or any device it can communicate with. I know
USB devices are identified by PID and VID but I'm not sure it is enough.
Is
there any documentation about the identification of a device for
ArgyllCMS ?

Most of the code is in the source sub-directory spectro, with the core
definitions in spectro/inst.h. There is no comprehensive documentation,
just working code and examples. If you are writing a new driver you
should use one of the existing drivers as an example, i.e.
spectro/colorhug.c.

I've put a general overview of the API here: <https:/
www.argyllcms.com/instlib.api.txt>,
and I'll also include it in the spectro directory in future releases.

2) I've partially read the colorhug 1 and 2 source code on github. It
uses
a protocol made of bytes commands and the answers are variable length
arrays of bytes, containing the answer of the sensor. The answers sent by
the sensor are also described in the source code.
Is there any argyllCMS protocol already documented I should use and if
it's

There is no standard protocol. A lot of early instruments and many of the
high end instruments use a human readable text protocol. Cheaper
instruments
have tended to use binary protocols. Sticking to HID USB has advantages
in terms of driver support on MSWindows, and there is some out of the
box support for this on Teensy (although you have to delve into it
a bit if you want a custom VID/PID - I can tell you more about that
if you are really interested.) If you use HID then it's best to
formulate a protocol in terms of 64 byte messages.

I'm a bit lost for now.

Sounds like a worthwhile project if you want to learn about how
to create a USB peripheral and how to get software talking to it,
but you will have to get your head around a few different things
to make it work.

Cheers,
        Graeme Gill.



Other related posts: