Jump to content

DCS-BIOS: problem with first attempt - master caution


Jocman

Recommended Posts

Hi all.

After reading all the posts concerning the general discussion, and the documentation, yesterday evening I did my first attempt with the classic MasterCaution sketch loaded on my arduino NANO (chinese).

As I'm interesting in Ka-50, I modified the command lines to match the aircraft, with the following:

DcsBios::Switch2Pos scMasterCautionBtn("SC_MASTER_CAUTION_BTN", 15);  //use pin D12
DcsBios::LED scMasterCautionLed(0x1814, 0x0800, 16);    //use pin D13

Started SOCAT, then DCS and started an instant mission

Well, the button works (I can see in the cockpit the button moving, and in socat I get the messages about the command), but the led doesn't.....

Damn.... well, 50% is better than nothing.

Today, I modified the circuit, in order to use only the built in led (pin D13) so to be sure no issue about the polairy (in other words, I justy took away led and resistor...), but this time nothing works at all, the button neither...

 

I tried several time to recompile and load the ino file, changing pin over pin, deleting the line concerning the led and keeping only the one for the button...

Again, if maybe the button got faulty, I simply shortcut gnd and the pin directly....

Nothing, nothing, nothing.....

I've seen now SOCAT keep being in such an....idle state (waiting since 2-1-0 second. press a key to continue), but DCS does'n give any sign of life....

Help?

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Hi. Han

First of all thanks for your support.

Attached you find couple of pics: the wirings (sorry, I quickly remade it today in my office - and I tested again in DCS, with no good results....), and a screenshot where you can see socat stucked (sorry, the system is italian Language)

 

 



/*
 Tell DCS-BIOS to use a serial connection and use interrupt-driven
 communication. The main program will be interrupted to prioritize
 processing incoming data.
 
 This should work on any Arduino that has an ATMega328 controller
 (Uno, Pro Mini, many others).
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
/* paste code snippets from the reference documentation here */
DcsBios::Switch2Pos scMasterCautionBtn("SC_MASTER_CAUTION_BTN", 15);
DcsBios::LED scMasterCautionLed(0x1814, 0x0800, 16);


void setup() {
 DcsBios::setup();
}
void loop() {
 DcsBios::loop();
}


The code is the standard master caution example, just updated to match Ka-50

IMG_20180619_091916.jpg.4b33dc3d157ac459c283c1600b3cff50.jpg

IMG_20180619_092557.jpg.c67fe3a15abf1a98dd3ec764d459dea2.jpg

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Hi Jocman,

 

Try this instead;

/*
 Tell DCS-BIOS to use a serial connection and use interrupt-driven
 communication. The main program will be interrupted to prioritize
 processing incoming data.
 
 This should work on any Arduino that has an ATMega328 controller
 (Uno, Pro Mini, many others).
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
/* paste code snippets from the reference documentation here */
DcsBios::Switch2Pos scMasterCautionBtn("SC_MASTER_CAUTION_BTN", 12);
DcsBios::LED scMasterCautionLed(0x1814, 0x0800, 13);


void setup() {
 DcsBios::setup();
}
void loop() {
 DcsBios::loop();
}

 

From the picture it looks like you have connected the Master Caution button to pin no 12 and Master Caution LED to pin 13 (onboard LED). You can use pins 15 and 16 but there are analog A1 and A2.

 

Cheers

Solo

Arduino-Nano-Pinout.thumb.png.7c61e6fd426a98b53cf6d8ab9cf38f23.png

Link to comment
Share on other sites

Hi Han.

Changing the pins as you suggested worked but partially.

Once again, 50%, only the Button is working, the led doesn't.

I tried by swapping the led polarity, but nothing. Even the onboard led gives no sign of life.

It can be possible the led address is wrong in dcsbios reference? cause I tried by pressing the front panel's lamp test button, but no response.

 

 

