Jump to content

DCS-BIOS Discussion Thread


FSFIan

Recommended Posts

00231.370 ERROR Lua::Config: Call error LuaExportActivityNextEvent:[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2433: bad argument #2 to 'sendto' (invalid ip address)

stack traceback:

[C]: ?

[C]: in function 'sendto'

[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2433: in function 'FlushData'

[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2420: in function 'SendData'

[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2401: in function 'ProcessArguments'

[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2338: in function <[string "C:\Users\FAR\Saved Games\DCS.openalpha\Scripts\Export.lua"]:2317>.

 

I haven't seen that one before. What OS, firewall and/or antivirus are you running?

 

You can try to disable multicast UDP and use TCP instead.

 

Edit BIOSConfig.lua and comment out the MulticastUDPSender line so it looks like this:

BIOS.protocol_io.connections = {
-- BIOS.protocol_io.DefaultMulticastSender:create(),
BIOS.protocol_io.TCPServer:create(),
-- BIOS.protocol_io.UDPSender:create({ port = 7777, host = "192.168.1.177" }),
BIOS.protocol_io.UDPListener:create({ port = 7778 })
}

 

Then use the following connect-to-serial-port.cmd script instead:

REM Specify the number of the COM port your Arduino is connected to:

set COMPORT=5



set /A TTYNUM=%COMPORT%-1
mode COM%COMPORT% BAUD=500000 PARITY=N DATA=8 STOP=1 TO=off DTR=on
socat\socat -v TCP4:localhost:7778 /dev/ttyS%TTYNUM%

pause

Link to comment
Share on other sites

Ian

 

I still don not have a file like this !!!!

 

If you followed the User Guide and downloaded the latest DCS-BIOS release version, you have that file. It's in the top level of the ZIP file, next to the "socat" and "Scripts" folders. It is the script you need to run when you have connected your Arduino over USB; it forwards data between the (virtual) COM port and DCS-BIOS.

Link to comment
Share on other sites

Check dcs-bios.log for errors again.

 

Before you try the Chrome application or the script below, make sure DCS is running and the mission is unpaused.

 

Once the control reference app is open in Google Chrome, press Ctrl+Shift+C to open the developer console, switch to the "console" tab and post a screenshot. If the chrome extension fails to open the TCP connection, the error message will be printed to the console.

 

Save the following as "tcp-console.cmd" in the same folder as connect-serial-port.cmd and run it:

socat\socat -v TCP4:localhost:7778 -

It should connect to DCS-BIOS and print any data it receives to the console window. The data is not plain text so it will look like a bunch of garbage.

 

Check that no other program is already listening on TCP port 7778 (I assume Windows 10 still comes with a Resource Monitor program).

 

The only plausible explanation I have at this point is that some firewall / antivirus / malware / strange Windows 10 quirk interferes with the TCP connection. I have not changed the way DCS-BIOS communicates with the network in over a year and I know there are people who are using it successfully on Windows 10. My own development and testing is on Windows 7 at the moment, I still have to upgrade.

Link to comment
Share on other sites

The error is ERR_CONNECTION_REFUSED, which means that no program is listening on port 7778. That means something must go wrong when DCS-BIOS attempts to start the TCP server or it does not even try.

 

I just noticed that BIOSConfig.lua in your post #276 had the TCPServer commented out, which is not the default. Please double check that your BIOSConfig.lua has the following contents (as seen in post #277):

BIOS.protocol_io.connections = {
-- BIOS.protocol_io.DefaultMulticastSender:create(),
BIOS.protocol_io.TCPServer:create(),
-- BIOS.protocol_io.UDPSender:create({ port = 7777, host = "192.168.1.177" }),
BIOS.protocol_io.UDPListener:create({ port = 7778 })
}

 

If you have verified that the TCP server line is not commented out and it still does not work, post the contents of dcs.log again.

Link to comment
Share on other sites

Problem with connect-serial-port

 

(I'm seeing data flowing on the command prompt screen so it appears to be working now. I'll need to look into this a little more to see what was going on. Thanks anyways.)

 

Ian, thanks for all your work on DCS-Bios.

 

This is my first attempt at running it on my computer. I can write sketches to the arduino UNO and I can get DCS-BIOS Control Reference to work where I can see the cockpit data change as the in game cockpit is changing.

 

The problem I am having is when I click on the file "Connect-serial-port", I receive an error message from the command prompt.

 

"The system cannot find the path specified".

 

If anyone can help with getting this to work would be greatly appreciated!!!

 

I included a snapshot of the error screen.

 

 

Thanks,

903924454_errorscreen.thumb.jpg.022c2fcedcdec2edccc0ffd22ee02bd8.jpg


Edited by GSS Rain
Link to comment
Share on other sites

You need to run the script from the original location. It expects the "socat" directory to be in its working directory.

 

You are running the script with "C:\Windows\system32" as the current directory, so it is looking for "C:\Windows\system32\socat\socat.exe", which does not exist.

 

If you simply double click the script in Windows Explorer, it should just work.

 

Are you trying to run it from a command line prompt without first using "cd" to change to the script's directory? Even if you create a shortcut, the working directory will be set correctly by default.


Edited by [FSF]Ian
Link to comment
Share on other sites

Ian, thank you for the reply. When I turned my computer off and rebooted, its back to not working again. I've included some snap pics of what I'm seeing. Now my operating system is Windows 10 located on my "C" drive. Games and other programs I download from the internet I put on my "D" drive. The version of DCS that I have is the Steam version.

 

In Pic 1, I'm using windows explorer to navigate to the folder which has DCS-Bios. If I double left click on "connect-serial-port" I get an error message that is shown in Pic 2. If I right click and select Run as administrator I get a different error message that is shown in Pic 3. When I double left click "connect-serial-port" , it does something because it blocks the Comm Port 3 from talking to the Arduino if I try to upload a new sketch while the command window is still open (shown in Pic 4).

 

I read your post. But not sure how to change active directory in windows explorer. My background is electrical engineering with some programming in assembly language, basic, and fortran from 20 years ago while in college.

 

Also, not sure how I had it working briefly yesterday. I could see data flowing in the command prompt. But all I was doing was trying things like, opening DCS first, then I'd try running connect-serial-port first, opening arduino program at different times, things like that.


Edited by GSS Rain
Link to comment
Share on other sites

You need to extract the ZIP file before you can run the script. Navigate to the ZIP file, then click "Extract all" in the "Extract" tab. Alternatively, install 7-zip (http://7-zip.org) to be able to extract just about any archive type via the right-click context menu. 7-zip is one of those programs I install immediately after reinstalling Windows, along with VLC, Notepad++, Google Chrome, Firefox, Dropbox, GIMP, Inkscape and Steam.

 

In their infinite wisdom, in recent Windows versions (I think starting from Windows 8) Microsoft has decided to call ZIP files "compressed folders" and hide the differences from regular folders from the user. When you double-click the script inside the ZIP file, Windows will extract the script file to a temporary location and run it from there, where it won't be able to find the rest of the files.

 

I'd recommend to go to "View -> Options -> Change folder and search options", select the "View" tab and uncheck "Hide extensions for known file types" -- another change I make immediately after installing Windows.

 

PS: Thanks for the detailed report! I would never have thought of this without being able to spot it in the first screenshot.


Edited by [FSF]Ian
Link to comment
Share on other sites

Thanks for the help Ian.

 

Still no luck yet. I double checked and I was using an extracted uncompressed file (I think WinZip uncompressed it).

 

So I downloaded fresh copy of DCS-BIOS 0.4.2 from Github straight to my desktop. I then downloaded 7-zip version 15.14 and extracted DCS-BIOS straight to desktop. I then ran Arduino , and then ran DCS World and selected A-10C. Once A-10C cockpit was running I then double left clicked connect-serial-port but I still get the same error message.

 

Not sure if there are any debugging tools I could use.


Edited by GSS Rain
Link to comment
Share on other sites

The socat tool in the repo will not work under windows 10. It needs to be recompiled with a newer version of the mingw64.

 

It will emit a warning ("cannot compute FAST_CWD pointer"), but it will still work just fine. I upgraded to Windows 10 on the weekend (did a clean install), and it works despite the warning.

 

 

Thanks for the help Ian.

 

Still no luck yet. I double checked and I was using an extracted uncompressed file (I think WinZip uncompressed it).

When I was writing post #294 I was looking at the third screenshot in post #293, where the error message is "The system could not find the path specified."

 

So I downloaded fresh copy of DCS-BIOS 0.4.2 from Github straight to my desktop. I then downloaded 7-zip version 15.14 and extracted DCS-BIOS straight to desktop. I then ran Arduino , and then ran DCS World and selected A-10C. Once A-10C cockpit was running I then double left clicked connect-serial-port but I still get the same error message.

 

Note that we have seen two different messages so far.

 

The first is "The system cannot find the path specified." This is an error, probably caused by running the script in some unexpected way (e.g. directly from the command prompt without changing the working directory first, or directly from a ZIP file).

 

The other message, seen in the second and fourth screenshots in post #293, is "cannot compute FAST_CWD pointer". This is only a warning, probably about some cygwin internals that the socat program does not even use. Socat is working as intended in those screenshots. If there is still no data being displayed in the console window, this could be caused by a missing "-v" option to socat (but to cause that you would require you to edit the script file), DCS not sending data (not running, DCS-BIOS not installed, mission paused, active pause enabled), or a firewall interfering.

 

If you want to, we can meet up on Skype or TeamViewer to troubleshoot this. Just PM me a time that is convenient for you. I have a very flexible schedule right now because lectures have ended for this semester, so I can probably be there no matter what your time zone is.


Edited by [FSF]Ian
Link to comment
Share on other sites

It has been a while since I encountered problems and it looks like I understood the most important things...

Now, after a few weeks of designing PCBs, etching, soldering and killing a bunch of ICs, I'm sitting in the smell of burned plastic and try to bring the whole thing to life.

 

First test object should be my brandnew AAP (still without Light Plate).

 

While programming a MEGA as a RS-485-Master wasn't (thanks to the examples) a challenge and writing (means: copy and paste) the code for the NANO-Slave also has been done with a finger's click...

...

I'm now a little bit confused:

While I solved the Backlighting with the former version of DCS-BIOS with

if (address == 0x114c) { 
   unsigned int lcpAuxInstValue = (value & 0xffff) >> 0;
   analogWrite(AuxInstBltPin, lcpAuxInstValue/512); // adopt Output to Arduino-PWM-Scale
}	

(example, just reading Potentiometer's position)

where should I insert my code now since

void onDcsBiosWrite(unsigned int address, unsigned int value) {
[i]code code code[/i]
}

is gone?

What did I miss. You caught me completely clueless :cry:

 

List of died stuff:

- one Arduino MEGA

- about 4 AMS1117 with Cs

- 2 MAX487esa

- one PCB grilled by 5 Amps

 

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

What did I miss.

 

Take another look at post #194. It explains the change in the rs-485 branch. onDcsBiosWrite() is gone, instead you would use code like this:

void onLcpAuxInstChange(unsigned int alt) {
   // your code here
 }
DcsBios::IntegerBuffer lcpAuxInst(0x114c, 0xffff, 0, onLcpAuxInstChange);

 

The change was made to adapt to some internal changes and to make accessing integer values more consistent with how string values (i.e. the StringBuffer class) work.

Link to comment
Share on other sites

Thank you, Ian. (delayed, cause it has been late yesterday)

 

Your answer proves my assumption: I do not know anything about nothing. :)

 

To prevent further contamination of this thread with bloody basics: Can You (or someone else) give advise, where a Stupid like me can step in to become able to find the answer him/her self? Maybe a new Thread? For Beginners?

 

In the previous branch of DCS-BIOS I recognized a pattern and I supposed to know what I did.

Now I have to (re)start close to zero to find a similar pattern.

 

Edit:

I am right now at work and without way to test it..

After some thinking and digging I found this solution (maybe):

void onLcpAuxInstChange(unsigned int alt) {
   analogWrite(PIN, alt); // maybe "alt" has to be divided by sth. to get a valid PWM-value
} 
DcsBios::IntegerBuffer lcpAuxInst(0x114c, 0xffff, 0, onLcpAuxInstChange);

Should it really be that simple?

If TRUE: Where get I onLcpAuxInstChange from? Good to know, to enable me (and others) to transpose this to other cases.


Edited by Tekkx

Manual for my version of RS485-Hardware, contact: tekkx@dresi.de

Please do not PM me with DCS-BIOS-related questions. If the answer might also be useful to someone else, it belongs in a public thread where it can be discovered by everyone using the search function. Thank You.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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