Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 16-01-2013, 18:40   #91
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: OpenCPN Beta Version 3.1.1309 Released

Hakan....

vspe has, IMHO, a design flaw.

It seems to not properly recognise programmed serial port timeouts according to the Windows API documentation.

So, OCPN works around this flaw when detected by closing and re-opening the serial port. This is the two second "pause" you notice occasionally. And the byte counters get reset in the process.

I don't think that this is the root cause of your trouble, though.

Dave
p.s. any vspe developers lurking here are welcome to comment....
__________________

__________________
bdbcat is online now   Reply With Quote
Old 16-01-2013, 18:49   #92
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: OpenCPN Beta Version 3.1.1309 Released

Hakan....

From the above, you might imagine that I don't exactly trust vspe. Correct.

Looking at the UDP option:

When you are on the boat, you have "no ip". I guess that means you have your system set up for DHCP address loading, and there is no DHCP server "on the boat".

What happens if you set a static ip, and use that one for the UDP addressing. Just choose something like 192.168.x.y, set it in the Network Control Panel, and set O to use that address for UDP from O to O-p.
Should work.

I'm not sure why O (or windows) fails using 127.0.0.1 if there is no true address assigned, but we have heard this before. Network gurus chime in here.

Dave
__________________

__________________
bdbcat is online now   Reply With Quote
Old 16-01-2013, 19:53   #93
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave...
VSPE; thanks that could be a fair cause. I'll do some more runs to stress it, see below.
IP; Yes I've thought of a static address to test if local host, 127.., is not working. That will be next test.

The actual status:
No hangs with a single O. Also I've been running O and O-p together for 6-7 hours! No hangs until now. And I may have trace. I could be that O is sensitive to users inability to let things alone. While the two Os was running I made a quick look in opencpn.log belonging to the primary O. After that O was hanged! And I won't blame it for that. Since no one told the pgm to shout when the user couldn't let its files live in piece while running it's fair to get stuck and hang.
And all the incidents before?? Well it could be that I was in the same jam-pot then as well. That's because I've been hunting for charts with errors. Not so that I let the log open but more made a quick copy to use for tracing. That could have been enough disturbance to force the hanging?
I closed explorer shoving O's files and restarted to see what happened. Well, it hanged nearly direct. Grrr... So I restarted the PC and is now running again. I will leave it there and go back to bed. Was just up for a short lav visit and couldn't resist to have look.

Thanks Håkan
__________________
Hakan is online now   Reply With Quote
Old 17-01-2013, 00:55   #94
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave...
Approx. six hours later... Still running. This is probably not more a task. Sorry to bother you but many thanks for the lovely chat. Next is to try the local host setup. Maybe without me touching O's files?

Håkan
__________________
Hakan is online now   Reply With Quote
Old 17-01-2013, 10:33   #95
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
Re: OpenCPN Beta Version 3.1.1309 Released

Following Hakan path I run the program this afternoon on the boat with the AIS/GPS connected and after an hour and a half punctual at 17.00 the crash happened.
The 16.30 entry went well without any hick-up.
The corresponding Logbook entry is in the log, the file shows a last modification at 17:00 in the file system, but then the program seems not to come back.

The system event log shows the crash of opencpn at 17.00:42 - Windows will need some time to state that a program does not answer anymore, I suppose.
Ther are no additional details though.

I did open the logfile in between trying to provoke a crash but without "success".

Any idea what to test next?

Hubert
__________________
bcn is online now   Reply With Quote
Old 17-01-2013, 15:20   #96
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: OpenCPN Beta Version 3.1.1309 Released

bcn...

What exactly are your port datastream configurations?

Dave
__________________
bdbcat is online now   Reply With Quote
Old 17-01-2013, 17:05   #97
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave, bcn...

