Elgato Stream Deck plugin - early test release

Posted on
Sun May 10, 2020 3:03 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Elgato Stream Deck plugin - early test release

I think it's actually fairly useful, even at this early stage, but there's a lot of functionality yet to be implemented. Get it here:

https://github.com/FlyingDiver/indigo-s ... /tag/0.0.1

There's no packaged plugin, you'll need to unzip the entire folder. In it you'll see a normal .indigoPlugin wrapper, as well as a folder named com.flyingdiver.indigo.sdPlugin. That's the plugin for the Stream Deck controller software.

First, install the Indigo plugin as normal. In the plugin config dialog, you'll need to assign a port number for the Stream Deck plugin to communicate with the Indigo plugin on. I used "9001" in my testing. Use whatever works for you. You'll need that number and the IP address of the Indigo server later on. If you have debug logging on, you should see something like:
Code: Select all
   StreamDeck                      Starting StreamDeck
   StreamDeck Debug                Started Websocket Server on port 9001

Now you can install the Stream Deck plugin. Eventually I'll convert that to a double-clickable wrapper, but until then just copy the entire folder to:
Code: Select all
 ~/Library/Application Support/com.elgato.StreamDeck/Plugins

And restart the Stream Deck controller application.

If all went well, you should now see an "Indigo Action" button in the Custom group in the configuration window. Drag that to a button slot. You should see this in the property inspector:
Screen Shot 2020-05-10 at 4.52.45 PM.png
Screen Shot 2020-05-10 at 4.52.45 PM.png (66.67 KiB) Viewed 417 times


Put in a Title. You'll need to to be able to identify the button from the Indigo plugin. You can change the Text properties to hide it if necessary.

On the second line, put in the Indigo server IP address and port number for the Indigo plugin. If you're running Stream Deck on the same machine as Indigo, just use the loopback address as above.

The third line is actually a popup. Select one of the following:

  • Momentary Indigo Device
  • Toggle Indigo Device
  • Indigo Variable
  • Action Group
And then in the last field, put the Device ID, Variable ID, or action Group ID as appropriate. For the two device selections, the device needs to be a "relay" type device. One that has On/Off controls in the Indigo UI. This field says "Optional", but it's not for the currently defined actions. I'll probably change that.

For Momentary Indigo Device, the device will be turned ON while the button is held down, then turned OFF when it's released.
For Toggle Indigo Device, the device On/Off state will be toggled on each button down.
For Indigo Variable, the variable will be set to "keyDown" when the button is down, and "keyUp" when the button is released.
For Action Group, the Action Group will be executed on the button press.

Creating appropriate triggers to accomplished more complicated tasks is left as an exercise for the reader. :lol:

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 6:40 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

Initial install/startup
Code: Select all
May 10, 2020 at 7:26:06 PM
   Installing and enabling plugin StreamDeck v0.0.1
   Loading plugin "StreamDeck 0.0.1"
   Starting plugin "StreamDeck 0.0.1" (pid 7952)
   Started plugin "StreamDeck 0.0.1"
   StreamDeck                      Starting StreamDeck
   StreamDeck Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 114, in runConcurrentThread
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 274, in handle_request
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 150, in _eintr_retry
error: (9, 'Bad file descriptor')

   StreamDeck Error                plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


Reload and restart:
Code: Select all
May 10, 2020 at 7:35:22 PM
   Reloading plugin "StreamDeck 0.0.1"
   Stopping plugin "StreamDeck 0.0.1" (pid 7952)
   StreamDeck                      Stopping StreamDeck
   Stopped plugin "StreamDeck 0.0.1"
   Starting plugin "StreamDeck 0.0.1" (pid 8022)
   Started plugin "StreamDeck 0.0.1"
   StreamDeck                      Starting StreamDeck


Now testing didn't work, but I suspect that's because my server is password protected (and I don't want to disable it at this point - I have plans for a better security model, but that's going to be a while).

EDIT: Actually that doesn't matter does it? The StreamDeck is communicating with the Indigo plugin on it's own port, so the Indigo server password is irrelevant. Hmmm.
Last edited by Hap on Sun May 10, 2020 6:41 pm, edited 1 time in total.

Posted on
Sun May 10, 2020 6:41 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Show me what you put in the device config dialog.

Can you turn on debug logging?

I suspect that I'm missing something on initial configuration, which doesn't show up on mine because it's been configured for a long time.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 6:46 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

Indigo/Streamdeck config windows. Copied Action Group ID from Indigo
Attachments
SD-Indigo.png
SD-Indigo.png (71.71 KiB) Viewed 371 times
indigo-sd1.png
indigo-sd1.png (55.67 KiB) Viewed 371 times

Posted on
Sun May 10, 2020 6:48 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Hmm. So far all my testing was on my iMac, my development machine. It SHOULD work to a remote machine, but I forgot to test that. I'll do that right away.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 6:53 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

ahhhhh

Code: Select all
error   19:52:41.824548-0500   Stream Deck   WebSocket connection to 'ws://10.0.1.200:11465/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Posted on
Sun May 10, 2020 6:55 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Hap wrote:
ahhhhh

Code: Select all
error   19:52:41.824548-0500   Stream Deck   WebSocket connection to 'ws://10.0.1.200:11465/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED


That's coming from the Stream Deck? I need to see the Indigo side log, in debug setting.

You need to get the Indigo plugin running, then shut down Stream Deck, install the plugin, then restart Stream Deck.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 6:58 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Also, do you have the Firewall enabled on the Indigo server? If so, you're going to need to allow connections to the port you picked.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 6:59 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

Yeah, that is the Stream Deck side.

Nothing is showing up in the Indigo Log when I push the button. Only in the sending Mac's system.log about connection refused.

See below with detailed debugging enabled.

Code: Select all
May 10, 2020 at 7:57:33 PM
   Reloading plugin "StreamDeck 0.0.1"
   Stopping plugin "StreamDeck 0.0.1" (pid 8022)
   StreamDeck                      Stopping StreamDeck
   Stopped plugin "StreamDeck 0.0.1"
   Starting plugin "StreamDeck 0.0.1" (pid 8182)
   Started plugin "StreamDeck 0.0.1"
   StreamDeck                      Starting StreamDeck
   StreamDeck Debug                Started Websocket Server on port 11465


Firewall is off

Posted on
Sun May 10, 2020 7:01 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Any other network protection in place? Little Snitch? Something on your router?

Just in case, try port 9001, which is what I actually used for testing. That other number was from a really old build.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 7:02 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

Hmmm, Port Scan is not showing that port open

Code: Select all
88,445,1176,3283,5900,8176,49250,49255

Posted on
Sun May 10, 2020 7:04 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

Here's an HTML/Javascript file I used for my initial testing. Save this to a file, then open it with a web browser. Edit the address and hit connect. See if anything shows up in the Indigo log.

Code: Select all
<!DOCTYPE html>

<meta charset="utf-8" />

<title>WebSocket Test</title>

<script language="javascript" type="text/javascript">


  function init()
  {
   document.myform.url.value = "ws://127.0.0.1:9001/"
   document.myform.inputtext.value = "Hello World!"
   document.myform.disconnectButton.disabled = true;
  }

  function doConnect()
  {
    websocket = new WebSocket(document.myform.url.value);
    websocket.onopen = function(evt) { onOpen(evt) };
    websocket.onclose = function(evt) { onClose(evt) };
    websocket.onmessage = function(evt) { onMessage(evt) };
    websocket.onerror = function(evt) { onError(evt) };
  }

  function onOpen(evt)
  {
    writeToScreen("connected\n");
   document.myform.connectButton.disabled = true;
   document.myform.disconnectButton.disabled = false;
  }

  function onClose(evt)
  {
    writeToScreen("disconnected\n");
   document.myform.connectButton.disabled = false;
   document.myform.disconnectButton.disabled = true;
  }

  function onMessage(evt)
  {
    writeToScreen("response: " + evt.data + '\n');
  }

  function onError(evt)
  {
    writeToScreen('error: ' + evt.data + '\n');

   websocket.close();

   document.myform.connectButton.disabled = false;
   document.myform.disconnectButton.disabled = true;

  }

  function doSend(message)
  {
    writeToScreen("sent: " + message + '\n');
    websocket.send(message);
  }

  function writeToScreen(message)
  {
    document.myform.outputtext.value += message
   document.myform.outputtext.scrollTop = document.myform.outputtext.scrollHeight;

  }

  window.addEventListener("load", init, false);


   function sendText() {
      doSend( document.myform.inputtext.value );
   }

  function clearText() {
      document.myform.outputtext.value = "";
   }

   function doDisconnect() {
      websocket.close();
   }


</script>

<div id="output"></div>

<form name="myform">
<p>
<textarea name="outputtext" rows="20" cols="50"></textarea>
</p>
<p>
<textarea name="inputtext" cols="50"></textarea>
</p>
<p>
<textarea name="url" cols="50"></textarea>
</p>
<p>
<input type="button" name=sendButton value="Send" onClick="sendText();">
<input type="button" name=clearButton value="Clear" onClick="clearText();">
<input type="button" name=disconnectButton value="Disconnect" onClick="doDisconnect();">
<input type="button" name=connectButton value="Connect" onClick="doConnect();">
</p>


</form>
</html>


joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun May 10, 2020 7:07 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

Oddly enough, I had to kill Stream Deck to get the updated port to show up in request. Still no go with that.

Code: Select all
error   20:05:04.214798-0500   Stream Deck   WebSocket connection to 'ws://10.0.1.200:9001/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED


Although the Firewall is OFF, I thought I read something about parts of it running regardless. I may have to dip to the CLI.

Posted on
Sun May 10, 2020 7:10 pm
Hap offline
User avatar
Posts: 34
Joined: Jul 28, 2013
Location: Huntsville, AL

Re: Elgato Stream Deck plugin - early test release

This shows up in the web browser

Code: Select all
error: undefined
disconnected


Nothing shows up in the Indigo Log, sending Mac console gives me a another connection refused error.

EDIT: I suspect a problem with the Mac rather than your code.

Some additional notes: I'm remoted into the Indigo Server via Apple Remote Desktop while testing, so not a network issue. Traffic doesn't flow through my router, only through two Ubiquiti switches and there are no blocks configured there.

Posted on
Sun May 10, 2020 7:27 pm
FlyingDiver offline
User avatar
Posts: 4134
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Elgato Stream Deck plugin - early test release

I'll reconfirm a new setup on a different computer tomorrow.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Who is online

Users browsing this forum: No registered users and 0 guests