(BTW, when wiring arduino I've been using the "easy" scheme iI found in the forum, but allegedly is clearly wrong (see attachment) .

I'll provide a custom scheme from the official Nano one.)

Clipboard01.jpg.7eb5cd48a3a5e01a95dc7045967314df.jpg

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Hi Jocman,

 

What happens if you remove the external LED? Maybe it's defective. Alternatively try and try another DCS-BIOS led e.g.

 

DcsBios::LED clExtendGear(0x1818, 0x0002, 13);

 

I am afraid I do not have the module so can't test it.

 

Cheers

Hans

Link to comment
Share on other sites

My advice, I did the same when I have this problem:

1. Check hardware - using simple blinking led program for arduino like this

 

if everythnig OK and working than:

2. Check DCS bios - like Hansolo already wrote use different LED in cockpit or check the code in

 

 

When you will found root case next step are easy:)...

[sIGPIC][/sIGPIC]

Building FW190D pit ,,To Dora with love" http://forums.eagle.ru/showthread.php?t=132743

Link to comment
Share on other sites

Hi guys.

 

 

I made some try.

 

 

The hardware is fine (the classic arduino blinking sketch works perfectly).

 

 

Tried to change led (using the gear nose down) and even the switch (gear lever): The lever gear works, the led doesn't.

 

 

Tried even the Interactive reference (my first time). after watching the video and started socat then DCS, I don't see any sign of life as in the video (the metadata flux....). Anyway, by toggling the refernce switch for the master caution, i can see the sim master caution working, but, as before, no sign of life from the linked led.

 

 

For the sake of honesty, I'm starting with the BIOS test on my laptop running DSC World 1.2 (it cannot run higher versions), as the "monster" PC is still not available (i don't know how long it will take).

I hope this won't be the issue, but in case: it can be?

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Hi. Han

First of all thanks for your support.

Attached you find couple of pics: the wirings (sorry, I quickly remade it today in my office - and I tested again in DCS, with no good results....), and a screenshot where you can see socat stucked (sorry, the system is italian Language)

 

 



/*
 Tell DCS-BIOS to use a serial connection and use interrupt-driven
 communication. The main program will be interrupted to prioritize
 processing incoming data.
 
 This should work on any Arduino that has an ATMega328 controller
 (Uno, Pro Mini, many others).
*/
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
/* paste code snippets from the reference documentation here */
DcsBios::Switch2Pos scMasterCautionBtn("SC_MASTER_CAUTION_BTN", 15);
DcsBios::LED scMasterCautionLed(0x1814, 0x0800, 16);


void setup() {
 DcsBios::setup();
}
void loop() {
 DcsBios::loop();
}


The code is the standard master caution example, just updated to match Ka-50

 

Some questions for you:

 

1. Could you tell me where the above sketch came from?

2. What version of DCS-BIOS are you running?

3. What aircraft are you using when you run the sketch?

4. When you run the sketch is the aircraft actually running. Are you in active pause at the same time as the sketch is running?

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

Some questions for you:

 

 

 

 

1 - The sketch comes from DCS-BIOS (IRQ serial example, where I put the lines coming from the Ka50 BIOS reference)

 

 

2 - DCS-BIOS 0.7.1

 

 

3 - BS2

 

 

4 - The heli is currently flying (any kind of pause) (if I move the flight controls, the heli execute the commands)

 

 

As reported, at the moment the problem is "limited" to the LEDs, as the switches seem working right....

 

 

Allegedly, the problem reported in post

 

 

https://forums.eagle.ru/showpost.php?p=3535963&postcount=3

 

 

were linked to a wrong pin reference, as after i reported in post nr 5

(for clarity: my first hardware attempt has been made using an "official" nano reference. In that occasion, the switch worked, the led doesn't. later, i found the "simplified" version of nano reference, changed the pins according with that - wrong - pin numbers, so no functionality at all. The last attempt, after realizing the wrong pin number, has been made with the original Nano reference (so as posted by Han): once again, switches work, LEDs don't...)

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

1 - The sketch comes from DCS-BIOS (IRQ serial example, where I put the lines coming from the Ka50 BIOS reference)

 

 

2 - DCS-BIOS 0.7.1

 

 

3 - BS2

 

 

4 - The heli is currently flying (any kind of pause) (if I move the flight controls, the heli execute the commands)

 

 

As reported, at the moment the problem is "limited" to the LEDs, as the switches seem working right....

 

 

Allegedly, the problem reported in post

 

 

