Cruisers Forum
 


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 13-09-2022, 19:22   #1
Registered User

Join Date: Sep 2022
Posts: 4
autostart plugins

hey team,
did a search but couldn't find what i wanted, please forgive me if this has been answered previously

is there a way to auto-start plugins? specifically the VDR datalogger,

I'm trying to use this to create new polars so we need it to be recording data whenever its on.

the Polar addin also doesn't start automatically which is fine, but if there is a way for this to automatically start logging data that would also be acceptable.

any other data logging ideas (must be able to poll a TCP/IP, not USB/COMM) would also be appreciated.

thanks in advance
WasabiAus88 is offline   Reply With Quote
Old 14-09-2022, 11:35   #2
Registered User

Join Date: Nov 2015
Location: Ireland
Posts: 467
Re: autostart plugins

Are you using Windows, Pi, Mac or Android?
AedanC is offline   Reply With Quote
Old 14-09-2022, 12:41   #3
Registered User

Join Date: Sep 2022
Posts: 4
Re: autostart plugins

Heya
Ha sorry the one obvious key bit of information.

Windows 10 on a pc.

Pc turns on automatically when we switch on instrumentation. Launching opencpn is done through a startup script.

Looking for how to get vdr (or other) to start recording nmea data automatically

Thanks much
WasabiAus88 is offline   Reply With Quote
Old 15-09-2022, 14:39   #4
Registered User

Join Date: Mar 2011
Posts: 650
Re: autostart plugins

All plugins that are enabled in OpenCPN are loaded.
Whether the plugin actually does anything when it is loaded or whether some other action is required is defined by the plugin itself. As you have noticed, the VDR Plugin only starts recording once the "VDR Record" toolbar button is pressed.

There is another thread regarding the file save options for VDR, where it might be possible for whoever is writing the fix, to also contemplate adding an auto start feature, although be careful what you wish for, you never know when your hard drive may become full!

In the meantime a quick & dirty workaround if you really want to log data from OpenCPN whenever it starts is to define an outbound UDP network connection and at the same time run something else to log the data. On Windows this can be done with a simple Powershell script.

The outbound connection is created similar to the attached screen capture:

And here is an example Powershell script:
Code:
$Logfile = [Environment]::GetFolderPath("MyDocuments") + "\vdr-"+(Get-Date).toString("yyyy-MM-dd-HH") + ".txt"
$Port = 2947 #OpenCPN Default UDP Port
$Endpoint = New-Object System.Net.IPEndPoint ([IPAddress]::Any, $Port)
$Socket = New-Object System.Net.Sockets.UdpClient $Port
$Socket.Client.ReceiveTimeout = 100
try {
  for() {
    try  {
     
      $Buffer = $Socket.Receive([ref]$EndPoint)
      $TextReceived = [System.Text.Encoding]::ASCII.GetString($Buffer)
      Write-Host $TextReceived
      Out-File -Append -InputObject  $TextReceived -FilePath $Logfile -Encoding ascii -NoNewline
    }
    catch [System.Net.Sockets.SocketException]  {
      if ( $_.Exception.SocketErrorCode -ne 'TimedOut' )  {
        throw
      }
    }

    if ( [System.Console]::KeyAvailable ) {
      $x = [System.Console]::ReadKey($true)
      if ( $x.key -eq [System.ConsoleKey]::F12 )  {
        Write-Host 'Exit with F12'
	 $sp.close
        break
      }
    }
  }
}
finally {
  $Socket.Close()
}
You could be really fancy and filter the NMEA 183 data (boat speed, wind speed & angle) and export it as a CSV file for analysis & plotting with something like Excel.
Attached Thumbnails
Click image for larger version

Name:	udp-outbound.png
Views:	37
Size:	30.9 KB
ID:	264567  
stevead is offline   Reply With Quote
Old 15-09-2022, 15:41   #5
Registered User

Join Date: Sep 2022
Posts: 4
Re: autostart plugins

Steve, you're a legend! thank you!
WasabiAus88 is offline   Reply With Quote
Reply

Tags
plug, plugin


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
Installateur de plugins, Install software for plugins. Gilletarom OpenCPN 3 30-04-2013 05:57
Plugins for OpenCPN: How to Install ? amadeus Navigation 3 27-01-2011 08:13
Building Plugins in 2.3.0 JonPan OpenCPN 0 18-12-2010 14:48
Translation for Plugins SethDart OpenCPN 1 08-10-2010 07:19
Some Thoughts About the Plugins (Structure) Netsurfer OpenCPN 5 02-08-2010 14:30

Advertise Here


All times are GMT -7. The time now is 13:37.


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.