Jump to content

Recommended Posts

Posted

First off let me say Thanks Ian for the work you do!

 

I have read various threads on this but have not seen a solution that works for me yet. I have a windows 7 machine that everything runs fine on but I am building a new windows 10 A10C cockpit on and cannot get the UDP traffic to communicate.

 

I have no anti-virus running, I have disabled, applied all rules, disabled all rules on my firewall. TCP works great via developers mode on Chrome but cannot get communication via the CMD file. Data flows on it, telling me its reading from DCS, but button pushes do not reflect.

 

Any insight would be greatly appreciated.

 

Thanks

Posted

Are you using an Arduino? If so, can you look at the serial output using the Arduino software to see if it's outputting the proper messages?

Posted

If you cannot get UDP to work, you can also edit connect-serial-port.cmd to sue TCP instead ("set PROTOCOL=TCP") as a workaround. If you do that, you will have to wait until the mission is loaded and unpaused until you start the script.

 

If connect-serial-port.cmd works with TCP but not with UDP, you have a known workaround and can continue to look for the problem that prevents UDP from working. If it does not work with TCP either, the problem is probably not with the network communication towards DCS but with the serial communication towards the Arduino.

Posted

OK, so yes, I am running an Ardiuno Mega 256 for this particular one.

 

If I am correct, if it works in Developers mode via Chrome, that means it is working TCP. And it is indeed working in developers mode.

 

I will not be home until Friday to test changing to TCP, but would much rather get UDP working if possible. I will post results on editing the .cmd file for TCP after Friday when I get home.

 

Thanks for replies

  • 3 weeks later...
Posted

So I guess I was wrong, TCP is not working either. Chrome develop page works but the arduino does not communicate with DCS, even starting cmd during gameplay like suggested.

Button pushes register in the command window but there is no dcs communication either udp or tcp.

Posted

Regnad,

 

are you using a 3rd party firewall (like something from a security package)?

If that's the case, be aware that disabling the 3rd party firewall may automatically enable the Windows firewall. This may be old news, but I thought it might be worth to mention.

 

Cheers,

Stefan

Posted

Yeah its frustrating me badly. No 3rd party firewalls or virus protection here. Its a machine I built strictly for DCS.

 

I'm actually unsure if I am describing my issue correctly so gonna break it down again better.

 

So, for testing purposes, I have a simply uno with 1 button for Tacan test.

When I run cmd at the desktop, and push the button, I get feedback

ie. date, numbers, length from x to x, etc..

 

when I then run dcs bios, the cmd window goes to town like it is supposed to, number flying everywhere.

 

But when I push the button, it does not reflect within DCS.

 

As I stated, works great on my windows 7 machine.

 

Either way, thanks for all the help.

Posted (edited)

Interesting, I get backwards question marks

 

Is that a baud issue and if so how do I rectify. All the settings I can find are at 9600

 

I did have a hell of a time getting a driver for the Uno on Windows 10

 

Edit: So when I change the baud in serial monitor to 250000 i get the proper output, not sure how to modify it on system though?

Edited by Regnad517
Posted
Maybe stupid question but it is DCS running and unpaused when you are starting connect-serial-port.cmd(my painful experience :doh:)??? I am currently testing my panels also on machine with windows 10 without problems, there was no need to touch firewall setup.

 

Actually no, I was under the impression that only needed to be done when running tcp rather than Udp. Will try that soon

Posted

Well now I don't know if I'm upset or relieved.

 

I tried running cmd after dcs started and unpaused but no luck, that only needs to be down when using TCP I'm pretty sure. I did notice all of a sudden that cmd was laggy. So I reuploaded to the arduino double checking all of my settings, then ran again starting cmd before DCS and it works perfectly.

 

I'm one of those people that wants to know how I fixed it, and here I have no clue but guess I will run with it.

 

Thanks for all the help to anyone that viewed this thread. Keep doing what you're doing, great stuff!!

Posted

Well I guess I spoke a little too soon but I did find out EXACTLY what to ask this time. Might make a new thread in case this one gets overlooked thinking it is resolved. So here is what is happenning.

 

If I boot up, run the cmd file - doesn't work

BUT

If I open arduino, run the serial monitor, set baud to 250000 and test, then run cmd, works great.

 

So what can I alter to let it run without having to monitor the serial every time?

 

Thanks

Posted
Well I guess I spoke a little too soon but I did find out EXACTLY what to ask this time. Might make a new thread in case this one gets overlooked thinking it is resolved. So here is what is happenning.

 

If I boot up, run the cmd file - doesn't work

BUT

If I open arduino, run the serial monitor, set baud to 250000 and test, then run cmd, works great.

 

So what can I alter to let it run without having to monitor the serial every time?

 

Thanks

 

Open a command prompt, execute the following command (replacing COM1 with some COM port that exists on your system) and post the result:

 

mode COM1 BAUD=250000 PARITY=N DATA=8 STOP=1 TO=off DTR=off

