New version 2.1.0-dev can't talk to sangaboard

Steps:

  1. ofm stop
  2. ofm start
  3. refresh Chrome (resets eV)
  4. connect
  5. close the two 500 error codes (without messages)
  6. close the version warning

Results (in the log):

[2020-03-26 14:16:18,337] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:16:18,343] [MainThread] [INFO] Saving /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:16:18,853] [MainThread] [INFO] Closing <openflexure_microscope.microscope.Microscope object at 0x75e8f070>
[2020-03-26 14:16:18,855] [MainThread] [INFO] Closing <openflexure_microscope.camera.pi.PiCameraStreamer object at 0x73de8510>
[2020-03-26 14:16:18,868] [Thread-1] [INFO] Stopped MJPEG stream on port 1. Switching to [3280, 2464].
[2020-03-26 14:16:19,194] [MainThread] [INFO] Closed <openflexure_microscope.camera.pi.PiCameraStreamer object at 0x73de8510>
[2020-03-26 14:16:19,236] [MainThread] [INFO] Closed <openflexure_microscope.microscope.Microscope object at 0x75e8f070>
[2020-03-26 14:16:34,229] [MainThread] [INFO] Running with data path /var/openflexure
[2020-03-26 14:16:36,430] [MainThread] [INFO] Starting LabThings WSGI Server
[2020-03-26 14:16:36,433] [MainThread] [INFO] Debug mode: False
[2020-03-26 14:16:36,434] [MainThread] [INFO] Running on http://localhost:5000 (Press CTRL+C to quit)
[2020-03-26 14:17:07,126] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "OPTIONS /api/v2/actions/camera/preview/stop HTTP/1.1" 200 347 0.015474
[2020-03-26 14:17:07,137] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "OPTIONS /api/v2/actions/camera/preview/stop HTTP/1.1" 200 347 0.005764
[2020-03-26 14:17:07,149] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "OPTIONS /api/v2/actions/camera/preview/stop HTTP/1.1" 200 347 0.005604
[2020-03-26 14:17:07,179] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /routes HTTP/1.1" 200 6974 0.024607
[2020-03-26 14:17:07,210] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /routes HTTP/1.1" 200 6974 0.026259
[2020-03-26 14:17:07,238] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_configuration.json...
[2020-03-26 14:17:07,249] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/configuration/application/version HTTP/1.1" 200 181 0.013757
[2020-03-26 14:17:07,297] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/captures HTTP/1.1" 200 176 0.008884
[2020-03-26 14:17:07,341] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.040245
[2020-03-26 14:17:07,363] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,372] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings HTTP/1.1" 200 12131 0.026069
[2020-03-26 14:17:07,386] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/actions HTTP/1.1" 200 2854 0.009876
[2020-03-26 14:17:07,431] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.041064
[2020-03-26 14:17:07,471] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,478] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings/fov HTTP/1.1" 200 186 0.018041
[2020-03-26 14:17:07,514] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_configuration.json...
[2020-03-26 14:17:07,530] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/configuration HTTP/1.1" 200 403 0.016847
[2020-03-26 14:17:07,549] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/captures HTTP/1.1" 200 176 0.005451
[2020-03-26 14:17:07,563] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/streams/snapshot?1585232226974 HTTP/1.1" 200 235876 0.347285
[2020-03-26 14:17:07,572] [MainThread] [ERROR] Exception on /api/v2/instrument/state/stage/position [GET]
Traceback (most recent call last):
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/var/openflexure/application/python-labthings/labthings/server/view/__init__.py", line 51, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/v2/views/instrument.py", line 95, in get
    value = get_by_path(microscope.state, keys)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/microscope.py", line 135, in state
    state = {"camera": self.camera.state, "stage": self.stage.state}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sanga.py", line 37, in state
    return {"position": self.position_map}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/base.py", line 52, in position_map
    return {"x": self.position[0], "y": self.position[1], "z": self.position[2]}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sanga.py", line 54, in position
    return self.board.position
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 501, in __get__
    value = obj.parsed_query(self.get_cmd, self.response_string)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 290, in parsed_query
    reply = self.query(query_string, **kwargs)  # do the query
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py", line 235, in query
    return ExtensibleSerialInstrument.query(self, message, *args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 217, in query
    timeout
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 150, in readline
    self._ser.readline()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
[2020-03-26 14:17:07,604] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/state/stage/position HTTP/1.1" 500 374 0.120564
[2020-03-26 14:17:07,659] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.047356
[2020-03-26 14:17:07,706] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.042536
[2020-03-26 14:17:07,749] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.038897
[2020-03-26 14:17:07,793] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.040202
[2020-03-26 14:17:07,836] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.039038
[2020-03-26 14:17:07,879] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/extensions HTTP/1.1" 200 5832 0.038849
[2020-03-26 14:17:07,898] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,907] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings HTTP/1.1" 200 12131 0.022979
[2020-03-26 14:17:07,931] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,938] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings/fov HTTP/1.1" 200 186 0.020196
[2020-03-26 14:17:07,959] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,968] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings HTTP/1.1" 200 12131 0.025932
[2020-03-26 14:17:07,985] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:07,996] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:07] "GET /api/v2/instrument/settings HTTP/1.1" 200 12131 0.023433
[2020-03-26 14:17:08,005] [MainThread] [ERROR] Exception on /api/v2/actions/camera/preview/stop [POST]
Traceback (most recent call last):
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/serial/serialposix.py", line 501, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/var/openflexure/application/python-labthings/labthings/server/view/__init__.py", line 51, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/api/v2/views/actions/camera.py", line 179, in post
    return jsonify(microscope.state)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/microscope.py", line 135, in state
    state = {"camera": self.camera.state, "stage": self.stage.state}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sanga.py", line 37, in state
    return {"position": self.position_map}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/base.py", line 52, in position_map
    return {"x": self.position[0], "y": self.position[1], "z": self.position[2]}
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sanga.py", line 54, in position
    return self.board.position
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 501, in __get__
    value = obj.parsed_query(self.get_cmd, self.response_string)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 290, in parsed_query
    reply = self.query(query_string, **kwargs)  # do the query
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py", line 235, in query
    return ExtensibleSerialInstrument.query(self, message, *args, **kwargs)
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 217, in query
    timeout
  File "/var/openflexure/application/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 150, in readline
    self._ser.readline()
  File "/var/openflexure/application/openflexure-microscope-server/.venv/lib/python3.7/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
[2020-03-26 14:17:08,017] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "POST /api/v2/actions/camera/preview/stop HTTP/1.1" 500 374 0.756017
[2020-03-26 14:17:08,065] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:08,073] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "GET /api/v2/instrument/settings/fov HTTP/1.1" 200 186 0.034636
[2020-03-26 14:17:08,084] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "POST /api/v2/actions/camera/preview/stop HTTP/1.1" 200 234 0.592535
[2020-03-26 14:17:08,109] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "GET /api/v2 HTTP/1.1" 200 9220 0.019006
[2020-03-26 14:17:08,129] [MainThread] [INFO] Loading /var/openflexure/settings/microscope_settings.json...
[2020-03-26 14:17:08,137] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "GET /api/v2/instrument/settings/fov HTTP/1.1" 200 186 0.022718
[2020-03-26 14:17:08,162] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:08] "POST /api/v2/actions/camera/preview/stop HTTP/1.1" 200 240 0.725709
[2020-03-26 14:17:28,472] [MainThread] [INFO] 169.254.57.217 - - [2020-03-26 14:17:28] "GET /api/v2/streams/snapshot?1585232241975 HTTP/1.1" 200 235233 5.027077