After my last posts I've had a couple of hangs, still using the same set up as yesterday. I'm not at all sure but my suspicions are still connected to write access to the OpenCPN directory where the log and ini files residues. Earlier today O was hanged when I was handling files in a subdirectory to opencpn. After that additional one or twice hangs occur without known interactions.
Another action earlier today was I noticed that the opencpn directory was included in a cloud backup. That is that every change to a file is copied to a server. If this copying occurs when O want to print to a file it may cause a hang? Anyhow I excluded that directory from the cloud backups. I'm not sure if this backup where active yesterday when O was running for a long uninterrupted time

After that I've been away six hours or so and all was alive when I came back.

All those possible causes seems a bit far fetched but I have nothing better to try an I'll continue searching. Any opinion or comments?

Håkan
__________________
Hakan is online now   Reply With Quote
Old 17-01-2013, 17:27   #98
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave..
Got a hang up now. I was downloading a file from the web to a directory far from opencpn using firefox??? I didn't touch O.
__________________
Hakan is online now   Reply With Quote
Old 17-01-2013, 18:31   #99
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: OpenCPN Beta Version 3.1.1309 Released

Hakan...

Do you ever sleep? What tz are you?

I am studying and debugging the Windows serial port code again.

One obvious point that we both missed:
If the TCP AIS data from Frisco comes in at an effective data rate of more than about 500 character per second, then there is no way a vspe port set to 4800 baud can ship all of that data intact to O-p.

And this is what causes the freeze. O is stuck in a syncronization loop trying to jam too much data down a 4800 baud pipe. The comm stuff takes precedence over the UI updates, so O appears to be non-responsive.

I'm in the process of fixing that hang point now, trying to see how fast a comm port needs to be to absorb all of the Frisco feed. Pretty fast....

In general, though, using vspe to share data locally is a bad idea. Lots of overhead. UDP is much better.

vspe is probably fine for sharing a single GPS input line among multiple O's.

So, mostly understood. What remains:
"Why will localhost UDP not work on Windows if the ethernet port has no assigned address? Is this a known Windows bug?"

Googling on this leads to some pretty deep ratholes. Still studying, but I think it may remain a mystery. Network gurus chime in here....

So, the solution for you (and others) is to set your ethernet port to some static address and carry on.

New code in github master late tonight.

Dave
__________________
bdbcat is online now   Reply With Quote
Old 18-01-2013, 00:20   #100
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
Re: OpenCPN Beta Version 3.1.1309 Released

Quote:
Originally Posted by bdbcat View Post
bcn...

What exactly are your port datastream configurations?

Dave
Completely standard:
serial on COM29 (USB-->COM from the AIS)@38400, No output, no filters


Hubert
__________________
bcn is online now   Reply With Quote
Old 18-01-2013, 03:05   #101
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave..
Thanks for caring. Tz is Z -1 and yes I sleep but sometimes it's hard falling into it. The pleasure is I'm not forced to everyday working for money any more and learn adapting to that kind of life. Slowly succeeds.

About the congestion between the fast input and slow output. Yes I was into that and once tried with 38400 but don't remember the result now. And when in the boat the data feed is the 4800 GPS and the 38400 AIS and certainly no IP network. But ok I agree with your VSPE doubts for many reasons not less the overhead you mentioned. I'll leave that and put strength on network broadcasting instead, where I once started this.

And a thought: Ozi as an example has the opportunity to have two windows open inside a single instance. One is a the chart overview where the position of the boat can be shown That I used with the mission having both overview and detailed windows open. Without stressing you for new art works, do you know how that programming is made? But I think that's totally a different case with Ozi's "simple" approach showing one raster chart at the time and no vectors?

I'll keep you informed
Håkan
__________________
Hakan is online now   Reply With Quote
Old 18-01-2013, 14:59   #102
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

Dave..
A whole days running with local broadcasting using 127.0.0.1 as senders address. No big problems but it can be trying to establish contact between primary O and secondary O-p. O is stable and that's what's important. To get the O-p find its source I have to restart it, sometimes several times, or trig the communication to start by simulate edit the port field and hit "use" button. Once the data stream is established its stable.
I tried to make the network cards IP addresses static but it wasn't a hit.
When there is no network connection Windows don't see any IP-address. That's why I stuck to 127.0.0.1

When a network connection is established the most stable configuration is to use a wide IP address, 192.168.x.x for the sender.

Some shots attached.

Now ending this task until next beta/program issue and test it live with the boat. This boring winter may come to an end, the faster the better.
Attached Thumbnails
Click image for larger version

Name:	print_screen.jpg
Views:	74
Size:	109.7 KB
ID:	53067   Click image for larger version

Name:	Sender_conf.jpg
Views:	72
Size:	89.5 KB
ID:	53068  

Click image for larger version

Name:	receiver_conf.jpg
Views:	71
Size:	69.8 KB
ID:	53069  
__________________
Hakan is online now   Reply With Quote
Old 19-01-2013, 16:39   #103
Registered User

Join Date: Oct 2012
Location: Brighton, UK
Boat: Westerly Oceanlord
Posts: 374
Re: OpenCPN Beta Version 3.1.1309 Released

Quote:
Originally Posted by bdbcat View Post
"Why will localhost UDP not work on Windows if the ethernet port has no assigned address? Is this a known Windows bug?"
I could be way off here but...

Is the report that the loopback interface works fine when there's an IP address on the ethernet interface but not when there isn't, or simply that people are using the loopback when there is no IP address on the ethernet interface and they are finding that it isn't working?

If you're using 127.0.0.1, that's not a broadcast address. In fact I don't know anything about windows, but on many platforms the loopback won't have a broadcast address. A unicast packet will only be delivered to one socket even though you've specified SO_REUSEADDR and have multiple sockets listening on the same port. If you're trying to get multiple instances of OpenCPN listening on the same port on 127.0.0.1 it's possibly not going to yield the results you want.

I could be wrong :-)
__________________
muttnik is offline   Reply With Quote
Old 20-01-2013, 01:49   #104
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 1,968
Re: OpenCPN Beta Version 3.1.1309 Released

muttnik..
Without having enough knowledge of these things I beyond others used 127.0.0.1 as a test to find a way to communicate within a standalone PC without an assigned IP address. It mostly works but not in a reliable way as you can see from earlier posts in this matter. If you are able to hint other ways to test I'll be most happy to try it.
__________________
Hakan is online now   Reply With Quote
Old 20-01-2013, 06:50   #105
Registered User

Join Date: Oct 2012
Location: Brighton, UK
Boat: Westerly Oceanlord
Posts: 374
Re: OpenCPN Beta Version 3.1.1309 Released

Sadly my windows knowledge is minimal and I don't even have a compiler for windows. If I was going to test anything I would try using an address of 127.255.255.255, but "localhost" does not necessarily behave like a "normal" interface address and I suspect the loopback interface may not even be broadcast capable.

Can you confirm that using 127.0.0.1 *does* work fine if the ethernet port has an address? Or is it just that 127.0.0.1 never works reliably, but you only *try* to use it when no address is assigned to the ethernet interface?

If the former I'd think "feature" over "bug": Possibly something to do with routing (ie assigning an IP address to an external interface makes that the "preferred" interface, but this is windows implementation dependent and therefore opaque to me)

As was previously suggested, assigning a static IPv4 address to the ethernet interface and specifying the *broadcast* address associated with that address in your OpenCPN config would be what I'd try next, but this doesn't seem to have worked for you. ie: if you assign 192.168.128.2/24 as your IP address, specify 192.168.128.255 for your opencpn data connection

The workaround for 2 instances of opencpn if none of this works and you have software which creates virtual com ports is to do it with a couple of com ports at a sufficiently high baud rate.

I still wouldn't be expecting a unicast udp packet to be received by multiple sockets
__________________

__________________
muttnik is offline   Reply With Quote
Reply

Tags
opencpn

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 12:20.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.