I am bulding an experiment that involves three teensy boards. Two act as spectrometers, and the third acts as an analog i/o and produces a trigger that goes to the two spectrometers. The system is controlled by a python program running on a T440 laptop. The python program uses pyserial to talk to the three teensy boards.

Each of the three boards works great when I use them one at a time, or with the daq board in combination with one of the spectrometers, or even with all three boards going at the same time, if the two spectrometers are clocking themselves.

Now comes the curious part.

if I start the program with either spectrometer, again everything is great. And even if i start it with two spectrometers, and command spectra from both, everything is still okay again

But if I start looping over the command to send spectra from both spectromters, or even just the second by itself, then communication with that second spectrometer soon fails.

After a week of debugging and testing, I remain with the hypothesis that the failure is in the usb system or pyserial.


Has anybody had similar experience?

And, is there a better way , in particular in python, to talk to the boards from a liunux pc?

Thank you