Jump to content

DCS-BIOS over RS485


Hansolo

Recommended Posts

Hi shadowframe,

 

Nicely obseved. That is because I am also forwarding a 5VDC line for future back lighting :-)

 

Cheers

Hans

 

Thanks for the fast response and the great tutorial.

TKGXa11.jpg

Ckr2bz4.jpg

Soldering like an amateur, my connection for the first two slaves

my tutorial for dcs-bios, multimonitorsetup with a JF-17

https://github.com/shadowframe/jf17_multimonitor

 

discord shadowframe#7916

Link to comment
Share on other sites

I have built the circuit as described. However, I can only program the slaves if the 487 is not on the socket and I can only see general communication in the shell when the dcs is running. The slaves don't communicate with the master.

 

Images of the build

https://imgur.com/gallery/ydAW2gI

 

Ok, solution : bad breakout board at Arduino mega

 

But one problem, can't upload a sketch on the slave with usb. Only if I remove the 487 from the socket :(


Edited by shadowframe

my tutorial for dcs-bios, multimonitorsetup with a JF-17

https://github.com/shadowframe/jf17_multimonitor

 

discord shadowframe#7916

Link to comment
Share on other sites

But one problem, can't upload a sketch on the slave with usb. Only if I remove the 487 from the socket :(

 

No that is correct. You cannot load the Arduino while the MAX487 is connected. I do the same. I seem to recall using a pull down resistor somewhere but I need to locate that piece information on the forums.

 

Glad you got it working, sir.

 

Cheers

Hans

Link to comment
Share on other sites

No that is correct. You cannot load the Arduino while the MAX487 is connected. I do the same. I seem to recall using a pull down resistor somewhere but I need to locate that piece information on the forums.

 

 

 

Glad you got it working, sir.

 

 

 

Cheers

 

Hans

Thank you for the information and fast reply

 

Gesendet von meinem Pixel 3 XL mit Tapatalk

my tutorial for dcs-bios, multimonitorsetup with a JF-17

https://github.com/shadowframe/jf17_multimonitor

 

discord shadowframe#7916

Link to comment
Share on other sites

Ok, i made it work just like it is here, but on the Huey and with a full panel. I have some questions though:

 

1. Now that I made it work, i need to connect another nano from another panel. Where is that nano connected in that whole circuit? Goes to the master chip? the Mega?

 

2. Is there a relation between the blue cable in the master and in the slave? What is that for?

 

3. I understand I need 3 cables per slave nano: TX, RX and an extra input? D2 for example.

 

Thanks!

Link to comment
Share on other sites

it's best to use the circuit diagram in the first post as a guide. The image under the text:

 

Mine runs a single Master and a single communication line. The initial idea was that I wanted to stress test the communication. I so far have about 23 Slaves running on that single line.

 

I have set up my circuit 1: 1 and it works without problems. I wish you success !

 

 

 

Gesendet von meinem Pixel 3 XL mit Tapatalk

my tutorial for dcs-bios, multimonitorsetup with a JF-17

https://github.com/shadowframe/jf17_multimonitor

 

discord shadowframe#7916

Link to comment
Share on other sites

1. Now that I made it work, i need to connect another nano from another panel. Where is that nano connected in that whole circuit? Goes to the master chip? the Mega?

 

The next slave needs it's own MAX487 chip. A & B pins on the new MAX487 needs to be connected to A & B lines on the setup you have already made

 

2. Is there a relation between the blue cable in the master and in the slave? What is that for?

The blue wire is is for RE/DE which serves similar function on both Master and Slaves

 

3. I understand I need 3 cables per slave nano: TX, RX and an extra input? D2 for example.

 

You need three wires when connecting a MAX487 to an Arduino RX, TX & RE/DE.

To inter connect the MAX487 you need two wires, A & B.

Last but not least you need to apply power to both MAX487 and Arduino.

 

Hope this answers your questions

 

Cheers

Hans

Link to comment
Share on other sites

  • 1 month later...

I've posted this in another thread as well, but can someone confirm what LED's should be blinking or on when DCS is communicating?

 

There is the RX and TX LED's on the master, and the RX / TX LED's on the Nanos, should I be seeing activity on both when communicating? Right now, the only one that does anything is the RX LED on the Mega

 

Also, there is a TinySine RS485 shield for the Uno / Mega series like this one, could this be used for the master?

 

