Ranma13 Posted June 16, 2017 Posted June 16, 2017 (edited) Recently, Elgato released the Stream Deck, which is a device that looks like this: 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: 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: There's also paging support: 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 June 16, 2017 by Ranma13 4
hansangb Posted June 16, 2017 Posted June 16, 2017 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
Ragtop Posted June 16, 2017 Posted June 16, 2017 Outstanding work. I could use this to make an all-in-one radio panel for the A-10C, or naturally, anything else! 476th vFG Alumni
Lobinjaevel Posted June 16, 2017 Posted June 16, 2017 Fantastic work! Looking forward to more, there is a LOT of potential in this!
Ranma13 Posted June 16, 2017 Author Posted June 16, 2017 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 ;-) 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.
horus-DCS Posted June 17, 2017 Posted June 17, 2017 This is awesome! I gotta search amazon for this device right now. Sent from my iPhone using Tapatalk
Ragtop Posted June 17, 2017 Posted June 17, 2017 I may PM you soon with some questions. If I can do what I need with this, I'm buying one! 476th vFG Alumni
Thermal Posted June 17, 2017 Posted June 17, 2017 (edited) 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-gyp4. 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 install8. Run it npm start9. Bathe in the glorious-ness of your Stream Deck being bent to you will! Edited June 17, 2017 by Thermal
Ranma13 Posted June 17, 2017 Author Posted June 17, 2017 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: 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!).
Thermal Posted June 17, 2017 Posted June 17, 2017 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.
Ranma13 Posted June 17, 2017 Author Posted June 17, 2017 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.
horus-DCS Posted July 9, 2017 Posted July 9, 2017 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?
98abaile Posted July 9, 2017 Posted July 9, 2017 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.
Ranma13 Posted July 10, 2017 Author Posted July 10, 2017 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.
horus-DCS Posted July 26, 2017 Posted July 26, 2017 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
N206LG Posted July 27, 2017 Posted July 27, 2017 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
Ranma13 Posted July 27, 2017 Author Posted July 27, 2017 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?
TWC_SLAG Posted July 27, 2017 Posted July 27, 2017 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.
N206LG Posted July 28, 2017 Posted July 28, 2017 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
Ranma13 Posted July 28, 2017 Author Posted July 28, 2017 (edited) 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 July 28, 2017 by Ranma13
N206LG Posted July 29, 2017 Posted July 29, 2017 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
Ranma13 Posted July 29, 2017 Author Posted July 29, 2017 Here is the output from the 'npm install' command: Delete the node_modules folder, then run npm install again. Perhaps it didn't download the dependencies correctly. 1
N206LG Posted July 30, 2017 Posted July 30, 2017 Delete the node_modules folder, then run npm install again. Perhaps it didn't download the dependencies correctly. That worked. Thanks for you help. Sent from my iPad using Tapatalk
Looney Posted February 20, 2018 Posted February 20, 2018 Does this work in 2.5? [sIGPIC][/sIGPIC] Commodore 64 | MOS6510 | VIC-II | SID6581 | DD 1541 | KCS Power Cartridge | 64Kb | 32Kb external | Arcade Turbo
OttoPus Posted February 20, 2018 Posted February 20, 2018 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.
Recommended Posts