Board index FlightGear Support Interfacing

Windows 10 serial COM port access denied

Connecting two computers, using generic protocol, connecting with Matlab?

Windows 10 serial COM port access denied

Postby ScottBouch » Thu Dec 05, 2019 11:14 pm

Hi all,

Just trying FGFS on W10 as my Linux box has died.

I have an Arduino Due based hardware setup, that connects to FGFS via serial / generic protocol. This works well under Linunx.

I can use the Arduino IDE to successfully download the .ino config to my board on serial port COM9, and the serial-monitor works fine, seeing my stick and throttle analogue parameters.

When trying to use FGFS though, it fails to communicate with the board, and the log file contains this error:

Error opening serial device "COM9" Access is denied

Code: Select all
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:93:Parse I/O channel request: generic,serial,out,30,COM9,9600,due-sim
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:104:  protocol = generic
network:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Network\generic.cxx:761:Reading communication protocol from Path "C:/Program Files/FlightGear 2018.2.2/data/Protocol/due-sim.xml"
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:238:  medium = serial
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:242:  direction = out
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:247:  hertz = 30
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:258:  device = COM9
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:262:  baud = 9600
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:93:Parse I/O channel request: generic,serial,in,30,COM9,9600,due-sim
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:104:  protocol = generic
network:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Network\generic.cxx:761:Reading communication protocol from Path "C:/Program Files/FlightGear 2018.2.2/data/Protocol/due-sim.xml"
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:238:  medium = serial
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:242:  direction = in
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:247:  hertz = 30
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:258:  device = COM9
io:3:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:262:  baud = 9600
io:5:C:\Jenkins\workspace\Windows-release\simgear\simgear\serial\serial.cxx:88:Error opening serial device "COM9" Access is denied.


io:5:C:\Jenkins\workspace\Windows-release\simgear\simgear\io\sg_serial.cxx:57:Error opening device: COM9
io:5:C:\Jenkins\workspace\Windows-release\flightgear\src\Network\generic.cxx:644:Error opening channel communication layer.
io:5:C:\Jenkins\workspace\Windows-release\flightgear\src\Main\fg_io.cxx:365:I/O Channel config failed.


I have tried unplugging and re-plugging the USB lead between using Arduino IDE and FGFS as there have been comments over ownership of the port, also tried rebooting the machine in between.

These are my FGFS arguments:
--httpd=8080
--generic=serial,out,30,COM9,9600,due-sim
--generic=serial,in,30,COM9,9600,due-sim

I've also tried using \\.\COM9 that I read about on another post somewhere (but I'm unsure what the \\.\ does).

Is this just another nail in the "already well nailed" coffin for Windows?

Cheers, Scott.
User avatar
ScottBouch
 
Posts: 75
Joined: Wed Jun 22, 2016 3:14 pm
Location: Midlands, UK
OS: Manjaro,Mint,Ubuntu.

Re: Windows 10 serial COM port access denied

Postby wkitty42 » Fri Dec 06, 2019 1:05 pm

i can't tell but it almost looks like the second connection to COM9 is being rejected... like the port is opened in exclusive mode...

isn't there a 3rd style (?) with out and in to do both at the same time? in-out or both or something like that? then one line would be used for both in and out...

eg: --generic=serial,both,30,COM9,9600,due-sim

i've never done it or had a need to but i've seen others discussing it in these forums in the recent past... again, though, i'm not sure of the 3rd word to be used besides "in" and "out" on those generic protocol lines...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5987
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Windows 10 serial COM port access denied

Postby ScottBouch » Sun Dec 08, 2019 12:12 am

Hi, thanks for that - yes I've not tried s "both" option as I couldn't find it documented so went for "in" and "out" separately which works fine under Linux.

Regarding 2 way comms, neither are working on this Windows 10 setup. I can't control FGFS or drive my indicators from FGFS..
User avatar
ScottBouch
 
Posts: 75
Joined: Wed Jun 22, 2016 3:14 pm
Location: Midlands, UK
OS: Manjaro,Mint,Ubuntu.


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 1 guest