Long-lived python script with Indigo access?

Posted on
Fri Sep 15, 2023 4:46 pm
NOVAmike offline
Posts: 2
Joined: Feb 16, 2023

Long-lived python script with Indigo access?

I have a 3rd party device that provides an OS daemon to talk to it. It creates 3 named pipes, 2 are a command/response pair and the 3rd is read-only and reports async events.

I can handle reading and writing ASCII to/from the first two pipes via normal Indigo python scripts. No problem. Those script invocations run to completion and exit.

But I'm having trouble figuring out how to handle the async events. I need to open the event pipe and read from it in a long-lived loop (possibly parsing the events into setting a handful of Indigo variables). I can then automate things using triggers based on those variables changing state. The events could be several per second or one per week and I don't want to miss any.

My concern is the "long-lived loop" will be a problem. In my experience, Indigo doesn't like running scripts that don't terminate after a few seconds.

So how do I create a Python script with Indigo server access that runs indefinitely as a daemon?

Is this just a very simple Indigo plugin? I looked there but it seemed very focused on config and UI elements that don't apply to my case.

Thanks for any guidance!

Posted on
Fri Sep 15, 2023 6:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 17979
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Long-lived python script with Indigo access?

If you run a Python script as an external script (as opposed to an embedded script), it can run forever (in it's own process).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests