Griffon26 Posted July 20, 2023 Posted July 20, 2023 Hello everyone, after a long pause of playing DCS I just plugged all my stuff into my pc and hopped back in the A-10C II. I build myself an UFC out of an Arduino Mega controller that is connected via DCS Bios. Unfortunately, I quickly realised that the Master Cautions LEDs on my hardware don´t work anymore when the Lights light up in the virtual cockpit. It´s a bit strange because every other button works ingame and when I load a simple blinking Programm onto the controller the LEDs I use for the Master Caution work just fine, so it has to do something with the connection to DCS I guess. Anyway, here is the code that currently runs on my Board, maybe there was a change or something else I missed?... Spoiler /* use '#define DCSBIOS_DEFAULT_SERIAL' DCSBIOS_IRQ_SERIAL instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_DEFAULT_SERIAL #include "DcsBios.h" /* Numpad */ DcsBios::Switch2Pos ufc1("UFC_1", 12); DcsBios::Switch2Pos ufc2("UFC_2", 13); DcsBios::Switch2Pos ufc3("UFC_3", 14); DcsBios::Switch2Pos ufc4("UFC_4", 18); DcsBios::Switch2Pos ufc5("UFC_5", 19); DcsBios::Switch2Pos ufc6("UFC_6", 36); DcsBios::Switch2Pos ufc7("UFC_7", 4); DcsBios::Switch2Pos ufc8("UFC_8", 5); DcsBios::Switch2Pos ufc9("UFC_9", 6); DcsBios::Switch2Pos ufc10("UFC_10", 38); /* Function Switches */ DcsBios::Switch2Pos ufcHack("UFC_HACK", 15); DcsBios::Switch2Pos ufcSpc("UFC_SPC", 7); DcsBios::Switch2Pos ufcFunc("UFC_FUNC", 16); DcsBios::Switch2Pos ufcLtr("UFC_LTR", 2); DcsBios::Switch2Pos ufcClr("UFC_CLR", 8); DcsBios::Switch2Pos ufcEnt("UFC_ENT", 17); DcsBios::Switch2Pos ufcMk("UFC_MK", 3); DcsBios::Switch2Pos ufcAltAlrt("UFC_ALT_ALRT", 9); DcsBios::Switch2Pos ufcNa1("UFC_NA1", 26); DcsBios::Switch2Pos ufcNa2("UFC_NA2", 27); DcsBios::Switch2Pos ufcNa3("UFC_NA3", 28); DcsBios::Switch2Pos ufcNa4("UFC_NA4", 30); DcsBios::Switch2Pos ufcNa5("UFC_NA5", 31); DcsBios::Switch2Pos ufcNa6("UFC_NA6", 32); /* Scroll Switches */ DcsBios::Switch3Pos ufcSteer("UFC_STEER", 11, 10); DcsBios::Switch3Pos ufcData("UFC_DATA", 23, 21); DcsBios::Switch3Pos ufcSel("UFC_SEL", 24, 22); DcsBios::Switch3Pos ufcDepr("UFC_DEPR", 29, 25); DcsBios::Switch3Pos ufcInten("UFC_INTEN", 33, 34); /* Master Caution */ /* Declare a Master Caution Reset button on pin 36 */ DcsBios::Switch2Pos masterCautionBtn("UFC_MASTER_CAUTION", 20); /* Make the LED connected to pin 35 into a Master Caution Light - not because of PNP */ DcsBios::LED mcLed(0x1012, 0x0800, 35); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I am very grateful for every helpfull answer! Cheers Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted July 20, 2023 Posted July 20, 2023 Your LED code looks correct (address and bit mask match). Which version of DCS-BIOS are you using?
Griffon26 Posted July 20, 2023 Author Posted July 20, 2023 Thanks for your answer! I´m running this version: DCS-BIOS Version: v0.10.0+64 (21e288cdeb95f54d1b5c4935fde9e51ae3c58965) Cheers! [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted July 20, 2023 Posted July 20, 2023 That's the "Hub" version. I'm not sure it will work anymore. It hasn't been supported for years. There's an actively-maintained version that was "forked" off an earlier version of the original for use with the Saitek Flight Panels hardware. However, it also has the Arduino library, so it works the same as far as Arduinos are concerned. Plus being actively updated, it has all the more recent aircraft additions. Despite the Flightpanels Fork DCS-BIOS version number being v0.7.48, it is far more up to date than v0.10.0 Starting the connection is harder, though, as it doesn't have the fancy interface Hub has. Your code SHOULD work as-is in the Flightpanels Fork, and I'd suggest uninstalling the Hub version and installing the Flightpanels version. There's a good video for Flightpanels version installation here: 2
Griffon26 Posted July 21, 2023 Author Posted July 21, 2023 Oh well I was on a break for quite a while and the last time I was flying and everything was working was approx one year ago? Anyway, I really appreciate your help! It makes sense that DCS got more updates that the old BIOS can´t handle anymore. Gonna Install the Fork with the Video you provided and will give a short feedback when I got time for it. Have a great Weekend! Cheers 1 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
Griffon26 Posted July 22, 2023 Author Posted July 22, 2023 So after installing the Fork of DCS Bios ecerything works as intended. Even the Master Caution Lights It´s been a while so I simply missed the part of the hub version getting abandonded... Anyway, i´m very glad that this community is simply awesome and keeps things runnning! I´m very grateful for your help! Thanks a lot. Cheers [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
Griffon26 Posted August 4, 2023 Author Posted August 4, 2023 (edited) Hello again, unfortunately the Master Caution LEDs stopped working again... It´s quite strange because they worked fine the last few times i played. Maybe it has something to do with the latest update? If i recall right they worked just fine before. I´m using the Beta version (who doesn´t anyway?) Now it´s the same before installing the Fork version of DCS BIOS... Maybe someone has an idea? Or am I forced to wait for a BIOS Update? Cheers Griffon26 Edited August 4, 2023 by Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 4, 2023 Posted August 4, 2023 I did a test, and mine wasn't working until I updated this: https://github.com/DCSFlightpanels/dcs-bios Now it works again. Try that.
Griffon26 Posted August 5, 2023 Author Posted August 5, 2023 (edited) I just tested it but it doesn´t work even after updating to DCS-BIOS_0.7.48.zip like you. It´s really strange cause i haven´t changed anything. Edited August 5, 2023 by Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 5, 2023 Posted August 5, 2023 11 minutes ago, Griffon26 said: I just tested it but it doesn´t work even after updating like you. It´s really strange cause i haven´t changed anything. Well mine is latest Open Beta and latest DCS-BIOS as above. Code line: DcsBios::LED masterCaution(0x1012, 0x0800, 13); Have you checked the lamp is OK?
Griffon26 Posted August 5, 2023 Author Posted August 5, 2023 (edited) 47 minutes ago, No1sonuk said: Well mine is latest Open Beta and latest DCS-BIOS as above. Code line: DcsBios::LED masterCaution(0x1012, 0x0800, 13); Have you checked the lamp is OK? I just checked it again and it works fine with the blink sketch.. The difference between our codes is the name "masterCaution" which was "mcLED" but I changed it to yours and still nothing... Im using a Mega board and pin 35. The CMD which shows the communication is also working. Heres the content of my export.lua maybe it got messed up? Quote local vaicomlfs = require('lfs'); dofile(vaicomlfs.writedir()..[[Scripts\VAICOMPRO\VAICOMPRO.export.lua]]) dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]]) local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua') dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]]) Edited August 5, 2023 by Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 5, 2023 Posted August 5, 2023 The name (e.g. "masterCaution") can be changed as long as it's unique in the code. My export.lua: pcall(function() local pw=require('lfs');dofile(pw.writedir()..[[Scripts\pw-dev_script\ExportInit.lua]]); end,nil); pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Services\DCS-SRS\Scripts\DCS-SimpleRadioStandalone.lua]]); end,nil); dofile(lfs.writedir()..[[Scripts\Helios\HeliosExport16.lua]]) dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])
Griffon26 Posted August 6, 2023 Author Posted August 6, 2023 My next step is gonna be switching the MC LED with another (steering engaged for example) to simply check if LEDs arent working in general or if its really just the MC LED. I will report back. @No1sonuk Big thanks for your help! 1 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
Griffon26 Posted August 13, 2023 Author Posted August 13, 2023 As promised i´m reporting back. The last few days I was building an extension for my small desk mounted cockpit including some additional LEDs (Gun Arm, NWS, Canopy unlocked & Marker Beacon). In addition I added the Fire Handles including LEDs and none of them work smh.... I checked it with a custom Blink sketch and they lit up just fine. There has to be a problem with LEDs on my configuration and I really don´t know what to do about it. The toggle switches I added work just fine but everything with LEDs does not. Is there any info I can provide to work towards a solution? Cheers Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 13, 2023 Posted August 13, 2023 Are the working switches on the same Arduino as the LEDs you're trying? If they are, those Arduinos are correctly connected, and it must be an issue with the LED side. The next suggestion is to comment out all the switches to see if there's a conflict there. In case you didn't know, remember this: // This is a single line comment - it automatically ends at the end of the line /* This is a multi-line comment Anything between the two marks is a comment */
Griffon26 Posted August 13, 2023 Author Posted August 13, 2023 (edited) I got two Arduinos running now. Both are with the ATMega2650 controller and on both are the switches but not the LEDs working. The code im gonna run for one now with just the LEDs is below. I noticed the first comment mentioning this: /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ As I mentioned i run the ATMega2650 so what is the other alternative for the #define part? Spoiler /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_DEFAULT_SERIAL #include <DcsBios.h> //Front Dash //CANOPY UNLOCKED IndicatorA-10C/CANOPY_UNLOCKED DcsBios::LED canopyUnlocked(0x10da, 0x0004, 32); //GUN READY IndicatorA-10C/GUN_READY DcsBios::LED gunReady(0x1026, 0x8000, 30); //MARKER BEACON IndicatorA-10C/MARKER_BEACON DcsBios::LED markerBeacon(0x10da, 0x0002, 33); //Nosewheel Steering IndicatorA-10C/NOSEWHEEL_STEERING DcsBios::LED nosewheelSteering(0x10da, 0x0001, 31); //Glare Shield //APU Fire IndicatorA-10C/APU_FIRE DcsBios::LED apuFire(0x10da, 0x0010, 49); //Left Engine Fire IndicatorA-10C/L_ENG_FIRE DcsBios::LED lEngFire(0x10da, 0x0008, 47); //Right Engine Fire IndicatorA-10C/R_ENG_FIRE DcsBios::LED rEngFire(0x10da, 0x0020, 51); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } EDIT: Having only the LEDs running doesn´t work either... What a strange Phenomenon Edited August 13, 2023 by Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 13, 2023 Posted August 13, 2023 #define DCSBIOS_IRQ_SERIAL Both should work for ATMega2650, though.
Griffon26 Posted August 13, 2023 Author Posted August 13, 2023 my next step would be uninstalling DCS BIOS and reinstalling it. In order to do so I guess i have to delete the whole folder in the saved games folder, remove the lua line and reboot. [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
Griffon26 Posted August 13, 2023 Author Posted August 13, 2023 Well, that didn´t help and changing the #define line didn´t do anything either... I really dont know what´s wrong... It worked just fine but after the last DCS update it got corrupted i guess... DCS Bios got an update yesterday which i now use without any success [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 13, 2023 Posted August 13, 2023 It may not be you. Something I had working isn't anymore. I'll investigate after work tomorrow (Monday). 1
Griffon26 Posted August 14, 2023 Author Posted August 14, 2023 I´m sorry but also a bit reliefed to hear that Many thanks for your Help! 1 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 14, 2023 Posted August 14, 2023 (edited) I updated this, and now it works: https://github.com/DCSFlightpanels/dcs-bios Delete the DCS-BIOS folder from your SCRIPTS folder in the DCS savedgames folder, then copy the new one there. Open DCS and run a mission to reconstitute the files. Close DCS, then do the connection start and and restart DCS. Edited August 14, 2023 by No1sonuk
Griffon26 Posted August 15, 2023 Author Posted August 15, 2023 (edited) So I got a update: I think I know the reason but not a solution for the non working LEDs. I searched through github (god i hate that site and its layout) and found some extended troubleshoot. I disabled all my Export.lua addons except for DCS-BIOS and voila, the LEDs work. After that I added the rest and as soon as the SimShaker is implemented, the LEDs stop working. Well they get updated once at the beginning of a mission and then never again... I will try reinstalling the SimShaker software and hope for a newer version that works with DCS-BIOS. Maybe there is someone who can tell me what may cause the problem? Here´s my Export.Lua and it´s current order which I recreated from the one in the troubleshoot page. Spoiler dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]]) dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]]) local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua') local vaicomlfs = require('lfs'); dofile(vaicomlfs.writedir()..[[Scripts\VAICOMPRO\VAICOMPRO.export.lua]]) Cheers Edited August 15, 2023 by Griffon26 [sIGPIC][/sIGPIC] Never parachute into an area you've just bombed You never have too much fuel, unless you burn.
No1sonuk Posted August 15, 2023 Posted August 15, 2023 A problem I'm having with another app may be down to start order. Maybe try starting Simshaker and DCS-BIOS in a different order. 1
Trol Posted June 27, 2024 Posted June 27, 2024 I am a brand new Skunkworks DCS-BIOS user and the LEDs stopped working for me compared with the original DCS-BIOS from 2019. The LEDs work on the older versions of Skunkworks DCS-BIOS, at least for the F-14. My solution was to remove the new 6/26/2024 nightly and install the old version DCS-BIOS_0.7.39.zip https://github.com/DCS-Skunkworks/dcs-bios/releases?page=2 and now the LEDs are working. No other changes needed.
Recommended Posts