Skip to content
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

Thorlabs tsp01 service main expects 2 external temp sensors #270

Closed
lanemeier7 opened this issue Dec 11, 2024 · 3 comments · Fixed by #271
Closed

Thorlabs tsp01 service main expects 2 external temp sensors #270

lanemeier7 opened this issue Dec 11, 2024 · 3 comments · Fixed by #271
Assignees

Comments

@lanemeier7
Copy link
Collaborator

The Thorlabs tsp01 temperature and humidity sensor can be configured with up to 2 external temperature sensors. When the temperature sensors are not used the service logs traceback error messages. In cases where none or 1 of the external sensors are used it will log a complaint every measurement check.

def main(self):
while not self.should_shut_down:
try:
temperature = self.get_temperature(1)
self.temperature_internal.submit_data(np.array([temperature]))
temperature = self.get_temperature(2)
self.temperature_header_1.submit_data(np.array([temperature]))
temperature = self.get_temperature(3)
self.temperature_header_2.submit_data(np.array([temperature]))
humidity = self.get_humidity()
self.humidity_internal.submit_data(np.array([humidity]))
except Exception:
# The TSP most likely timed out. Let's log the error, but ignore it.
self.log.error(traceback.format_exc())
# Let's also sleep for a bit in addition to the interval, to let the TSP recover.
self.sleep(self.interval)

@lanemeier7
Copy link
Collaborator Author

Perhaps I could make a configuration indicating which channels are being used.

Ex config entry for sensor1 and sensor2 which can be set to true or false if they are being used and want to be logged.

tsp01_1:
  service_type: thorlabs_tsp01
  simulated_service_type: thorlabs_tsp01_sim
  requires_safety: false
  serial_number: M00797061
  num_averaging: 1
  interval: 1
  sensor1: true
  sensor2: false

Any thoughts @ehpor @steigersg @raphaelpclt ?

@ehpor
Copy link
Collaborator

ehpor commented Dec 11, 2024

Yes, definitely an oversight. You can make the required changes in a PR.

I'd go for:

tsp01_1:
  service_type: thorlabs_tsp01
  simulated_service_type: thorlabs_tsp01_sim
  requires_safety: false
  serial_number: M00797061
  num_averaging: 1
  interval: 1
  read_out_header_1: true
  read_out_header_2: false

I presume it also shouldn't make the data streams if the header is not read out.

@lanemeier7
Copy link
Collaborator Author

lanemeier7 commented Dec 11, 2024

Yes, I was also thinking it would not make the data streams if we don't want the particular sensor read out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants