Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 22-01-2020, 06:34   #1
Marine Service Provider
 
ManekiNeko's Avatar

Join Date: May 2018
Location: Baltic sea coast
Posts: 6
OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Dear OpenCPN developers!

I am Yacht Devices tech support engineer.
Recently we have received several issue reports for our YDNU-02 USB gateway.

It seems openCPN 5 can not open virtual COM port of our USB device on Windows 10.

I suppose it is a possible duplicate of the issues reported at "flyspray" (FS#2595 and FS#2642) for other USBserial devices.

The bug can be reproduced only on Windows 10, Windows 7 works fine.


Here is my test setup:

Windows 10 Pro x64
OpenCPN version is 5.0.0+9065270
YDNU-02 is visible in "Device Manager" as "STMicroelectronics Virtual COM Port" COM3.

To reproduce an issue:

- connect YDNU-02 to NMEA 2000 network and PC USB port
- reboot the PC
- start OpenCPN
- connect OpenCPN to the YDNU-02 virtual COM port
- no data received by OpenCPN (NMEA Debug Window empty and YDNU-02 LED indication shows the port is not open from a PC)


In opencpn.log I can see

4:33:48 AM: Opening NMEA Datastream Serial:COM3

but no further messages for COM3 port present.

It is possible to use a workaround mentioned in FS#2595:

- disable COM port connection in OpenCPN or close OpenCPN
- start PUTTY and connect to YDNU-02 virtual COM port
- observe valid NMEA 0183 data stream in PUTTY terminal window, also YDNU-02 LED indication shows that the port was open from a PC
- close PUTTY
- start OpenCPN
- connect OpenCPN to the YDNU-02 virtual COM port
- valid data received by OpenCPN, (NMEA Debug Window shows valid sentences and YDNU-02 LED indication shows the port was opened from a PC).

I can see the FS#2595 was in "assigned" state for rater long time, but no progress was made on the issue so far.

Please, tell me if you plan to investigate an issue further and if I can help you to debug the issue.
Maybe there is a possibility to record an extended openCPN log?

Thank you.
ManekiNeko is offline   Reply With Quote
Old 22-01-2020, 06:52   #2
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

ManekiNeko


Years ago I have been in the device production myself and I guess the poor quality of STMicroelectronics chips has not changed til then. Try to use the FTDI chips for your devices. They are far better and their drivers always works well.
CarCode is offline   Reply With Quote
Old 22-01-2020, 08:01   #3
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Quote:
Originally Posted by ManekiNeko View Post
Dear OpenCPN developers!



I am Yacht Devices tech support engineer.

Recently we have received several issue reports for our YDNU-02 USB gateway.



It seems openCPN 5 can not open virtual COM port of our USB device on Windows 10.



I suppose it is a possible duplicate of the issues reported at "flyspray" (FS#2595 and FS#2642) for other USBserial devices.



The bug can be reproduced only on Windows 10, Windows 7 works fine.





Here is my test setup:



Windows 10 Pro x64

OpenCPN version is 5.0.0+9065270

YDNU-02 is visible in "Device Manager" as "STMicroelectronics Virtual COM Port" COM3.



To reproduce an issue:



- connect YDNU-02 to NMEA 2000 network and PC USB port

- reboot the PC

- start OpenCPN

- connect OpenCPN to the YDNU-02 virtual COM port

- no data received by OpenCPN (NMEA Debug Window empty and YDNU-02 LED indication shows the port is not open from a PC)





In opencpn.log I can see



4:33:48 AM: Opening NMEA Datastream Serial:COM3



but no further messages for COM3 port present.



It is possible to use a workaround mentioned in FS#2595:



- disable COM port connection in OpenCPN or close OpenCPN

- start PUTTY and connect to YDNU-02 virtual COM port

- observe valid NMEA 0183 data stream in PUTTY terminal window, also YDNU-02 LED indication shows that the port was open from a PC

- close PUTTY

- start OpenCPN

- connect OpenCPN to the YDNU-02 virtual COM port

- valid data received by OpenCPN, (NMEA Debug Window shows valid sentences and YDNU-02 LED indication shows the port was opened from a PC).



I can see the FS#2595 was in "assigned" state for rater long time, but no progress was made on the issue so far.



Please, tell me if you plan to investigate an issue further and if I can help you to debug the issue.

Maybe there is a possibility to record an extended openCPN log?



Thank you.
@ManekiNeko

I am willing to help debug but i don’t have a Yacht device to test. Here are a few questions:

When Putty connects does it automatically send some character to the USB port? OpenCPN expects the serial device to just send text as soon as the port is opened. There is no timeout if no data is received. Is it possible that the device needs to receive a character before it starts sending data on the transmit channel? Perhaps Putty sends a carriage return or some other character when it opens the port and the device sees that as an indication to start streaming.

OpenCPN assumes a USB device is the same as a plain RS-232 port at the application layer. Some USB navigation devices need to receive a character or special string to trigger the start of data streaming.
transmitterdan is offline   Reply With Quote
Old 22-01-2020, 08:24   #4
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

This issue has been reported with a number of USB devices (but I don't know about chipsets) with OpenCPN 5. In all cases that I know about the devices used to work in 4.8.x, so some change in the way 5 deals with com ports (at least virtual ones).

In some testing using various terminal software it appeared that the com ports in question required some combination of DTR/CTS/RTS to be set before they would start data flow, and it also appeared that OpenCPN doesn't do that when opening the com port. I did find a method (not reliable) with O of setting the "Output on this port" and "Garmin" flags that got O to raise the pins on the com ports and got data flowing. Sometimes it seemed to work and sometimes it didn't. That was as far as I got since I wasn't working in code itself and didn't have access to multiple devices for testing.

Just throwing it out there in case it saves some time.
Dsanduril is offline   Reply With Quote
Old 22-01-2020, 09:16   #5
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Quote:
Originally Posted by Dsanduril View Post
This issue has been reported with a number of USB devices (but I don't know about chipsets) with OpenCPN 5. In all cases that I know about the devices used to work in 4.8.x, so some change in the way 5 deals with com ports (at least virtual ones).
Correct, the developers have changed the serial com port software part in version 5.0 to an opensoftware library they have found in the internet. Before version 5.0 these functions have been more related to the operating system. The change have been done without need and was obviously not tested enough. Anyone interested can check Serial by wjwwood
CarCode is offline   Reply With Quote
Old 22-01-2020, 09:55   #6
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Dsanduril...
re:
"This issue has been reported with a number of USB devices (but I don't know about chipsets) with OpenCPN 5."


From your previous investigation, do you recall exactly which devices had trouble on O5?


Dave
bdbcat is online now   Reply With Quote
Old 22-01-2020, 10:20   #7
Registered User
 
Dsanduril's Avatar

Join Date: Aug 2011
Location: Petersburg, AK
Boat: Outremer 50S
Posts: 4,229
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Quote:
Originally Posted by bdbcat View Post
Dsanduril...
re:
"This issue has been reported with a number of USB devices (but I don't know about chipsets) with OpenCPN 5."


From your previous investigation, do you recall exactly which devices had trouble on O5?


Dave
Sorry, that information's on the boat, I currently am not, and my memory is quite fallible. None of them were my devices, was helping other folks. Do remember well that using RealTerm I could control the state of the handshaking bits and that I could get the same thing to happen - connect to port but get no data - by opening the port with all of the handshaking off. And could then trigger data by setting the handshaking bits high.

Also ran O 5 into a virtual com port that was connected to RealTerm and watched what O did to to the handshaking bits - nothing - when opening the port. I could play back recorded NMEA over that port and O was quite happy.

In the end, IIRC, the fix was to use GPSGate Splitter (or one of several other com port sharing tools). That seemed to open the ports OK and then O dealt with new virtual ports just fine.

Bottom line, it seemed that some of the virtual ports out there wanted handshaking and it wasn't present.

I do have to caution that while I play with serial comms nearly every day I could be completely off base and this could be a red herring - I was only looking in from the outside and trying to figure out a problem.
Dsanduril is offline   Reply With Quote
Old 22-01-2020, 11:51   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,401
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Dsanduril...
OK, thanks for the info.
As usual, if we could lay hands on an offending device, the OCPN core source solution would come in due course. But, as is the nature of these things, all my devices work fine...
Dave
bdbcat is online now   Reply With Quote
Old 23-01-2020, 08:26   #9
Marine Service Provider
 
ManekiNeko's Avatar

Join Date: May 2018
Location: Baltic sea coast
Posts: 6
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Dear forum members!

First of all, thank you for your fast replies.

@CarCode

Quote:
Years ago I have been in the device production myself and I guess the poor quality of STMicroelectronics chips has not changed til then. Try to use the FTDI chips for your devices. They are far better and their drivers always works well.
Sorry, but we can not fix the problem this way.

@transmitterdan

Quote:
When Putty connects does it automatically send some character to the USB port?
I do not think so.

Quote:
Is it possible that the device needs to receive a character before it starts sending data on the transmit channel?
No, our device does not expect any COM-port input to start the data transmission.


@Dsanduril

Quote:
In some testing using various terminal software it appeared that the com ports in question required some combination of DTR/CTS/RTS to be set before they would start data flow, and it also appeared that OpenCPN doesn't do that when opening the com port.
I suppose you are close to the truth.

Quote:
I did find a method (not reliable) with O of setting the "Output on this port" and "Garmin" flags that got O to raise the pins on the com ports and got data flowing.
With those setting the situation gets worse: OpenCPN debug window shows that it outputs data to the port, but it shows no received data, device LED indication shows there is no COM port connection.

Quote:
In the end, IIRC, the fix was to use GPSGate Splitter (or one of several other com port sharing tools). That seemed to open the ports OK and then O dealt with new virtual ports just fine.
I confirm that this solution works, tested it with VSPE (virtual serial port emulator).
However, I find it more elegant to just write a .bat file which opens the port with PuTTy, closes it and then starts OpenCPN.

@bdbcat

I have received your PM, and will contact you via an email.



Thank you!
ManekiNeko is offline   Reply With Quote
Old 23-01-2020, 08:57   #10
Registered User

Join Date: Jan 2018
Location: Belgium
Boat: Raider 18 Cuddy
Posts: 68
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

I have YDNU-02 om my boat
I output AIS to the port
Input is GNSS and compass data from a Raymarine AR200, Honda engine etc...

It works, but i have a very old W10 version 1607 on the boat.
Never did update because change of breaking oeSENC charts.
Its never online, so no problem.....

I will test if this stops working when disabling the output on the port
Ben S is offline   Reply With Quote
Old 23-01-2020, 09:03   #11
Registered User
 
TheOffice's Avatar

Join Date: Jun 2012
Location: Annapolis
Boat: Hylas 49
Posts: 1,125
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

I'm not a tech guy, but I do have a YD working with my OpenCPN in windows 10.
Sorry if these seem too basic.

Do you see the data in the browser?
Did you go to settings/plugin and enable the Dashboard and set the preferences?
TheOffice is offline   Reply With Quote
Old 23-01-2020, 10:49   #12
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,740
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Quote:
Originally Posted by Ben S View Post
It works, but i have a very old W10 version 1607 on the boat.
Never did update because change of breaking oeSENC charts.
Its never online, so no problem.....
If a W10 update invalidates the oeSENC license and we see this from the system identifier files we will repair the license.
No reason not to update - there might other reasons not to update W10, I admit...
bcn is offline   Reply With Quote
Old 24-01-2020, 11:54   #13
Registered User

Join Date: Jan 2018
Location: Belgium
Boat: Raider 18 Cuddy
Posts: 68
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

I can confirm the YDNU-02 port is not opened by openCPN
I disabled output to the port, and there is no input.
Enable output, and the input is working again.

Ben S is offline   Reply With Quote
Old 17-02-2020, 09:57   #14
Registered User

Join Date: Jan 2018
Location: Belgium
Boat: Raider 18 Cuddy
Posts: 68
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

Is there a fix already fot this?
Ben S is offline   Reply With Quote
Old 17-02-2020, 18:01   #15
Registered User

Join Date: Nov 2019
Posts: 39
Re: OpenCPN 5 can not connect to USBserial device (virtual COM port) in Windows 10

I discovered the issue with OC 5 and USB Serial comms last fall when trying to integrate a Maretron USB100 gateway. Same issue where it wouldn't open a USB serial port. I eventually abandoned that style of connection, instead creating a virtual tcp connection with the USB input via gpsgate. Had I been smarter, I would have avoided Maretron entirely, favoring the Yacht Devices hardware which now represents a majority of my NMEA2k network. You guys have great hardware and even better customer support. I think using USB serial is temporarily not an option with OC, but frankly it works better over multiple devices to just use the YDWG-02 wifi gateway so that any device on the network can share the data.

AA
AboardAdventurer is offline   Reply With Quote
Reply

Tags
enc, opencpn, serial, wind


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opencpn not accepting NavmonPC virtual port? Franziska OpenCPN 10 14-06-2019 15:27
OpenCPN not engaging virtual port Flicka_1977 OpenCPN 4 10-10-2018 18:17
Native Virtual Com Port integration with OpenCPN Peter McNamara OpenCPN 0 27-08-2014 00:16
OpenCPN not recognising Virtual COM port LifePart2 OpenCPN 92 24-04-2014 10:08
OpenCPN does not see STM32 virtual port in MAC OSX GREENGHOST OpenCPN 9 24-02-2014 12:40

Advertise Here


All times are GMT -7. The time now is 06:00.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.