×

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

Bi-monthly release with minor bug fixes and improvements

using dome scripting gateway

  • Posts: 5
  • Thank you received: 0
Hi!

I'm currently trying to use indi_script_dome to control the opening roof of my observatory box, but there is not much information on how to properly use it.
there is a problem with the status.py script call from the driver: i think it's called without the required argument (tmp file name to output status).

I don't understand this C++ code, probably the source of my problem (from libindi/drivers/dome/dome_script.cpp):
        while (arg < MAXARGS)
        {
            char *pp = strstr(p, " ");
 
            if (pp == nullptr)
                break;
            *pp++       = 0;
            args[arg++] = pp;
            p           = pp;
        }
        va_list ap;
        va_start(ap, script);
        while (arg < MAXARGS)
        {
            char *pp    = va_arg(ap, char *);
            args[arg++] = pp;
            if (pp == nullptr)
                break;
        }

Maybe there is a bug in it... don't know if it actually works since i don't have found any information on how to control a roof (in this forum and elsewhere)

Any ideas ?
6 years 2 weeks ago #24016

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

I'm not sure about dome script but it's been used successfully before IIRC. Why don't you write a regular INDI driver for your box? How is it controlled?
6 years 2 weeks ago #24017

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

  • Posts: 5
  • Thank you received: 0
it's controlled by a python script talking to an arduino by serial link. this script use named pipes to communicate with GUI and dome_script.
source code is available at github.com/christophecasson/ttfobservatory/tree/master/app

scripts to open/close the roof works when called manually, but status.py never gets any argument when called by indi_script_dome.
I have tested to put just the RunScript(int script, ...) code in a standalone c++ app to test it, (github.com/christophecasson/ttfobservatory/tree/master/tests) but it doesn't work (and i don't understand the code who handle args in RunScript() ).

If possible, i prefer using scripts rather than writing custom driver 'cause i want to keep things simple (and i'm not a good c++ programmer ;)
6 years 2 weeks ago #24021

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

  • Posts: 712
  • Thank you received: 174
Hi, I tested it and it seems to work. status.py is really called with single parameter (temporary file name). Maybe some permission issue? Peter
6 years 2 weeks ago #24030

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

  • Posts: 5
  • Thank you received: 0
You have tested it on what distribution/version? i have tested to reinstall indi from source rather than from ppa, and i tried on a fresh install (vmware)... same problem, script called without parameters...
6 years 2 weeks ago #24055
Attachments:

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

  • Posts: 712
  • Thank you received: 174
No, I don't use linux, I tried it on macOS with slightly modified status.py from dome_script.txt (I saved path to the file to make sure it was set). The parameter can be missing if tmpnam(nullptr) returns NULL (if temporary file can't be generated). That's why I'm asking for permission issues. Peter
6 years 2 weeks ago #24057

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

  • Posts: 5
  • Thank you received: 0
same issue with indiserver launched with sudo...
tmpnam return a valid file name, which is not passed to execvp(path, args);
6 years 2 weeks ago #24059

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

  • Posts: 712
  • Thank you received: 174
I noticed in your screenshot, that this error appears AFTER the driver was successfully disconnected. I compared the most recent source with the one I use and found

setDefaultPollingPeriod(2000);

in bool DomeScript::initProperties(). I don't know what is it, but I suspect it somehow calls DomeScript::TimerHit() even if driver is disconnected. Jasem, you added it. Any idea why?

Peter
6 years 2 weeks ago #24071

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

  • Posts: 712
  • Thank you received: 174
I updated to the recent source, fixed some bugs and also added better logging to scripting gateways (turn driver debugging on to see it). Pls. wait for pull request #538 and try it again with your scripts... Peter
The following user(s) said Thank You: Jasem Mutlaq
6 years 2 weeks ago #24075
Attachments:

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

  • Posts: 5
  • Thank you received: 0
It seems to work, thank you.
I need to test it more with real hardware because i have reinstalled the control PC and it's currently not in the observatory, but there is no more "failed to read status" errors :)

thank you again for the fast response and fix!
6 years 2 weeks ago #24153

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

Time to create page: 0.706 seconds