https://forums.eagle.ru/showpost.php?p=3535963&postcount=3

 

 

were linked to a wrong pin reference, as after i reported in post nr 5

(for clarity: my first hardware attempt has been made using an "official" nano reference. In that occasion, the switch worked, the led doesn't. later, i found the "simplified" version of nano reference, changed the pins according with that - wrong - pin numbers, so no functionality at all. The last attempt, after realizing the wrong pin number, has been made with the original Nano reference (so as posted by Han): once again, switches work, LEDs don't...)

 

 

 

Thanks for posting that info. I don't immediately see a problem with the sketch. Can you try another led indicator to see if its only the master caution led or if it is symptomatic of all inputs from LEDs. Also just make sure there is no pause active at the time you test. I always have the aircraft on the runway sitting with engines running when I test various panels and then I can easily take off if I need to test something in flight.

 

Other than that I will ask Ian if he can diagnose the issue once he arrives here in Canada this Saturday. Probably won't be the same day due to jet lag etc.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

Thanks for posting that info. I don't immediately see a problem with the sketch. Can you try another led indicator to see if its only the master caution led or if it is symptomatic of all inputs from LEDs. Also just make sure there is no pause active at the time you test. I always have the aircraft on the runway sitting with engines running when I test various panels and then I can easily take off if I need to test something in flight.

 

Other than that I will ask Ian if he can diagnose the issue once he arrives here in Canada this Saturday. Probably won't be the same day due to jet lag etc.

 

Hi Warhog, and thanks for your support.

 

 

As reported, I made some other try by using the gear lever switch and the gear nose down led. But nothing changed: the switch (the lever, this case) works, the LED doesn't.

 

As "test field" I use to run the free flight over Sokhumi (sorry if is wrong written), so to have the heli already on air, with all the systems on, and no pause.

I dont' know if is important, but differently of the most of the BIOS online videos, when I place on the screen both BIOS and DCS Windows, I don't see a.....flux of data flowing in socat, I just see when I press and release the button. Don't know if this matters, as I'm new on BIOS.

 

The only thing I can suppose could be related to the DCS World version I'm using (1.2), as by now I've to test on my laptop, and this is the max scenario I can run.

I highly hope this is not the issue, as right yesterday I reassembled my usual desktop at home, and installed DCS 2.5; unfortunately, the desktop neither can run it, the issue, as for the laptop, is the Video RAM.

About that, I'm planning to get a new video card (thinking about GeForce gtx1080, but as I've read in few days - maybe- nvidia should release the new architecture, maybe I can save some bucks - the GTX is almost 700$....)

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

If you don't see any data scrolling in the socat window, then there is a problem.

 

That data is the back and forth comms between DCS and the Arduino board. Without that data scrolling, you will not get any cockpit information sent FROM DCS.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

If you don't see any data scrolling in the socat window, then there is a problem.

 

That data is the back and forth comms between DCS and the Arduino board. Without that data scrolling, you will not get any cockpit information sent FROM DCS.

 

 

 

Uhm..... I don't like that

Any advice on how to fix / check it?

 

 

I think I followed all the instruction about how to install DCS-BIOS, no idea on what to do now....

 

 

As you can see in post #3, there's a screenshot of my DCS and socat running


Edited by Jocman

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Well, I don't know if it's a good idea, but I recorded a short video.

On the right side, you can see my DCS folder, where I put all the DCS-BIOS data as reported in user guide (inside Script folder), more all the DCS-BIOS files.

 

 

Then, while BS2 is running and no pause, I start connect-serial-port (the nano is on com5).

As you can see, nothing happens (no scrolling at all), but if I press the switch, the master caution works (the LED doesn't.....)

2018-06-23-10-36-01.part1.rar

2018-06-23-10-36-01.part2.rar

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

For the sake of honesty, I'm starting with the BIOS test on my laptop running DSC World 1.2 (it cannot run higher versions), as the "monster" PC is still not available (i don't know how long it will take).

 

Well Ian found the problem. There is a function in DCS BIOS that relies on a particular bit of code from DCS. Unfortunately, DCS 1.2 being rather old, does not supply that bit of code. As such, DCS BIOS cannot receive information from DCS 1.2. As you know, you can send info from toggle switch’s to DCS but you are not be able to receive anything in the way of indicators from DCS and that’s the reason why.

 