https://www.ebay.com/itm/Tinysine-RS232-RS485-Shield-For-Arduino-Convert-UART-to-RS232-or-RS48/221495004070?epid=1656872766&hash=item3392218ba6:g:7~QAAOSwbqpTxIlS

 

Cheers

 

Les

Link to comment
Share on other sites

Keep it simple re read Hansolo's tutorial take it one set at a time if it does not work if you purchased cheep Chinese boards they may be the problem

https://www.shapeways.com/shops/a-10c-warthog-supplies

https://forum.dcs.world/topic/133818-deadmans-cockpit-base-plans/#comment-133824

CNCs and Laser engravers are great but they can't do squat with out a precise set of plans.

Link to comment
Share on other sites

I have an Elegoo board, which from what I have read is one of the better ones.

 

If someone can actually tell me what lights should blink / flash / be on it may help my troubleshooting. As I don't know how it should be, I can't tell whether it's not acting correctly, all I can tell is it doesn't work. It's like blink codes, they give you an idea where the problem may be

 

Cheers

 

Les

Link to comment
Share on other sites

For anyone that is interested, I have written a sketch that can be used with a Mega board that you can connect up to 22 stepper drivers to one Mega using only two pins to each stepper driver. In addition you can also connect I2C devices as the SDA / SLC pins are not used by the steppers, and you can also connect other types of devices like LED's, but that will reduce the number of pins available for Steppers

 

as an example I currently have all 12 engine instruments working off one Mega, plus the two hydraulic gauges and fuel quantity gauges, and it just uses one USB connection.

 

This is not to detract in any way from the fantastic work done on this sticky thread by Hansolo, it's just an alternative means to do the same thing.

 

Cheers

 

Les

Link to comment
Share on other sites

For anyone that is interested, I have written a sketch that can be used with a Mega board that you can connect up to 22 stepper drivers to one Mega using only two pins to each stepper driver. In addition you can also connect I2C devices as the SDA / SLC pins are not used by the steppers, and you can also connect other types of devices like LED's, but that will reduce the number of pins available for Steppers

 

as an example I currently have all 12 engine instruments working off one Mega, plus the two hydraulic gauges and fuel quantity gauges, and it just uses one USB connection.

 

This is not to detract in any way from the fantastic work done on this sticky thread by Hansolo, it's just an alternative means to do the same thing.

 

Cheers

 

Les

 

can you post pictures and diagrams, if you had already done that , sorry for repeating

Link to comment
Share on other sites

There is the RX and TX LED's on the master, and the RX / TX LED's on the Nanos, should I be seeing activity on both when communicating? Right now, the only one that does anything is the RX LED on the Mega

Irrelevant now but to the best of my knowledge you should Master RX flickering on when receiving data from DCS and Master TX flickering on when Master is sending data to DCS.

 

Slave RX should be flickering when receiving data over RS485 from the Master. Slave TX should be flickering when sending data to Master over RS485.

 

@lesthegrngo & @bad_turbulence kindly suggest you continue your discusion over at lesthegrngo's thread https://forums.eagle.ru/showthread.php?t=271340 as clutter up DCS-BIOS over RS485.

 

And sorry for the late reply. Been quite busy at work. Stay safe.

 

cheers

Hans

Link to comment
Share on other sites

  • 2 weeks later...

A couple of quick questions out of curiosity:

 

1) Does a slave unit transmit any data to the master, such as on power-up or idling, if you don't send any data from the slave device. i.e. if you're using the slave to drive gauges, but no switches.

 

2) If there's no data in (1), could slaves share an address?

Link to comment
Share on other sites

