Skip to content

Fixed LS240 connection drop crashing acq process#430

Merged
BrianJKoopman merged 8 commits intomainfrom
ls240_connection
Mar 9, 2026
Merged

Fixed LS240 connection drop crashing acq process#430
BrianJKoopman merged 8 commits intomainfrom
ls240_connection

Conversation

@davidvng
Copy link
Copy Markdown
Contributor

@davidvng davidvng commented Apr 3, 2023

Changed agent code to handle connection drops without crashing the acq process.

Description

When a connection drop occurs, the process will stop the current loop and attempt to run init_lakeshore to re-initialize the data fields. The re-initialization will try once every second until reconnection and then the loop continues.

Motivation and Context

Addresses connection drop issues seen across all groups using LS240's.
Possibly fixes #418 and any other old issues?

How Has This Been Tested?

Tested by pulling USB connection and re-connecting. Testing environment is a nuc machine at Yale running Ubuntu 18.04 (required for Anyplace coolgear drivers to work). Works on LS240's connected either directly to nuc or to the Anyplace device.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@davidvng davidvng requested a review from BrianJKoopman April 3, 2023 15:54
@davidvng davidvng marked this pull request as ready for review April 3, 2023 15:54
@davidvng davidvng added bug Something isn't working agent: ls240 labels Apr 3, 2023
Copy link
Copy Markdown
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, and is definitely an improvement over having no error handling. I made one small change to handle the slightly less broad Exception instead of BaseException, but other than that I'm happy with this for now.

Sorry this sat forever -- it's not how I initially envisioned handling this, and I might change how it works again soon (generically for all serial devices), but I wanted to get this merged, finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent: ls240 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serial collisions cause LS240 to respond with garbage and crashes the agent

2 participants