Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-02-2012, 09:36   #31
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Pavel..

I have many extra icon files in the 'usericons' directory where the .ini file is also located. I have had them a long time and they are all valid .xpm type.

You may find this attachment of AIS Dispatcher interesting from a diagnostics point of view. I am at the moment saving a larger file of nmea messages for testing purposes.

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_01 Feb. 08 14.26.jpg
Views:	73
Size:	129.0 KB
ID:	37124  
__________________

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 08-02-2012, 14:57   #32
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: AIS Targets Disappear After a Longer Period

OK, the idea to throw the ais data at OCPN did not work out the way I thought it would. As a quick test I tried the following:

# mkfifo /dev/ais
# chmod a+rw /dev/ais
$1 cat AISDATA.txt > /dev/ais
$2 opencpn -> define /dev/ais as AIS source in config tab, close opencpn
$2 restart opencpn
data not consumed from fifo, check logs:
22:12:00 CET: NMEA Data Source is....Serial:/dev/rfcomm4
22:12:00 CET: AIS Data Source is....Serial:/dev/ais
22:12:00 CET: AIS tty input device isatty() failed, retrying open()... /dev/ais
22:12:00 CET: AIS tty input device isatty() failed on retry, aborting. /dev/ais

It appears opencpn insists on data source being a tty, which is a good thing in normal operation, but prevents this simple replay approach.

Had this worked, I would have written a short script throwing a line from logged ais data at opencpn every second or so, alas no go.

Will try to think about a workaround if time permits.

Marius
__________________

__________________
mrm is offline   Reply With Quote
Old 08-02-2012, 17:08   #33
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Marius..

Thanks for the effort...I wish there were other Vista users in the same situation to prove the point.

The loss of ALL AIS targets after a period is not of immediate danger to the safety of my armchair but there may be other similar situations at sea which could prove fatal.

So,please keep up the good work and I'll do MY bit testing your creations.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2012, 05:47   #34
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Although not AIS related, there seems to be many problems with this new version...

The additional Mark information POI's do no longer work. I have created literally hundreds of these POI's around the world so far and I would be VERY pixxxd-off to loose them.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2012, 06:08   #35
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
Re: AIS Targets Disappear After a Longer Period

Tore...
could you please post some of your GPX files that are "broken" by opencpn for me to test the solution for the next beta. It's most likely due to them being malformed XML, but anyway I have a workaround prepared for the next beta that I would like to test on something not totally artificial.

Thanks

Pavel
__________________
nohal is online now   Reply With Quote
Old 09-02-2012, 09:24   #36
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Pavel..

But the icons are in .xpm format not .gpx?

BUT,I have many POI files in .gpx which loads automatically from the 'layers' directory but these are not graphic file (9) as listed in the logfile.

I've managed to get the POI's to work again after a lot of tribulations,first trying to de-install 2.6 which left a lot of files behind which I did not have permission to delete? (I AM the admin) I then tried to re-install 2.5 on top of the old OpenCPN directory but again was refused access.

Frustrated,I then created a new installation of 2.5 in a different directory,after which nothing worked because of the changed paths. De-installed again but a lot of files remained I was NOT allowed to delete.

By this time I was tearing my hair out.. and finally recaptured the deleted files from the paperbin for 2.6. Now it would not recognize my AIS port 5 and only after re-booting Vista did it finally re-appear.

I re-created the user installed 'layers' and 'UserIcons' directories and filled them up with backup copies of my icons and poi's.

Happily,most things now seem to work,but we probably still have the AIS problems as discussed earlier.

Sorry, but I just had to get it off my chest....

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2012, 09:46   #37
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,018
Re: AIS Targets Disappear After a Longer Period

Tore...
In your last post you wrote:
Quote:
The additional Mark information POI's do no longer work.
I would appreciate having some of these POIs with additional info you've created as I think you made a little mistake which I better work around in the code as probably many others will do the same...

Sorry about your problems - once you get rid of Vista, you will get a bit happier, at least I did

Pavel
__________________
nohal is online now   Reply With Quote
Old 09-02-2012, 10:11   #38
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Pavel..

You can download the POI .gpx files from this directory:
4shared folder - FINAL .GPX FILES

I attach a sample of a .kml file which is the base for the .gpx file.

All the POI's are created/edited in Google Earth and saved in .kml format.
I then use Paul's CE2GPXKML converter to create the .gpx poi's

I am using my own 'info' icon for the poi's,contained in my UserIcons directory.

They have worked perfectly and also now in v. 2.6 after re-installation.

Tore
Attached Files
File Type: kml BRAZIL-POIS-X.kml (9.8 KB, 37 views)
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2012, 10:35   #39
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,248
Re: AIS Targets Disappear After a Longer Period

I downloaded and tested UK.gpx, and found no problems, the additional info for Lands End and Cowes worked OK for example.

Thomas
__________________
cagney is offline   Reply With Quote
Old 09-02-2012, 11:22   #40
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Thomas..

All my .gpx poi's are working like they should under v. 2.6 and Vista.
My previous problem was a path problem caused by altering between v 2.5 and 2.6.

