nspyre-org / nspyre

(n)etworked (s)cientific (p)ython (r)esearch (e)nvironment
BSD 3-Clause "New" or "Revised" License
23 stars 11 forks source link

Instrument Manager and Spyrelet Conflict(?) #35

Closed aidanj5 closed 3 years ago

aidanj5 commented 3 years ago

When we run our experiment with the instrument manager open, the experiment will run briefly, and very soon stop suddenly while closing the instrument manager. The error says that it stops when it tries to set the frequency on our signal generator.

To Reproduce Connect to the instrument servers with your instruments. Open the instrument manager, and then open your spyrelet. Run your ODMR. Upon setting the frequency to ~ 2.8333 Ghz, which is our third step, we see the following error.

[stderr] Traceback (most recent call last):
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\nspyre\spyrelet\spyrelet.py", line 160, in run
[stderr]     self.main(*args, **kwargs)
[stderr]   File "C:\NSpyre\nspyre_files\spyrelets\spinmeasurements_swabian.py", line 448, in main
[stderr]     self.sg.frequency = f
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\netref.py", line 165, in __setattr__
[stderr]     syncreq(self, consts.HANDLE_SETATTR, name, value)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\netref.py", line 63, in syncreq
[stderr]     return conn.sync_request(handler, proxy, *args)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 473, in sync_request
[stderr]     return self.async_request(handler, *args, timeout=timeout).value
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\async_.py", line 102, in value
[stderr]     raise self._obj
[stderr] _get_exception_class.<locals>.Derived: stream has been closed
[stderr]
[stderr] ========= Remote Traceback (1) =========
[stderr] Traceback (most recent call last):
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 324, in _dispatch_request
[stderr]     res = self._HANDLERS[handler](self, *args)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 614, in _handle_setattr
[stderr]     return self._access_attr(obj, name, (value,), "_rpyc_setattr", "allow_setattr", setattr)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 536, in _access_attr
[stderr]     return accessor(obj, name, *args)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\pimpmyclass\props.py", line 93, in __set__
[stderr]     self.set_notify(instance, value)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\pimpmyclass\props.py", line 474, in set_notify
[stderr]     self.store(instance, value)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\pimpmyclass\props.py", line 540, in store
[stderr]     getattr(instance, self.name + '_changed').emit(value, old_value)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\PySignal.py", line 119, in emit
[stderr]     slot(*args, **kwargs)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\netref.py", line 240, in __call__
[stderr]     return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\netref.py", line 63, in syncreq
[stderr]     return conn.sync_request(handler, proxy, *args)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 473, in sync_request
[stderr]     return self.async_request(handler, *args, timeout=timeout).value
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\async_.py", line 100, in value
[stderr]     self.wait()
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\async_.py", line 47, in wait
[stderr]     self._conn.serve(self._ttl)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\protocol.py", line 386, in serve
[stderr]     data = self._channel.poll(timeout) and self._channel.recv()
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\channel.py", line 47, in poll
[stderr]     return self.stream.poll(timeout)
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\stream.py", line 44, in poll
[stderr]     p.register(self.fileno(), "r")
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\stream.py", line 235, in fileno
[stderr]     return self.sock.fileno()
[stderr]   File "C:\NSpyre\miniconda3\envs\nspyre\lib\site-packages\rpyc\core\stream.py", line 105, in fileno
[stderr]     raise EOFError("stream has been closed")
[stderr] EOFError: stream has been closed
[stderr]

It should not produce this error.

I'm running this on Windows 10, installed from conda-forge, version .4.5 (I believe, it has the updated instrument manager with working arrows that set the value).

If it matters, we recently configured our system such that we are switching between computers. We switch over some USB connections of our other instruments, but the signal generator connects via ethernet.

jacobfeder commented 3 years ago

@aidanj5 can you explain this switching in more detail? Also, if you run conda list inside your environment, it should show you the version number. Please confirm that it is indeed 0.4.5.

@mtsolmn this looks like a pysignal related issue

aidanj5 commented 3 years ago

Did not know about conda list. NSpyre is version 0.4.5.

aidanj5 commented 3 years ago

Closing this issue because it is tied to #37 .