That command is used by connect-serial-port.cmd to set the baud rate. It's probably failing for some reason.

Posted (edited)

OK - So running the mode command made it work but after a reboot it wouldn't work again so I added it to the .cmd file and now all is great

 

Thanks Ian

Edited by Regnad517
Posted

well now Im wondering if I am an idiot and was supposed to edit that line for the com port?

 

this is the text from the original

@echo off

REM Specify the COM port number to connect to in the following line.

REM If set to the default value of ASK, the script will ask you to type it in each time.

set COMPORT=6

 

REM Set PROTOCOL to "TCP" if UDP does not work for you. When using TCP,

REM you have to start the script after you have started the mission and the simulation

REM has been unpaused, otherwise the connection will fail ("Connection refused").

set PROTOCOL=UDP

 

set VERBOSE=-v

set MODE_OUTPUT_REDIR=CON

if "%1" == "/Q" (

set VERBOSE=

set MODE_OUTPUT_REDIR=NUL

shift

)

 

if not "%1" == "" set COMPORT=%1

if "%COMPORT%" == "ASK" set /p COMPORT=Enter a COM Port Number:

 

set /A TTYNUM=%COMPORT%-1

if "%MODE_OUTPUT_REDIR%" == "NUL" echo Connecting to COM port %COMPORT%

mode COM%COMPORT% BAUD=250000 PARITY=N DATA=8 STOP=1 TO=off DTR=off > %MODE_OUTPUT_REDIR%

timeout 2

if "%PROTOCOL%" == "UDP" socat\socat %VERBOSE% UDP4-RECV:5010,ip-add-membership=239.255.50.10:0.0.0.0,reuseaddr!!udp-sendto:localhost:7778 /dev/ttyS%TTYNUM%

if "%PROTOCOL%" == "TCP" socat\socat %VERBOSE% TCP4-CONNECT:127.0.0.1:7778 /dev/ttyS%TTYNUM%

 

 

pause

 

Doesnt work with that

 

BUT works with this

 

@echo off

REM Specify the COM port number to connect to in the following line.

REM If set to the default value of ASK, the script will ask you to type it in each time.

set COMPORT=6

mode COM6 BAUD=250000 PARITY=N DATA=8 STOP=1 TO=off DTR=off

 

REM Set PROTOCOL to "TCP" if UDP does not work for you. When using TCP,

REM you have to start the script after you have started the mission and the simulation

REM has been unpaused, otherwise the connection will fail ("Connection refused").

set PROTOCOL=UDP

 

set VERBOSE=-v

set MODE_OUTPUT_REDIR=CON

if "%1" == "/Q" (

set VERBOSE=

set MODE_OUTPUT_REDIR=NUL

shift

)

 

if not "%1" == "" set COMPORT=%1

if "%COMPORT%" == "ASK" set /p COMPORT=Enter a COM Port Number:

 

set /A TTYNUM=%COMPORT%-1

if "%MODE_OUTPUT_REDIR%" == "NUL" echo Connecting to COM port %COMPORT%

mode COM%COMPORT% BAUD=250000 PARITY=N DATA=8 STOP=1 TO=off DTR=off > %MODE_OUTPUT_REDIR%

timeout 2

if "%PROTOCOL%" == "UDP" socat\socat %VERBOSE% UDP4-RECV:5010,ip-add-membership=239.255.50.10:0.0.0.0,reuseaddr!!udp-sendto:localhost:7778 /dev/ttyS%TTYNUM%

if "%PROTOCOL%" == "TCP" socat\socat %VERBOSE% TCP4-CONNECT:127.0.0.1:7778 /dev/ttyS%TTYNUM%

 

 

pause

 

Note the addition of the line at top after SET

Posted

Ok, that's really weird. You shouldn't have to edit anything -- the %COMPORT% will be replaced by the value in the COMPORT variable, which is 6.

 

Maybe it makes a difference that the mode command is now called twice?

Maybe the second mode command acts as a delay and prevents some kind of race condition?

I can only guess at the reason why this works, but I am glad you found a workaround.

Posted

Yeah works great. I even now have the multiple cmd script running working 2 panels currently. Thanks again. I’m sure this isn’t the last question I will have for this is all new to me but fascinated me.

  • 11 months later...
Posted

WHEN I TRY TO CONNECT DCS WITH DCS BIOS REFERANCE

"Unchecked runtime.lastError while running sockets.tcp.connect: net::ERR_CONNECTION_REFUSED"

 

 

"chrome.sockets.tcp.connect(socketId, peerAddress, peerPort, function(result) {"

 

AS SHOW THE PICTURE ATTACEHS

I USE WINDOWS 10

2.thumb.png.de2225c3094068a0a62845a70a35542d.png

812020201_Sanstitre.thumb.png.9e6bb90c6fc67a0dfcd72d67da5cc8fb.png

  • Recently Browsing   0 members

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