Jump to content

Am I missing something?


algerad3

Recommended Posts

I am going to do some more developing tomorrow but meanwhile I'd like to say that DCS BIOS seems like a very good idea, offering easy access to various instruments. So I hope you'll make something of it!

:thumbup:

 

Thanks!

 

Sorry for not responding last week, until Tuesday I was busy preparing for an exam (which I ended up failing, so in hindsight I should have spent the time hacking on DCS instead :music_whistling:).

 

What's missing from DCS-BIOS right now is exporting of analog gauge positions. While it can be done in the same way as exporting e.g. indicator lights, the position of analog gauges changes potentially every single simulation frame. Those rapid changes could overwhelm a slow transport like a serial connection to a microcontroller, so I want to implement some kind of rate limiting there.

 

Once I have rate limiting (I now have an idea of how I want it to work) and add the analog gauges, I will make an official announcement.

Link to comment
Share on other sites

  • 2 weeks later...

Ian you might find some serialization code and techniques in the Ros.org (Robot Operating System) project. Robots need timely data (more and more of it) and they need to speak to micros. I have played around with ROS modules a little bit.

 

ROS modules seem like a natural fit for extending Simulation interfaces. You could implement the publish/subscribe model if you want to control how much data DCS is pushing out (if you worry it will saturate a serial link). ROS client for LUA? Google says Yes.

 

I have also used a simple serialization format called Bencode. I was using an arduino and I wanted to send and receive small amounts of structured data but at the lowest latency - it worked well. I probably went with Bencode because I read about it on Jeelabs.


Edited by vicx
added link
Link to comment
Share on other sites

I have added all the A-10C analog stuff I could find to my local development version and looked at a packet capture. It seems that when I limit the export frequency for float values to 10 times per second, the data rate of the export stream stays comfortably below 10 KB/s even when a lot is changing at once (such as spooling up the engines) -- that is slow enough for a 115200 bps serial connection.

 

It may overwhelm an Arduino Ethernet shield though (haven't tested that yet, but read that it can only do about 4 KB/s).

 

Regarding latency, I don't care about it as long as it is not noticeable (and it currently seems fine to me).

 

Bencode sounds interesting, but it is more complex than what I need. Same for the ROS stuff.

Given that the current protocol seems to be good enough to work over a reasonably fast serial port, I will most likely keep it. It can be used to get started and to provide a working example project.

 

I want to add some concept of multiple export streams, where each one has a maximum data rate and a white- and/or blacklist of messages. That gives you options (don't export data you don't need and/or use multiple serial connections) if you do want to increase the export frequency of analog values or reduce the data rate to cope with longer transmission lines.

 

However, I expect the most common use case to be a serial connection to an Arduino board that has a few buttons, switches, LEDs, pots and rotaries attached. In this "most likely" scenario, there won't be any analog instruments so you don't care that those are exported at "only" 10 fps. The transmission line for the serial connection (not the USB cable) will be a short cable or integrated into the Arduino board, so 115200 bps should be no problem at all.

Link to comment
Share on other sites

  • 2 weeks later...

Bloody Hell Ian,

 

It works beatifully. I had some issues which finally identified as broken ethernet shield. And then almost instant success :smilewink:

 

Have made a small YT showing the functioning of my NMSP. Much easier than I had imagined. Thanks a lot. If I could rep you more I would have :thumbup:

 

https://www.youtube.com/watch?v=uxlB9TvHqD4

 

Cheers

Hans

Link to comment
Share on other sites

  • 2 weeks later...

Just a heads-up to early adopters of DCS-BIOS (posting it here because it's the only place on these boards I have mentioned the project so far):

 

I plan to do some major changes to the export protocol (the "experimental" branch is called that for a reason). I thought I could get away with the simplicity of the current protocol, but when you start exporting all analog instruments 30 times per second you start to notice even a few milliseconds of latency if it delays the position update of a servo motor.

 

At least for the export protocol, I will throw out the whole "human-readable protocol" idea and instead use a representation that is as space-efficient as possible so I can cram most of the A-10C cockpit state (except a handful of strings such as the radio freqs and the CMSP display) into 313 bytes.

 

I know what I want to do, but I have no idea how much time I will have to work on it; it might take several months to implement everything. Once the changes hit, any sketches that use the Arduino library will require little effort to adapt. If you write your own software that talks to DCS-BIOS, you will need to do some bit-twiddling.

 

After these changes, I expect to officially announce the project. I just want to wait with that until I am reasonably confident that it scales up to exporting everything at once -- my goal is to get smooth performance over a 115200 bps serial connection at 30 fps.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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