You probably have to ask Ian the father of DCS-BIOS (https://forums.eagle.ru/member.php?u=95995) these questions, because they seem more into how the 'mechanics' in the core code works of which I have no knowledge. This thread is meant as an aid into getting it to work.

 

Cheers

Hans

Link to comment
Share on other sites

  • 2 weeks later...
Irrelevant now but to the best of my knowledge you should Master RX flickering on when receiving data from DCS and Master TX flickering on when Master is sending data to DCS.

 

Slave RX should be flickering when receiving data over RS485 from the Master. Slave TX should be flickering when sending data to Master over RS485.

 

 

 

And sorry for the late reply. Been quite busy at work. Stay safe.

 

cheers

Hans

 

Well, I may end up having to come back to this sooner that I thought, Hans. I did a test today (OK, I was playing to enjoy seeing all the stuff working...) by connecting a load of the separate parts up using USB, which even though I had 15 gauges running of the Mega, still meant due to the current state that I had a total of 14 USB devices connected, including the Thrustmaster HOTAS / joystick combination. And boy does it cause lag...

 

Admittedly 14 USB connections is more than I want to end up with, as there are six that can be combined onto another Mega, but clearly I need to keep the number of USB connections down, and ultimately the RS485 network will probably have to be the way. The nice scrolling OLED displays look like they need to be kept on individual Arduinos, if nothing else because they have static and conflicting i2C addresses. The i2C multiplexers I'm still waiting for may help but I suspect that the load each OLED puts on the nanos will prevent that

 

I assume that there is nothing that can be done to address the USB lag?

 

Cheers

 

Les

Link to comment
Share on other sites

Hi guys, especially Hansolo,

 

I have managed to get several slaves working now on my RS485 DCSBIOS network, but am experiencing some new problems....

 

I have a Nano which is used to run a 10 position switch, a momentary button, a toggle switch and a rotary encoder, to be a radio selector and tuner, R-828 in Mi8. However, it only works on 5 positions of the rotary switch, and the other elements do not work at all. I have swapped out the Max487 chip, and I even swapped out for a new Nano.

The circuit is supplied with 12v via the Master Mega. On the circuit there are also a Mega (which Hansolo helped me write a sketch for, and which works fine), 6 other Nanos too.

I have another Mega slave which also gives weird results. It appears to be “working” but responses to inputs are very slow or intermittent and unreliable.

 

Any thoughts or suggestions please? I love the whole DCSBIOS principle, but sometimes I think of giving it up and converting it all to MMjoy or Leobodnar boards! (I sympathise with Lesthegrngo on the frustration of DCSBIOS, and I am not electronics “smart”, just following the work of others....)

 

Help! Please!

 

Molevitch

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

Molevitch, the 10 position switch, did it work on all the 10 positions prior to connecting it to DCS BIOS? The reason I ask is that I got a load of 3 to 12 position switches, where you select how many positions that the switch can move to by putting a tabbed washer under the mount nut.

 

However when I actually physically tested it for electrical connectivity to design the PCB, I found that in reality it was not a 12 contact switch, merely a 12 position switch. When you rotated it, instead of connecting ground to contacts 1, then 2, then, 4, 5, 6, 7, 8, 9, 10, 11, what actually did was connect ground to 1, then 2, then 3, then 1, then 2.....

 

So in actual fact it was a 3 position switch with four contacts each. Half an hour with a set of jewelers screwdrivers, a modelling sprue cutter and lots of swearing and I had a proper 12 position switch, they are not difficult to modify, just fiddly. Could it be that your switch has the same issue?

 

And with regard to DCS BIOS, it may not be the simplest thing for me to use, as I share your view on electronics. However it has enabled me to get things working that were the stuff of dreams a couple of years ago so I am grateful for its existence. There are two caveats to DSC BIOS for me.

 

Firstly, where I can use a Bodnar type board for input, I will, as they are 'light' on the system and in my experience are very reliable and robust. I have a number of panels I made (the CDU is a good example, the MFCD's another) where the buttons and inputs are all available via the DCS control mapping, and so all go into the 64 button boards, even if I am using Arduinos and DCS for the rest of the panel. I will only use DCS Bios for those items where no control mapping is available. Of course the downside is extra wiring....

 

Secondly, my experience with DCS BIOS would have been 20 times easier if I hadn't had all the issues with RS485. I believe that I have probably mis-spent 6 or seven weeks in total over the last 18 months with RS485. I can't blame DCS BIOS for that, though. In itself DCS BIOS has it's niggles, but (so far) everything I have tried to make I have ultimately managed to complete, even some of the more esoteric ones.

 

I don't know about you, but one of my problems here with stuff like RS485 is that I am working alone physically. There is no-one I can ask to double check my stuff, so if I am blind to something obvious it will stay that way. Maybe that's where you should look, trying to get someone else to to take a look at what you are doing to see if there is an obvious fault.

 

But I accept your sympathies wholeheartedly!

 

Cheers

 

Les

Link to comment
Share on other sites

Hi Les,

 

thanks for the reply. My 10 pos switch is definitely 10 positions. Old style round wafer with 10 separate contacts and 1 common.

 

No, this is a weirdness. As I say, on the same Arduino, the other switches are not working, despite being apparently all connected correctly.

 

I will take it apart and put it all back together again....

 

But with the other board, the Mega, I am running rocker switches for the Mi-24/8 Autopilot system, (or planning to, when it works), its like the system keeps missing the input, as if it goes by too fast. What I don't understand is why. I have put in a timer, but made no difference.

 

And another weird effect. With another bank of switches connected for the fire extinguisher board, when I use my trim button to deactivate a magnetic brake on my cyclic, which is not connected to anything else except that, it triggers the fire extinguishers!

 

:(:doh:

 

So this one Nano that will not work on the network... it does work as a stand-alone in serial mode with an amended sketch. Which means it is a network issue, or rather a problem with my wiring....


Edited by molevitch

SCAN Intel Core i9 10850K "Comet Lake", 32GB DDR4, 10GB NVIDIA RTX 3080, HP Reverb G2

Custom Mi-24 pit with magnetic braked cyclic and collective. See it here: Molevitch Mi-24 Pit.

 

[sIGPIC][/sIGPIC] www.blacksharkden.com

bsd sig 2021.jpg

Link to comment
Share on other sites

DCS-BIOS over RS485

 

Windows update?

Today I was going to do a fast test with a new solenoid, connected and started the sim, but none of the panels I have worked, the tx light on the master flashed but no response. Disconnected all network cables to the master and tried with only one panel, nothing.

 

Got prompted about a windows update, pressed later.

 

Loaded stand alone code to one panel, that worked, crap, master might be broken...

Windows restarts automagic and updates and now everything works again?

 

Could the windows update be blocking the transmission from the master but not a stand alone panel? I have no idea but I didn’t do anything during the update, it just started to work again.

Link to comment
Share on other sites

  • 3 weeks later...

Hi all!!

 

I'm making some really good progress with my cockpit. Been able to run a full panel with no problem. Now, i added a second panel (caution lights).

 

I'm able to extract information ok. Both panels work when connected to the same RS485 network. Problem is that lights tend to go off and on randomly, after a couple of seconds.

 

Thought it was a power supply problem, but although sending mega's 5V through VIN and connecting the nano to the PC, it keeps doing that.

 

I'm running 17 leds in each pinout of the nano, leaving D2 for the MAX487 chip.

 

As i'm writing this, i quit DCS with the panel on and the lights that were supposed to be on after aircraft shutdown are permanently on, so i guess it isnt a power problem. Looks like there's a comms problem between DCS Bios and my panel.

 

Here's the Caution Panel sketch i'm using right now

 

/*

The following #define tells DCS-BIOS that this is a RS-485 slave device.

It also sets the address of this slave device. The slave address should be

between 1 and 126 and must be unique among all devices on the same bus.

*/

#define DCSBIOS_RS485_SLAVE 122

 

/*

The Arduino pin that is connected to the

/RE and DE pins on the RS-485 transceiver.

*/

#define TXENABLE_PIN 2

 

#include "DcsBios.h"

 

/* paste code snippets from the reference documentation here */

 

DcsBios::LED clB1(0x1414, 0x0800, 3);

DcsBios::LED clC1(0x1414, 0x1000, 4);

DcsBios::LED clD1(0x1414, 0x2000, 5);

DcsBios::LED clE1(0x1414, 0x4000, 6);

DcsBios::LED clF1(0x1414, 0x8000, 7);

DcsBios::LED clG1(0x1416, 0x0001, 8);

DcsBios::LED clH1(0x1416, 0x0002, 9);

DcsBios::LED clI1(0x1416, 0x0004, 10);

DcsBios::LED clJ1(0x1416, 0x0008, 11);

DcsBios::LED clJ0(0x1414, 0x0200, 12);

DcsBios::LED clI0(0x1414, 0x0100, 13);

DcsBios::LED clH0(0x1414, 0x0080, 14);

DcsBios::LED clG0(0x1414, 0x0040, 15);

DcsBios::LED clF0(0x1414, 0x0020, 16);

DcsBios::LED clE0(0x1414, 0x0010, 17);

DcsBios::LED clD0(0x1414, 0x0008, 18);

DcsBios::LED clC0(0x1414, 0x0004, 19);

 

 

void setup() {

DcsBios::setup();

}

 

void loop() {

DcsBios::loop();

}

 

anyone with similar problems?

 

Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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