blumzi / LAST_next_generation

Design and implementation of a new LAST architecture
GNU General Public License v3.0
0 stars 0 forks source link

devices detected, but probing thread receives `false` #10

Closed EastEriq closed 7 months ago

EastEriq commented 7 months ago

E.g.

2024-03-14 10:56:15,444 - INFO     - {lipp-unit-focuser-2:receive_from_driver:503067:focuser-2-wait-for-ready-thread:139911512454912} -  got 'b'{"RequestId":0,"Value":"detected"}'' from 'b'\x00lipp-driver-focuser-2'
2024-03-14 10:56:15,445 - INFO     - {lipp-unit-focuser-2:wait_for_ready:503067:focuser-2-wait-for-ready-thread:139911512454912} -  detected
10:56:15.446 [INF] [focuser-2] [pid=503219] lipp-driver-focuser-2: Driver 'lipp-driver-focuser-2' is 'detected'

and later on, repeatedly

2024-03-14 10:56:20,499 - INFO     - {lipp-unit-focuser-2:receive_probing:503067:focuser-2-monitor-device-probing-thread:139911495669504} -  got 'b'{"AnswersToProbe":false}'' from 'None

same for focuser-1, camera-1 and -2, mount. Probe functions exist for all and are decorated 'api,must-be-connected,'.

There is also a minor glitch in the message from 'None without a closing quote, but that is only decoration.

EastEriq commented 7 months ago

I smell a message mixup in the replies. At some point I have successfully asked for focuser.Pos using the webby, and since then I get periodically in stdout

2024-03-14 14:50:41,708 - INFO     - {lipp-unit-focuser-1:receive_probing:911728:focuser-1-monitor-device-probing-thread:140390267090688} -  got 'b'{"AnswersToProbe":false,"RequestId":2,"Value":38461}'' from 'None
blumzi commented 7 months ago

I smell a bug in forward declaration of functions:

diff --git a/+inst/@CelestronFocuser/CelestronFocuser.m b/+inst/@CelestronFocuser/CelestronFocuser.m
index 3fc5cfe..280edf3 100644
--- a/+inst/@CelestronFocuser/CelestronFocuser.m
+++ b/+inst/@CelestronFocuser/CelestronFocuser.m
@@ -182,7 +182,7 @@ classdef CelestronFocuser < obs.focuser

     methods(Description='api,must-be-connected')
         abort(F)
-        probe(F)
+        out = probe(F)
     end

     methods (Description='api, type_param1=string, type_param2=double, type_param3=logical, type_param4=integer, type_out=string')

I changed +inst/@CelestronFocuser/CelestronFocuser.m on last11e, but not commited.

EastEriq commented 7 months ago

Right, I overlooked that the prototype of probe MUST declare that one return argument is expected. Correcting it in the three drivers in question and pushing.

However, I still see the mixup of messages which worries me. I have asked once focuser1.Limits with the uvicorn webby, and since then I periodically get

2024-03-17 16:48:21,496 - INFO     - {lipp-unit-focuser-1:receive_probing:4112376:focuser-1-monitor-device-probing-thread:140643829524224} -  got 'b'{"AnswersToProbe":true,"RequestId":1,"Value":[2091,39724]}'' from 'None'

I reopen the issue.

EastEriq commented 7 months ago

After trying test_exception I get

2024-03-17 16:53:48,461 - INFO     - {lipp-unit-focuser-1:receive_probing:4112376:focuser-1-monitor-device-probing-thread:140643829524224} -  got 'b'{"AnswersToProbe":true,"RequestId":3,"Value":[2091,39724],"Exception":{"identifier":"MATLAB:m_improper_grouping","message":"Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.","cause":[],"stack":{"file":"/home/ocs/matlab/LAST/LAST_Api/+obs/+api/Lipp.m","name":"Lipp.loop","line":384},"Correction":[]}}'' from 'None'

After asking subsequently .Pos I get

2024-03-17 16:56:06,667 - INFO     - {lipp-unit-focuser-1:receive_probing:4112376:focuser-1-monitor-device-probing-thread:140643829524224} -  got 'b'{"AnswersToProbe":true,"RequestId":5,"Value":38461,"Exception":{"identifier":"MATLAB:m_improper_grouping","message":"Error: Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.","cause":[],"stack":{"file":"/home/ocs/matlab/LAST/LAST_Api/+obs/+api/Lipp.m","name":"Lipp.loop","line":384},"Correction":[]}}'' from 'None'

i.e. the answer of Limits is replaced by that of Pos, the exception is preserved, and all this is appended to the true of the probe. Is this intended?

blumzi commented 7 months ago

This issue is a meddle of some individual issues. To my understanding they were fixed.

I'm closing it and let's open the ones (if still any) that still occur