-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Description
If multiple programs try to communicate with the 240, junk might be sent back when the agent is querying the sensors. This junk then can't be cast to float here:
socs/socs/Lakeshore/Lakeshore240.py
Line 337 in 9ab5c5e
| return float(response) |
This causes the acq process to crash. We should catch these instances and log the error, but just move onto the next iteration of the loop and continue querying.
Here are some examples:
2023-02-22T23:53:34+0000 startup-op: launching init_lakeshore
2023-02-22T23:53:34+0000 start called for init_lakeshore
2023-02-22T23:53:34+0000 init_lakeshore:0 Status is now "starting".
2023-02-22T23:53:34+0000 init_lakeshore:0 Status is now "starting".
2023-02-22T23:53:34+0000 attempt 0
2023-02-22T23:53:34+0000 Initialized Lakeshore module: Lake Shore Model 240-2P (LSA21OT)
2023-02-22T23:53:34+0000 start called for acq
2023-02-22T23:53:34+0000 init_lakeshore:0 Lakeshore initialized with ID: LSA21OT
2023-02-22T23:53:34+0000 acq:1 Status is now "starting".
2023-02-22T23:53:34+0000 init_lakeshore:0 Lakeshore module initialized.
2023-02-22T23:53:34+0000 init_lakeshore:0 Status is now "done".
2023-02-22T23:53:34+0000 acq:1 Status is now "running".
2023-02-23T05:34:52+0000 acq:1 CRASH: [Failure instance: Traceback: <class 'ValueError'>: could not convert string to float: '0292.4\r+00.5789'
/usr/lib/python3.8/threading.py:932:_bootstrap_inner
/usr/lib/python3.8/threading.py:870:run
/usr/local/lib/python3.8/dist-packages/twisted/_threads/_threadworker.py:47:work
/usr/local/lib/python3.8/dist-packages/twisted/_threads/_team.py:182:doWork
--- <exception caught here> ---
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:244:inContext
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:260:<lambda>
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:117:callWithContext
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:82:callWithContext
/usr/local/lib/python3.8/dist-packages/socs/agents/lakeshore240/agent.py:221:acq
/usr/local/lib/python3.8/dist-packages/socs/Lakeshore/Lakeshore240.py:337:get_reading
]
2023-02-22T23:00:16+0000 startup-op: launching init_lakeshore
2023-02-22T23:00:16+0000 start called for init_lakeshore
2023-02-22T23:00:16+0000 init_lakeshore:0 Status is now "starting".
2023-02-22T23:00:16+0000 init_lakeshore:0 Status is now "starting".
2023-02-22T23:00:16+0000 attempt 0
2023-02-22T23:00:16+0000 Initialized Lakeshore module: Lake Shore Model 240-2P (LSA21OT)
2023-02-22T23:00:16+0000 start called for acq
2023-02-22T23:00:16+0000 init_lakeshore:0 Lakeshore initialized with ID: LSA21OT
2023-02-22T23:00:16+0000 acq:1 Status is now "starting".
2023-02-22T23:00:16+0000 init_lakeshore:0 Lakeshore module initialized.
2023-02-22T23:00:16+0000 init_lakeshore:0 Status is now "done".
2023-02-22T23:00:16+0000 acq:1 Status is now "running".
2023-02-22T23:06:57+0000 acq:1 CRASH: [Failure instance: Traceback: <class 'ValueError'>: could not convert string to float: 'D-670S-.L,6SN 235000,\r+0.00000'
/usr/lib/python3.8/threading.py:932:_bootstrap_inner
/usr/lib/python3.8/threading.py:870:run
/usr/local/lib/python3.8/dist-packages/twisted/_threads/_threadworker.py:47:work
/usr/local/lib/python3.8/dist-packages/twisted/_threads/_team.py:182:doWork
--- <exception caught here> ---
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:244:inContext
/usr/local/lib/python3.8/dist-packages/twisted/python/threadpool.py:260:<lambda>
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:117:callWithContext
/usr/local/lib/python3.8/dist-packages/twisted/python/context.py:82:callWithContext
/usr/local/lib/python3.8/dist-packages/socs/agents/lakeshore240/agent.py:221:acq
/usr/local/lib/python3.8/dist-packages/socs/Lakeshore/Lakeshore240.py:337:get_reading
]
2023-02-22T23:06:57+0000 acq:1 Status is now "done".
2023-02-22T23:53:13+0000 Received SIGTERM, shutting down.