Thanks for testing.

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 09-02-2012, 15:51   #41
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

Very random behavior of v. 2.6 AIS messages.

This time the AIS targets did not ALL disappear,but are all somehow marked invalid.

I have set the AIS configuration to mark lost targets after 20 min and delete them after 30 min. I have been away for 2 hours this time and it is still showing as attached.

Tore
Attached Thumbnails
Click image for larger version

Name:	Screenshot_02 Feb. 09 20.45.jpg
Views:	66
Size:	101.3 KB
ID:	37163  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 11-02-2012, 04:12   #42
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: AIS Targets Disappear After a Longer Period

OK, as promised I looked into a testing workaround and coded a small utility which creates a virtual terminal (from OCPN perspective it is equivalent to a virtual serial port) and feeds it with a data from a text file - one line a second. Developed and tested with Linux.

Here is the source code:
Code:
// ttyfeed.c - feed text data from a file to a virtual terminal
#define _XOPEN_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>

int main(int argc, char *argv[]) 
{
  int ttymaster, datafile;
  FILE *datafd;
  char *line = NULL;
  size_t len = 0;
  ssize_t read = 0;

  if (argc != 2) {
    printf("missing argument\n");
    printf("usage: %s file\n", *argv);
    exit(0);
  }     

  if ((datafile = open(argv[1], O_RDONLY)) == -1) {
    printf ("failed to open %s\n", argv[1]);
    exit(1);
  }

  if ((ttymaster = posix_openpt(O_RDWR|O_NOCTTY)) == -1) {
    perror("ptty open failed\n");
    exit(1);
  } else {
    printf("name of tty slave is: %s\n", ptsname(ttymaster));
    grantpt(ttymaster);
    unlockpt(ttymaster);
    printf("ttyfeed online\n");
  }

  if ((datafd = fdopen(datafile, "r")) == NULL) {
    close(ttymaster);
    perror("fdopen");
    exit(1);
  }

  printf("configure input as needed and press enter");
  getline(&line, &len, stdin);

  while((read = getline(&line, &len, datafd)) != -1) {
    printf("%zu bytes: %s", read, line);
    write(ttymaster, line, read);
    fsync(ttymaster);
    sleep(1);
  }

  if(line) free(line);

  printf("data feed finished\n");
  close(ttymaster);
  close(datafile);

  return 0;
}
To compile, save it to a ttyfeed.c file and run:
Code:
$ gcc ttyfeed.c -o ttyfeed
Run it with a full path to a text file containing logged AIS data as an argument:
Code:
$ ./ttyfeed /path/to/data/ais_log_file.txt
The program will display the name of a virtual terminal and wait for enter key press.
Code:
$ ./ttyfeed ais.txt 
name of tty slave is: /dev/pts/2
ttyfeed online
configure input as needed and press enter
Put the displayed name (/dev/pts/2 in this example) into OCPN as AIS port, save config, press enter and enjoy :-)
Attached Thumbnails
Click image for larger version

Name:	aisreplay.jpg
Views:	68
Size:	77.6 KB
ID:	37243  
Attached Files
File Type: doc ttyfeed.zip.doc (3.1 KB, 29 views)
__________________
mrm is offline   Reply With Quote
Old 11-02-2012, 04:22   #43
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Re: AIS Targets Disappear After a Longer Period

mrm...

That sounds GREAT! But,not being a programer,I have no idea how to compile the thing into something my Vista and I can handle.

As far as I understand,the final product becomes a program you execute and will create a new virtual COM: port which I configure in the AIS section of OCPN.

Could you compile it for me so I can download it?

Great job!

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 11-02-2012, 04:27   #44
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,248
Re: AIS Targets Disappear After a Longer Period

mrm

Are you aware of the VDR, voyage data recorder, plugin?
PlugIns | Official OpenCPN Homepage
Quote:
Save NMEA stream to a file.
Replay NMEA stream previously saved.
Thomas
__________________
cagney is offline   Reply With Quote
Old 11-02-2012, 04:29   #45
mrm
Registered User

Join Date: Feb 2011
Location: Poland, EU
Boat: crew on Bavaria 38 Cruiser
Posts: 651
Re: AIS Targets Disappear After a Longer Period

Tore, sorry, I haven't been developing for windows platform for ages so I cannot help you here. This is for POSIX compliant systems...
But, with this utility, other users and developers using Linux (and probably Mac) can test your AIS data with their installs. I hope this will help verify your problem.

Marius
__________________

__________________
mrm is offline   Reply With Quote
Reply

Tags
ais

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with AIS taku OpenCPN 4 03-10-2014 10:17
AIS Unit for Raymarine Chartplotter System mukilteomaniac Marine Electronics 4 23-01-2012 02:06
New SiiTech AIS Reporting System For Yachts sinbad7 Marine Electronics 36 05-08-2011 07:51
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 05:31
AIS Reception Issue twistedtree Marine Electronics 72 03-07-2011 04:57



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 07:48.


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.