Jump to content

Elgato Stream Deck as configurable button box


Recommended Posts

Recently, Elgato released the Stream Deck, which is a device that looks like this:

 

81bRHR82h2L._SX355_.jpg

 

It consists of an array of 5x3 buttons (15 buttons total), where each button has a small LCD screen built into it that can display a 72x72 pixel image. The intended market is for streamers so that they can push a button to do various things with their stream, such as automatically post on Twitter or display an overlay video in OBS. The official software is great when it comes to supporting these features, but outside of streamers, the software is limited to only pressing keyboard keys.

 

Through the magic of reverse-engineering the USB protocol, I was able to get the Stream Deck to display what I want it to:

 

9TvlWcIl.png

 

By grabbing data through DCS BIOS, I'm also able to toggle the button images to reflect the state of the aircraft. Here is the Ka-50 in flight-ready mode, with master caution flashing:

 

BdimdXgl.png

 

There's also paging support:

 

mNMm52vl.png

 

uh1Dcmrl.png

 

1uEhzkol.png

 

The images will update correctly whether you click the button in the aircraft, or press the key on the Stream Deck itself. The Ka-50 is particularly well-suited for this device, as the aircraft uses plenty of LED push buttons.

 

In order to get this all working, I had to write two API libraries using NodeJS, one to convert the binary DCS BIOS export format into something easier to use (JavaScript objects), and another to interface with the Stream Deck through its USB HID protocol:

 

https://github.com/danieltian/dcs-bios-api

https://github.com/danieltian/stream-deck-api

 

They are available in NPM as well:

 

https://www.npmjs.com/package/dcs-bios-api

https://www.npmjs.com/package/stream-deck-api

 

Note that if you're interested in using these libraries, they are still under heavy development and will not be semver compatible until version 1.0.0. In other words, function names and signatures may change until I decide that they're stable.

 

If you have a Stream Deck and want to try it out with the Ka-50, you can check out this repo:

 

https://github.com/danieltian/dcs-stream-deck-ka50

 

You must have DCS BIOS installed first. Get it from https://github.com/dcs-bios/dcs-bios, then copy the Scripts folder to %USERPROFILE%\Saved Games\DCS\Scripts. If you already have an Export.lua file in that folder (most likely from Tacview), you will need to append this to the file instead:

 

dofile(lfs.writedir()..[[scripts\DCS-BIOS\BIOS.lua]])

 

Then download dcs-stream-deck-ka50, go over to the folder and run npm install, then npm start. You will need to have NodeJS installed. Keep in mind that the Ka-50 repo is my own playground for the controls, so the layout and functionality of the keys will probably change a lot, but it can serve as a good example if you're interested in developing your own.


Edited by Ranma13
  • Like 4
Link to comment
Share on other sites

  • Replies 167
  • Created
  • Last Reply

Top Posters In This Topic

damn, that's pretty cool! Well done.

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

Outstanding work. I could use this to make an all-in-one radio panel for the A-10C, or naturally, anything else!

 

You read my mind ;-)

 

RtLmgGjl.png

 

5r8BHqjl.png

 

FkFkhpal.png

 

Instead of using images, I'm dynamically drawing the text. It doesn't look great though, and there are some centering issues (some of the text is shifted too far left). I'm still looking into how to make it look better, but for now it works pretty good. It sends keyboards commands rapidly to control the radio, which definitely feels a lot better than pressing the F keys.

Link to comment
Share on other sites

I have never run Javascript before, so its a bit of a journey to get this up and running, you need the entire environment set up.

 

1. Install node.js

https://nodejs.org/en/

 

2. You need to install the build-scripts for node.js, including python.

Open an admin powershell and run:

npm install --global --production windows-build-tools

(This took something like 5 minutes to complete)

 

3. Still in powershell, run:

npm install --global node-gyp

4. Open the node.js command prompt from the start menu (installed with node.js) and run:

setx PYTHON "%USERPROFILE%\.windows-build-tools\python27\python.exe"

Close the cmd prompt and run it again. Do "set PYTHON" to verify that its working.

 

5. In node.js command prompt, install the stream-deck-api <--- I dont think you need to do this, its installed with dcs-stream-deck-ka50

"npm install stream-deck-api"

 

6. Install Git (needed for dc-stream-deck-ka50 to install)

https://www.atlassian.com/git/tutorials/install-git#windows

 

7. Install dcs-stream-deck-ka50

Grab the zip from https://github.com/danieltian/dcs-stream-deck-ka50, unzip into a folder and from in that same directory, using the node.js command line:

npm install

8. Run it

npm start

9. Bathe in the glorious-ness of your Stream Deck being bent to you will!


Edited by Thermal
Link to comment
Share on other sites

Now would be a good time to mention that, at this time, the libraries are written by a dev, intended for other devs. I do have plans to create a UI for all this in the future, but I'm still working towards a v1.0 stable release for the libraries. There's still some missing features that I'd like to add first (like good text support and good documentation) before I can start work on the UI. The UI will also take some time to complete because I intend for it to be generic, with features added through plugins. There's already some interest in using the Stream Deck for other purposes besides DCS, such as a MIDI controller, so the UI will need to support these kinds of workflows.

 

With that said, if you want to be on the bleeding edge of pre-pre-pre-alpha, you can give it a try now and it should work for the most part. The above post with the instructions is good, but you should be able to follow this set of simplified steps:

 

1. Install node.js from https://nodejs.org. Download the LTS (long-term support) version.

 

2. Install DCS BIOS if you haven't already.

 

3. Download dcs-stream-deck-ka50 from https://github.com/danieltian/dcs-stream-deck-ka50 by clicking on the green Clone or download button on the upper right, then Download ZIP. Unzip it somewhere.

 

4. Open up command prompt (or PowerShell, both will work) and cd over to the unzipped folder. Run "npm install". This will take a while to complete.

 

5. Run "npm start" and it should display stuff on the Stream Deck.

 

If you're getting errors about needing windows-build-tools, please let me know what the error is. I purposely designed the library to minimize external dependencies, so even Python shouldn't be necessary.

 

As a side note, I was curious whether it would work, so I gave this a try:

 

3H3Iicsl.png

 

It will instantly set every switch in the Ka-50 to the correct position, and will also start up the APU, wait for it to be ready, start both engines, and then plays "aircraft is ready" through the text-to-speech engine. Realistic? No way :). But it's fun to go from a ramp start to fully flyable in less than a minute :D, by pressing a single key (even auto-start requires 2 key presses!).

Link to comment
Share on other sites

Now would be a good time to mention that, at this time, the libraries are written by a dev, intended for other devs.

 

Totally understood. I've not looked at Javascript before, so why not start now :)

 

FYI, dcs-stream-deck-ka50 was not installing because it could not find my GIT path.

Link to comment
Share on other sites

FYI, dcs-stream-deck-ka50 was not installing because it could not find my GIT path.

 

Thanks for pointing that out! I do have one repo that I'm pulling from GitHub instead of NPM, because the GitHub version has features that the NPM version doesn't. I'll see if I can eliminate the dependency on Git, but chances are it's not possible.

Link to comment
Share on other sites

  • 3 weeks later...

At first, thanks for your information.

 

I've got the button box finally and install everything else but I got an error message "not found : git" at the final step to install dcs-stream-deck-ka50.

Is there no way to fix it for now?

Link to comment
Share on other sites

It seems like a good idea to have an index page where you select a panel or page you want to use and each panel/page has a button that goes back to the front page. I assume that's what you've done with the main page button.

Link to comment
Share on other sites

I've got the button box finally and install everything else but I got an error message "not found : git" at the final step to install dcs-stream-deck-ka50.

Is there no way to fix it for now?

You need to have Git installed. Easiest way is probably to download it from here: https://git-for-windows.github.io/

 

It seems like a good idea to have an index page where you select a panel or page you want to use and each panel/page has a button that goes back to the front page. I assume that's what you've done with the main page button.

 

Yes, that's what I've done for my own panel. The main page has my most commonly-used controls, and the other pages use the upper left-most button as a return to main page button.

Link to comment
Share on other sites

  • 3 weeks later...

Elgato Stream Deck as configurable button box

 

I forgot to say thank you for the latest answer. I, a big fan of Ka-50, really like this panel!

 

By the way I found some hidden switches(like WP~NAV/TGT line in PVI), is it possible to activate them? I'm not a software guy so don't know how this works...

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

Getting an error on the last step (npm start) in the dcs-stream-deck-ka50 directory. The output follows. Perhaps you can translate?

 

