client connection fails with status code 500
first connection attempt after successful developer install fails with [Errno 25]: inappropriate ioctl for device
Sangaboard is not connected. keyboard and mouse connected to USB.
[Thread-1] [INFO] Waiting for frames
Trying port /dev/ttyAMA0
Success!
/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py:116: UserWarning: You may need to update the firmware running on the Sangaboard.
warnings.warn("You may need to update the firmware running on the Sangaboard.")
[2019-06-18 19:26:07,180] [Thread-1] [ERROR] [Errno 25] Inappropriate ioctl for device
[2019-06-18 19:26:07,181] [Thread-1] [WARNING] No valid stage hardware found. Falling back to mock stage!
[2019-06-18 19:26:07,182] [Thread-1] [ERROR] Exception on /api/v1/config [GET]
Traceback (most recent call last):
File "/home/pi/openflexure-microscope-server/openflexure_microscope/api/app.py", line 103, in attach_microscope
api_stage = SangaStage()
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sanga.py", line 25, in __init__
self.board = Sangaboard(port, **kwargs)
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py", line 117, in __init__
raise e
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py", line 72, in __init__
self.firmware = self.query("version",timeout=2).rstrip()
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/sangaboard.py", line 149, in query
return ExtensibleSerialInstrument.query(self, message, *args, **kwargs)
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 160, in query
self.flush_input_buffer()
File "/home/pi/openflexure-microscope-server/openflexure_microscope/stage/sangaboard/extensible_serial_instrument.py", line 120, in flush_input_buffer
if self._ser.inWaiting()>0: self._ser.flushInput()
File "/home/pi/.openflexure/envmicroscope/lib/python3.5/site-packages/serial/serialutil.py", line 590, in inWaiting
return self.in_waiting
File "/home/pi/.openflexure/envmicroscope/lib/python3.5/site-packages/serial/serialposix.py", line 467, in in_waiting
s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
OSError: [Errno 25] Inappropriate ioctl for device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/openflexure-microscope-server/openflexure_microscope/api/app.py", line 107, in attach_microscope
api_stage = MockStage()
TypeError: Can't instantiate abstract class MockStage with abstract methods apply_config, read_config
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/.openflexure/envmicroscope/lib/python3.5/site-packages/flask/app.py", line 2311, in wsgi_app
response = self.full_dispatch_request()
File "/home/pi/.openflexure/envmicroscope/lib/python3.5/site-packages/flask/app.py", line 1827, in full_dispatch_request
self.try_trigger_before_first_request_functions()
File "/home/pi/.openflexure/envmicroscope/lib/python3.5/site-packages/flask/app.py", line 1874, in try_trigger_before_first_request_functions
func()
File "/home/pi/openflexure-microscope-server/openflexure_microscope/api/app.py", line 112, in attach_microscope
api_stage
UnboundLocalError: local variable 'api_stage' referenced before assignment
Edited by Saad Chinoy