The fix... use a newer version of DCS (at least 1.5) and everything will work as intended.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

Well Ian found the problem. There is a function in DCS BIOS that relies on a particular bit of code from DCS. Unfortunately, DCS 1.2 being rather old, does not supply that bit of code. As such, DCS BIOS cannot receive information from DCS 1.2. As you know, you can send info from toggle switch’s to DCS but you are not be able to receive anything in the way of indicators from DCS and that’s the reason why.

 

The fix... use a newer version of DCS (at least 1.5) and everything will work as intended.

 

 

 

Well, Warhog, do you believe me if I tell you I was thinking about the same "solution"? (BTW, I have been supposing it in #12)

I was not sure, just a sensation, in fact yesterday evening I got my new GTX1080, installed and finally downloaded DCS2.5 and BS2. Didn't have time yesterday to set DCS - BIOS, but I'll try today and I'll post the result.


Edited by Jocman

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Well, back home, I tried with the BigOne PC with DCS2.5 and......everything is working fine: the socat window scrolls, the switch works, and the LED is ON.

This will be just a little problematic to program DCS BIOS (as I'd like to work on my laptop and then move all the working files in the desk pc), but I'll manage it someway. The important thing is that is working.

Thankyou very much both of you (Ian and you) for your support.

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

Just remember to post pics of your build as you progress. It’s inspiring to see how builders solve problems and develop new techniques to handle the various situations that arise.

 

Best of luck with your build.:thumbup:

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

Just remember to post pics of your build as you progress. It’s inspiring to see how builders solve problems and develop new techniques to handle the various situations that arise.

 

Best of luck with your build.:thumbup:

 

 

I think I'll do it, as I've been doing for my previous project (never airborn, just left on the taxyway....). Don't think I'll bring new solutions, but who knows?

Jocman

"For once you have tasted flight you will walk the earth with your eyes turned skywards, for there you have been and there you will long to return" (L. Da Vinci)

Prev. Projects:

https://forums.eagle.ru/showthread.php?t=50071

Link to comment
Share on other sites

  • 1 year later...

Master Caution F-16

 

in DCS-BIOS DOC i found this 2 codes for F-16 Master Caution button & LED

/* Declare a Master Caution Reset button on pin 10 */

DcsBios::Switch2Pos masterCaution("MASTER_CAUTION", 10);

/* Make the LED connected to pin 13 into a Master Caution Light */

DcsBios::LED masterCaution(0x4400, 0x8000, 13);

 

 

But if i insert both in my IDE i get the error that masterCaution function is doubled defined...

 

WHY?

Link to comment
Share on other sites

in DCS-BIOS DOC i found this 2 codes for F-16 Master Caution button & LED

/* Declare a Master Caution Reset button on pin 10 */

DcsBios::Switch2Pos masterCaution("MASTER_CAUTION", 10);

/* Make the LED connected to pin 13 into a Master Caution Light */

DcsBios::LED masterCaution(0x4400, 0x8000, 13);

 

 

But if i insert both in my IDE i get the error that masterCaution function is doubled defined...

 

WHY?

Because they are used twice;

/* Declare a Master Caution Reset button on pin 10 */
DcsBios::Switch2Pos [b]masterCaution[/b]("MASTER_CAUTION", 10);
/* Make the LED connected to pin 13 into a Master Caution Light */
DcsBios::LED [b]masterCaution[/b](0x4400, 0x8000, 13);

 

Rename one of them e.g.

/* Declare a Master Caution Reset button on pin 10 */
DcsBios::Switch2Pos masterCaution("MASTER_CAUTION", 10);
/* Make the LED connected to pin 13 into a Master Caution Light */
DcsBios::LED masterCaution[b]light[/b](0x4400, 0x8000, 13);

 

You should be good.

 

The Control reference I have says the F-16's master caution light is:
DcsBios::LED lightMasterCaution(0x4476, 0x0080, PIN);

Your reference is probably for DCS-BIOS hub version

 

cheers

Hans

Link to comment
Share on other sites

  • Recently Browsing   0 members

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