PS C:\Users\michaelc\Desktop\dcs-stream-deck-ka50> npm start

 

> dcs-stream-deck-ka-50@0.0.1 start C:\Users\michaelc\Desktop\dcs-stream-deck-ka50

> node index.js

 

module.js:487

throw err;

^

 

Error: Cannot find module 'C:\Users\michaelc\Desktop\dcs-stream-deck-ka50\node_modules\node-hid\build\Release\HID.node'

at Function.Module._resolveFilename (module.js:485:15)

at Function.Module._load (module.js:437:25)

at Module.require (module.js:513:17)

at require (internal/module.js:11:18)

at Object.<anonymous> (C:\Users\michaelc\Desktop\dcs-stream-deck-ka50\node_modules\node-hid\nodehid.js:9:15)

at Module._compile (module.js:569:30)

at Object.Module._extensions..js (module.js:580:10)

at Module.load (module.js:503:32)

at tryModuleLoad (module.js:466:12)

at Function.Module._load (module.js:458:3)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! dcs-stream-deck-ka-50@0.0.1 start: `node index.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the dcs-stream-deck-ka-50@0.0.1 start script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\michaelc\AppData\Roaming\npm-cache\_logs\2017-07-27T03_46_22_578Z-debug.log

Link to comment
Share on other sites

Getting an error on the last step (npm start) in the dcs-stream-deck-ka50 directory. The output follows. Perhaps you can translate?

 

Did you run npm install? It looks like it either didn't build, or didn't build properly. Can you provide the output from running npm install?

Link to comment
Share on other sites

This costs $150 on Amazon, for one, and needs additional software. The TM Cougar MFD includes two displays with ~24 buttons each, is plug and play, for half the price.

 

I've been using mine for a couple of years and have made profiles for 8 or 10 different airplanes. You can get premade profiles, or blanks and make your own. Both types here on the DCS forums.

TWC_SLAG

 

Win 10 64 bit, 2T Hard Drive, 1T SSD, 500GB SSD, ASUS Prime Z390 MB, Intel i9 9900 Coffee Lake 3.1mhz CPU, ASUS 2070 Super GPU, 32gb DDR4 Ram, Track IR5, 32” Gigabyte curved monitor, TM Warthog HOTAS, CH Pedals, Voice Attack, hp Reverb G2.

Link to comment
Share on other sites

Did you run npm install? It looks like it either didn't build, or didn't build properly. Can you provide the output from running npm install?

 

 

 

I did, or at least I thought I did. I will start over from the top of the instructions. Thanks.

 

 

Sent from my iPad using Tapatalk

Link to comment
Share on other sites

This costs $150 on Amazon, for one, and needs additional software. The TM Cougar MFD includes two displays with ~24 buttons each, is plug and play, for half the price.

 

I've been using mine for a couple of years and have made profiles for 8 or 10 different airplanes. You can get premade profiles, or blanks and make your own. Both types here on the DCS forums.

 

It's great to have options, isn't it? :)

 

I forgot to say thank you for the latest answer. I, a big fan of Ka-50, really like this panel!

 

By the way I found some hidden switches(like WP~NAV/TGT line in PVI), is it possible to activate them? I'm not a software guy so don't know how this works...

 

Here is the controls browser that I wrote: https://danieltian.github.io/dcs-bios-api/

 

If it doesn't show up there, then it can't be used. I'm not sure what the WP~NAV/TGT switch is.


Edited by Ranma13
Link to comment
Share on other sites

Did you run npm install? It looks like it either didn't build, or didn't build properly. Can you provide the output from running npm install?

 

Here is the output from the 'npm install' command:

 

PS C:\Users\michaelc\Desktop\dcs-stream-deck-ka50> npm install

npm WARN dcs-stream-deck-ka-50@0.0.1 No repository field.

 

up to date in 1.157s

Link to comment
Share on other sites

  • 6 months later...
This costs $150 on Amazon, for one, and needs additional software. The TM Cougar MFD includes two displays with ~24 buttons each, is plug and play, for half the price.

 

I've been using mine for a couple of years and have made profiles for 8 or 10 different airplanes. You can get premade profiles, or blanks and make your own. Both types here on the DCS forums.

 

But you need displays to see what the buttons do and they don't support paging.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...