×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Driver for Pegasus Indigo Filter Wheel

  • Posts: 45
  • Thank you received: 3
Also, disconnecting from the filter wheel causes the following error to be logged once per second:
INFO	797.484279 sec	: Pegasus INDIGO is offline.
DEBUG	798.083706 sec	: CMD <WF>
ERROR	798.083766 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	799.084953 sec	: CMD <WF>
ERROR	799.085003 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	800.089721 sec	: CMD <WF>
ERROR	800.089783 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	801.092084 sec	: CMD <WF>
ERROR	801.092138 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	802.096038 sec	: CMD <WF>
ERROR	802.096096 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	803.096372 sec	: CMD <WF>
ERROR	803.096412 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	804.100636 sec	: CMD <WF>
ERROR	804.100697 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	805.104368 sec	: CMD <WF>
ERROR	805.104421 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	806.105080 sec	: CMD <WF>
ERROR	806.105132 sec	: Serial write error: Write Error: Bad file descriptor.
DEBUG	807.105236 sec	: CMD <WF>
ERROR	807.105280 sec	: Serial write error: Write Error: Bad file descriptor.

I'll try to get the exact byte codes, as requested.
1 year 3 months ago #88948

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
I'm not entirely sure how to go about attaching a debugger to my build of K-stars. I'm running on OS-X, and I'm not particularly familiar with developer tools. Any chance there's a basic guide that can get me started? Perhaps with GDB?

If it helps any, VI shows the metacharacters being logged in the response:
DEBUG 25.533668 sec : CMD <WM:1>
DEBUG 25.558617 sec : RES <WM:1^M>

The filter wheel seems to be sending windows style \r\n terminated responses.
1 year 3 months ago #88949

Please Log in or Create an account to join the conversation.

Do you have Raspberry PI that you can connect this to? Then I can SSH remotely and check it out.
1 year 3 months ago #88996

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
Hi Jasem,

I was able to get a proper debugging environment setup.

Here's some of the values of res on line 209, from the current head commit (bb0f4b73c375290d8a3e79760812f53c19b68bbd):
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x557a9af2b0, cmd=0x55639a7318 "W#", res=0x7fd6c78ed0 "FW_OK\r\n", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:209
209	        res[nbytes_read - 1] = 0;
(gdb) p res
$2 = 0x7fd6c78ed0 "FW_OK\r\n"
(gdb) c
Continuing.
 
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x557a9af2b0, cmd=0x55639a7328 "FV", res=0x7fd6c79250 ">>\r\n", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:209
209	        res[nbytes_read - 1] = 0;
(gdb) p res
$3 = 0x7fd6c79250 ">>\r\n"
(gdb) c
Continuing.
 
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x557a9af2b0, cmd=0x7fd6c794b0 "WM:1", res=0x7fd6c79430 "WM:1\r\n", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:209
209	        res[nbytes_read - 1] = 0;
(gdb) p res
$4 = 0x7fd6c79430 "WM:1\r\n"
(gdb)

If it helps any, the value at line 210 is:
Breakpoint 2, PegasusINDIGO::sendCommand (this=0x557a9af2b0, cmd=0x7fd6c794b0 "WM:1", res=0x7fd6c79430 "WM:1\r", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:210
210	        LOGF_DEBUG("RES <%s>", res);
(gdb) p res
$5 = 0x7fd6c79430 "WM:1\r"
1 year 3 months ago #89000

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
By the way... I think there's a bug on line 110:

The firmware version command is WV, and not FV. :)
1 year 3 months ago #89001

Please Log in or Create an account to join the conversation.

Ok please git pull and test again.
1 year 3 months ago #89002

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
In progress. I'll let you know when I have results.
1 year 3 months ago #89003

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
The new code seems to be processing reponses correctly.
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x55b18152b0, cmd=0x558bef7318 "W#", res=0x7fcd8c18d0 "FW_OK", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:210
210	        LOGF_DEBUG("RES <%s>", res);
(gdb) p res
$1 = 0x7fcd8c18d0 "FW_OK"
(gdb) c
Continuing.
 
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x55b18152b0, cmd=0x558bef7328 "WV", res=0x7fcd8c1c50 "WV:1.2", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:210
210	        LOGF_DEBUG("RES <%s>", res);
(gdb) p res
$2 = 0x7fcd8c1c50 "WV:1.2"
(gdb) c
Continuing.
 
Breakpoint 1, PegasusINDIGO::sendCommand (this=0x55b18152b0, cmd=0x7fcd8c1eb0 "WM:2", res=0x7fcd8c1e30 "WM:2", cmd_len=-1, res_len=-1)
    at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:210
210	        LOGF_DEBUG("RES <%s>", res);
(gdb) p res
$3 = 0x7fcd8c1e30 "WM:2"
(gdb) c
Continuing.

We could probably trim "WV:" off the front of the version response. I also see a serial port error raised once per second when the filter wheel is disconnected.



I'm trying to enable debug logging, but can't for some reason. Every time I click "Enable" it flicks back to "Disabled"
1 year 3 months ago #89004

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
I suspect the serial write error is related to the WF command I noticed in my original logs. Perhaps this debugging information will be useful?
(gdb) break /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:140
Breakpoint 2 at 0x558bec9db0: file /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp, line 140.
(gdb) c
Continuing.
 
Breakpoint 2, PegasusINDIGO::TimerHit (this=0x55b18152b0) at /home/stellarmate/Projects/indi/drivers/filter_wheel/pegasus_indigo.cpp:140
140	            if (sscanf(response, "WF:%d", &position) == 1)
(gdb) p response
$10 = '\000' <repeats 127 times>
(gdb) p TargetFilter
$11 = 3
(gdb) p position
$12 = -1

I get this result even after the wheel has moved to the correct position.
Last edit: 1 year 3 months ago by Chris Barbour.
1 year 3 months ago #89006

Please Log in or Create an account to join the conversation.

You get the serial write error immediately after setting a new filter target in the driver? I pushed a small update for the firmware parsing.
1 year 3 months ago #89008

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
The serial write error shows up after disconnecting the filter wheel, and disappears when I reconnect it.

I'm not 100% sure what triggers it, but I suspect it's part of the wait loop which checks if the filter is moving.
1 year 3 months ago #89009

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 3
I'm not a C++ guy, but in this block of code I'm not entirely clear how response is updated after sending the WF command:

github.com/indilib/indi/blob/master/driv...indigo.cpp#L132-L149
1 year 3 months ago #89010

Please Log in or Create an account to join the conversation.

Time to create page: 0.863 seconds