-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tau2 with TeaxGrabber - timeouts in fpa and housing temperatures #34
Comments
Yep this is currently a bit buggy due to the way the serial stream is implemented. I think it's just losing sync when the messages are sent back from the camera. Not sure if there's an easy fix here without re-writing the stream handling code to be more like a proper state machine. But we can do the same as before - if you can dump the serial buffer just before the error I can take a look and see if we can figure something out :) In theory what should happen is when you query the camera, we start looking for a magic string in the buffer and process the response as normal a normal Tau2. By the way in the code, the calls to receive packets are actually overriden by the Teax class. Lines 658 to 668 in b48b643
Lines 616 to 631 in b48b643
As before, we can try changing One concern is perhaps we accidentally discard the data before waiting for it. But.. the problem you're getting isn't a timeout in command sync otherwise you'd get that warning. So it does seems like a packet decode problem - if you can send me a serial dump I'll take a look. The temp read function is pretty well unit tested on the Tau so I would lean towards we're just incorrectly getting data out of the stream, rather than the decoder is wrong. |
I changed to data += self._read() on both functions, without results. Here are the logs: |
Can you save the entire data buffer from _sync_uart? (e.g. just before the return - so it should start with "UART") |
log__sync_uart_failed_2.txt |
Try (as when you had trouble with image capture):
just before:
But this is interesting, it looks like each byte is packed. Ok should be quite easy to fix this, probably needs a new function that will read out a certain number of UART bytes.
I'm curious about the case when this works though... it seems like the format isn't always like that. Maybe this happens when the data are interleaved. |
I tried using pickle instead:
Results: |
Hello,
I'm using Tau2 with the TeaxGrabber.
get_fpa_temperatures() and get_housing_temperatures() sometimes returns the correct values, and sometimes returns errors such as:
Initial packet byte incorrect. Byte was: 67
Error reply from camera. Try re-sending command, or check parameters.
Initial packet byte incorrect. Byte was: 93
Error reply from camera. Try re-sending command, or check parameters.
Initial packet byte incorrect. Byte was: 0
Error reply from camera. Try re-sending command, or check parameters.
.....
I noticed no pattern - sometimes I'm able to get 5 measurements in a row, sometimes it fails after just 1 measurement.
I tried adding sleep() between sending to receiving, without results.
I tried reconnecting the Tau2, and resetting the PC a couple of times.
Thanks for the great package (again :-))
flirpy/flirpy/camera/tau.py
Lines 153 to 176 in b48b643
The text was updated successfully, but these errors were encountered: