Getting the Material Deck plugin working on OpenDeck
I'm the developer of Material Deck, which is a Foundry VTT integration for the Stream Deck. I recently released v2 which was written using the new SD SDK. This new plugin does not work on OpenDeck, unfortunately.
So far, I've only been able to do very limited debugging, because I get stuck very early in the process. What I've found so far:
* Global settings are not accessible using
await streamDeck.settings.getGlobalSettings()
, it simply halts operation without any errors (implementation). This is easily bypassed for debugging purposes, after which a websocket connection between Foundry and the plugin is established.
* I'm not able to send data to the PI. Data is sent using streamDeck.ui.current.sendToPropertyInspector(payload)
, but nothing is received in the PI when subscribing to onSendToPropertyInspector
(implementation).
* The PI is unable to get settings using await SDPIComponents.streamDeckClient.getSettings()
, it halts operation without errors (implementation).
I'm not sure how to best proceed.36 Replies
Hey @Cris
I presume you mean the Node.js SDK?
afaik it's just a wrapper for the normal WebSocket SDK so idk why it wouldn't be working
@Percy_Ikana used to use the MD plugin until it became paid without any problems iirc so their insights might be valuable as well
I presume keydown is received and showok being sent works?
as part of i was the one that made cris start this linux support i'm willing to be of any help i can in testing where i can just let me know if naything comes up
i should still have my modified version of the v1 plugin around which i modified to work with opendeck because there were a handful of issues with that
but i doubt thats of any use now, iirc most of the issues were due to case sensitivity of paths
Yhea these were the only issues I had.
I presume you mean the Node.js SDK?Yes I've gotten a bit further, but I'm not really sure how. I was gone for a bit, and after booting up the PC none of the previous issues appeared. The PI was populated with settings and pressing buttons worked as it should. However, after a while it stopped working (I restarted OpenDeck a few times to apply some code changes), and all that could fix it was a full reboot. I'm not sure what's causing this. When it does "work", it does not load any images, because it violates the Content Security Policy directive, see the attachment.

OK, I can fix the CSP issue for 2.5.1, that was probably introduced in ae15dcad8a73a6bbe90bd63b0ea2c0dc457f39a5
building from source and just adding data: to the img-src portion of the CSP string in tauri.conf.json should fix it
That worked, images are working fine now, thanks!
No text is being displayed, though. The plugin receives the ws message, but somewhere between that and the actual setTitle event something is probably going wrong (there's some code to properly format the text).
However, debugging is practically impossible, because the plugin stops functioning whenever I restart OpenDeck or reload the plugin using
--reload-plugin
. It loads like normal, opens the ws connection to the Foundry client, receives a single initialization ws message and then stops doing anything. The only thing that appears to fix it is to do a full reboot.receives an initialisation message from what? foundry or OpenDeck?
are you on Linux or Windows? do other plugins work after being restarted? does a killall of OpenDeck, plugin and foundry fix it?
Should've explained that a bit more, sorry: Whenever a websocket connection is established between Foundry and the plugin, both send an initialization message. I basically just meant to say that the websocket connection is established, but after that nothing happens. I haven't ran through the entire initialization procedure to check that everything is going as it should, because I got a bit frustrated after having to reboot 10 times and didn't want to continue :p.
I'm on Windows, I can try on Linux if you think that helps.
I haven't checked other plugins. Restarting Foundry doesn't help. I haven't tried killall, but I have tried killing it through Task Manager without success. I'll try another plugin and killall tomorrow.
OK, I see. That seems completely independent of OpenDeck then, which makes it quite strange that it should work under ESD but not OD.
Have you been quitting OpenDeck from the tray icon before killing it with Task Manager? Quitting it properly from the tray might help
The killall suggestion was for Linux, I'm not sure if such a thing exists on Windows
@Cris if you need testing help just let me know 😄
I've got everything mostly running now. I've noticed the following issues, though:
1. When a new action is dragged onto a button,
onWillAppear
is not called
2. The SD app calls onTitleParametersDidChange
when a button appears, this is not the case for OpenDeck, although that might be because of issue 1. I need this to be called so the plugin can correctly format the text based on the font and font size
3. The plugin creates a websocket server that Foundry connects to, when OpenDeck is closed it does not close this connection, resulting in the port being in use even when OpenDeck is closed. The SD app does automatically close the server and free the port
@simolsen see the attacked plugin, if you want to give it a try. Don't forget that you'll need to build this version of OpenDeck for it to work.So, the willAppear event is sent by OpenDeck, (and certainly so as few plugins would work without it). Not sure why it isn't working with the Node.js SDK
Additionally the titleParametersDidChange event is also theoretically sent, but I have never tested this (unlike willAppear which is sent for certain).
Not sure how OpenDeck would be able to close a server running in the plugin directly. OpenDeck does try to kill all child processes on exit but there may be issues with that on Windows iirc; have a go on Linux
well i never build anything before on linux from a Open source still new to linux but that don't mean i don't wanna help
Maybe it not killing all processes properly is the reason I've been having the issues requiring a reboot.
but killing them from task manager should be remedying that
idk, I don't test Windows at all
this is Linux software first and foremost, windows will be tested if I ever get around to launching my Stream Deck Mobile alternative that uses OpenDeck
Now is as good a time as any to learn to do that :D.
See here on how to build OpenDeck, you'll only need to do the stuff in the 1st paragraph, the rest is for when you want to contribute your own code.
GitHub
GitHub - nekename/OpenDeck: Linux software for your Elgato Stream Deck
Linux software for your Elgato Stream Deck. Contribute to nekename/OpenDeck development by creating an account on GitHub.
Maybe one of the child processes are their own process in the task manager, so killing OpenDeck does not kill those processes.
If I restart OpenDeck, it connects as it should, only when I attempt to open the SD app (after closing OpenDeck) I get the "port in use" error. It seems to me that a child process keeps the port open, and OpenDeck re-uses that process.
This might only be the case when running it from the source using
deno task tauri dev
, an actual build might not have this issue, but when I tried building it I got an error (I did not put a lot of effort into figuring out why, so that might just be a user error).yeah, that's why I said you should also terminate the plugin process ^
OpenDeck definitely does not 'reuse' processes, a new one is spawned for every plugin on every launch, same as SD. Are you sure that's the behaviour?
@Cris tomorrow i got game and i got the build working so i plan to do some testing while playing anything to look out for it gonna be pf2e game as player (we haveing a oneshot)
just tested if it was able to connect before headding to bed and it was not so far
and use this build https://github.com/nekename/OpenDeck/commit/12dbce745fb750c4415a563fdea617ddf3f91f83
and the plugin for it you tagged me in
but mine don't connect to foundry
@Cris someone has contributed a fix for the plugins not being killed properly on Windows, it will make it into 2.5.1 or you can build from source
Great! I'll take a look at it when I have the time.
Sorry for the late response, could you do the following to get the logs so I can take a look at them:
1. In the MD module settings (in Foundry), make sure 'Stream Deck Port' is set to 3005
2. This might only be applicable to Windows, but just to be sure: Make sure the 'normal' OpenDeck v2.5.0 has not ran since your last reboot. If it has, reboot and make sure it doesn't start automatically.
3. Start the 'fixed' OpenDeck build, make sure there is exactly 1 Material Deck action (adding more actions will make the logs larger, which makes it harder to find any issues)
4. Start or refresh Foundry
5. Open the Foundry console (press F12 to open the dev tools, make sure you're in the 'Console' tab)
6. At the bottom of the console you can enter commands, enter the following:
game.materialDeck.downloadLogs()
. This should download the MD logs.
7. In OpenDeck, go to 'Settings', then 'Open config directory', which should open the file browser. Relative from there navigate to plugins/com.material-foundry.material-deck.sdPlugin/logs
, where you'll find the logs of the plugin.
8. Please upload com.material-foundry.material-deck.0.log
(from the logs folder) and the downloaded Material Deck log.Sure I gonna look at that next time I got the time think I can Monday maybe before
@Cris @nekename i got my self connected but sync don't work well specially then moving them around as it keep resetting them and it all wired
@Cris and did't get this to work at all everything is tested on pf2e as this my main system atm so my testing will mainly be on pf2e

@Cris OpenDeck v2.6.0 works a lot better on Windows now, as plugins are properly terminated and socket inheritance is prevented. Maybe give this another go now?
Sorry for the late response.
v2.6.0 does improve things significantly. As far as I can tell in the short time I've tested it, the only issue is with displaying text, besides that, no OpenDeck-specific changes appear to be necessary.
The problem with displaying text is that the Material Deck plugin uses the button's titleParameters to format the title (things like automatic line breaks). The SD app calls
onTitleParametersDidChange
when an action appears, which is where the plugin gets the parameters from. OpenDeck only calls this when the parameters are actually changed. This means that the titleParameters are undefined until the user changes the parameters, and if they're undefined the text will not be displayed.
I don't know if there's a better way to retrieve these parameters. They must be stored somewhere, but the SD SDK isn't exactly detailed when it comes to things like this.For anyone who wants to give it a go, here's a version that does display text by ignoring the missing titleParameters. This means that the text might not be displayed ideally.
oh I see!
should that event be sent alongside every time that willAppear is sent then?
Yeah, I believe it's sent right after every willAppear
Great! I should have some time this week to look at it.
I wanted to give this a try, but I can't get it to work. When trying to run
deno task tauri dev
I get an error (see the screenshot).
I was able to get this version to run, so I'm not sure if something changed in the meantime, or if I'm missing a step. I have basically no experience with Deno or Tauri, so it's difficult for me to tell what the problem is.
v2.6.1 has been released properly so maybe you don't have to build from source now