Welcome, Guest
Username: Password: Remember me
08 Apr 2018
INDI development team is happy to announce the release of INDI Library v1.7.0. This new exciting release builds on the maturity of INDI Library and comes with many new supported devices and fixes for existing drivers.
Read More...
  • Page:
  • 1

TOPIC: using dome scripting gateway

using dome scripting gateway 3 months 1 week ago #24016

  • ttf
  • ttf's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 ?

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

using dome scripting gateway 3 months 1 week ago #24017

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?

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

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info

using dome scripting gateway 3 months 1 week ago #24021

  • ttf
  • ttf's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 ;)

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

using dome scripting gateway 3 months 1 week ago #24030

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

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

using dome scripting gateway 3 months 1 week ago #24055

  • ttf
  • ttf's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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...
Attachments:

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

using dome scripting gateway 3 months 1 week ago #24057

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

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

using dome scripting gateway 3 months 1 week ago #24059

  • ttf
  • ttf's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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);

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

using dome scripting gateway 3 months 1 week ago #24071

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

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

using dome scripting gateway 3 months 1 week ago #24075

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
Attachments:
The following user(s) said Thank You: knro

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

using dome scripting gateway 3 months 1 week ago #24153

  • ttf
  • ttf's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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!

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

  • Page:
  • 1
Time to create page: 0.253 seconds

Login

3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!


Gallery

Replica

Why INDI

Replica