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 23-01-2014, 17:49   #16
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Old Log will be moved to opencpn.log.log

PHD...
And could we finally have a look at the contents of the logfile?

Pavel
nohal is offline   Reply With Quote
Old 23-01-2014, 17:55   #17
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Old Log will be moved to opencpn.log.log

BTW, looking at you script, opencpn has no -TL command line switch, and if an invalid switch is given, it does just print a list of the valid ones and terminates.
So either you don't use a standard build and someone crafted it to do something with this switch or I don't believe it starts with the first script neither...

Pavel
nohal is offline   Reply With Quote
Old 23-01-2014, 18:10   #18
Registered User

Join Date: Jan 2014
Posts: 13
Re: Old Log will be moved to opencpn.log.log

First page 1 put a link to the log file. And the list loads fine. Again im taking this project over and im new at all of this
PHD1026 is offline   Reply With Quote
Old 23-01-2014, 18:13   #19
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Old Log will be moved to opencpn.log.log

PHD...
Sorry, all I get on that link is a 404 not found error...

Pavel
nohal is offline   Reply With Quote
Old 23-01-2014, 20:39   #20
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,463
Re: Old Log will be moved to opencpn.log.log

PHD....

What Pavel said. The log should not grow like you describe.

May we see a small sample of it, say a few hundred lines from the bottom?

Also, FYI, Beta version 3.3.1303 has an auto timeout on the "log.log" message. It will go away automagically in 5 seconds without user input.

Good Luck
Dave
bdbcat is offline   Reply With Quote
Old 24-01-2014, 05:59   #21
Registered User

Join Date: Jan 2014
Posts: 13
Re: Old Log will be moved to opencpn.log.log

Ahh BDBCAT, thats the answer I was looking for.

The actual log I wanted you guys to take a look at is located on the vessel which I do not have have access to at this time. I'll post it as soon as it returns. I'll try upgrading in the meantime.
PHD1026 is offline   Reply With Quote
Old 27-01-2014, 06:09   #22
Registered User

Join Date: Jan 2014
Posts: 13
Re: Old Log will be moved to opencpn.log.log

Quote:
Originally Posted by nohal View Post
Code:
#!/bin/sh
reboot -n
placed in /etc/cron.daily
Just out of curiosity, could you please have a look into the log and tell us what's filling it?

Pavel
Pavel

Thank you for all of your help. As I am a newbe at this stuff I need some help on the reboot process. What time will this reboot?
PHD1026 is offline   Reply With Quote
Old 27-01-2014, 06:13   #23
Registered User

Join Date: Jan 2014
Posts: 13
Re: Old Log will be moved to opencpn.log.log

Quote:
Originally Posted by cagney View Post
The opportunities in Linux are endless.......

There is no need to reboot for a simple thing like this.
Just make an executable file containing



and make sure you start OpenCPN through this script.

OpenCPN runs just fine without a logfile. No warnings etc, and if something goes wrong, you will have no idea what happened.
Of course you could always start O the conventional way, in case of trouble.

Alternatively ... start OpenCPN as usual, and just delete opencpn.log manually. Same result.

Thomas

Thomas,

Thank you for the help however this does not really apply. There is no one every watching this screen nor is there even a mouse or keyboard connected to the PC. It just start and auto loads Open CPN to the Vessel List view. We record the VGA output as a way of recorded AIS.

I like the idea of rebooting the PC at noon each day and it auto deleting the log file. Just not sure how to set that up on the OS.
PHD1026 is offline   Reply With Quote
Old 27-01-2014, 06:58   #24
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Old Log will be moved to opencpn.log.log

PHD...
This solution is a bit brutal, but if you really want to use it:
Code:
cat /etc/crontab
Will give you something like
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
It means that on my machine the daily cron jobs are executed at 04:02AM
BTW, I had a look at your website. In case you are trying to integrate OpenCPN into your boxes, you should probably invest that tiny bit of time into modifying the code not to expect user interaction where it's totally counterproductive in your case - The changes will be minimal and you won't have to care about stuff like this (For example getting rid of that log rotation dialog completely means commenting out 1 line of code).
Anyway, still waiting for the log to see what fills it up...

Pavel
nohal is offline   Reply With Quote
Old 27-01-2014, 08:20   #25
Registered User

Join Date: Jan 2014
Posts: 13
Re: Old Log will be moved to opencpn.log.log

The issue with the log filling up really only happend once every 3 weeks onboard the vessel. However I can not give you that log as it is "On the Vessel" and unavailable at this time.

Nohal I sent you a private message.
PHD1026 is offline   Reply With Quote
Old 17-05-2015, 05:54   #26
Registered User
 
marinux's Avatar

Join Date: Dec 2010
Location: Kourou French Guiana South America
Boat: Trismus 37'
Posts: 98
Re: Old Log will be moved to opencpn.log.log

Hola PHD1026,

I have also this problem. After insert filters in NMEA Data, every sentence is logged and the file grow inconsiderabily. So I have cooked a little launcher for OCPN. Optionnaly it deactivate SDR module (since Ubuntu 14.04) to use rtl_sdr plugin.

Code:
#!/bin/sh

# opencpn.sh
# launcher for opencpn rtlsdr plugin and log
# to use rtl_fm, dvb module must be deactivated
# sudo has no password in Xinutop, use gksudo in others cases
# filters on NMEA in/out grow inconsiderabily log file
# this script limit the size to 1MB (ajustable)
# marinux 2015

# debug
#set -x

# unload integrated module to use rtl libs, 
(lsmod | grep -q dvb_usb_rtl28xxu) && sudo rmmod dvb_usb_rtl28xxu

# optional, for last log, suppress user notification
[ -e ~/opencpn.log ] && mv -f ~/opencpn.log ~/opencpn.log.log

# optional, reduce write access on static storages, /tmp is on ramdisk
[ -e /tmp/ocpn-${USER}.log ] || touch /tmp/ocpn-${USER}.log
[ -h ~/opencpn.log ] || ln -s /tmp/ocpn-${USER}.log ~/opencpn.log

# launch
opencpn &

# scan log size during ocpn session life
run_ocpn="1"
while [ -n "$run_ocpn" ]; do
   # 1MB maxi, change the path if you don't use tmp 
   size=$(du --threshold=-1MB /tmp/ocpn-$USER.log)
   if [ -z "$size" ]; then
      # raz log
      echo >/tmp/ocpn-${USER}.log
   fi
   sleep 5
   run_ocpn=$(pgrep -x "opencpn")
done

# optional, for tmp only, save the last log if possible
[ -e /tmp/ocpn-${USER}.log ] && mv -f /tmp/ocpn-${USER}.log ~/opencpn.log
 
# reload module
(lsmod | grep -q dvb_usb_rtl28xxu) || sudo modprobe dvb_usb_rtl28xxu

exit
__________________
Cordialement
Frank Marinux
FY4PS
marinux is offline   Reply With Quote
Old 19-05-2015, 13:01   #27
Registered User
 
marinux's Avatar

Join Date: Dec 2010
Location: Kourou French Guiana South America
Boat: Trismus 37'
Posts: 98
Re: Old Log will be moved to opencpn.log.log

After some reflexion, this last script is a little rough. A more elegant solution is scanning, cutting and keeping the last n lines from the log flow.
Code:
#!/bin/sh

# launcher for opencpn rtlsdr plugin and log
# to use rtl_fm, dvb module must be deactivated
# sudo has no password in Xinutop, use gksudo in others cases
# filters on NMEA in/out grow inconsiderabily log file
# this script limit the lines to 100
# global variables in majuscules
# local variables in minuscule
# marinux 2015

# debug
set -x

# for 100 lines
nb_lgn=100


# unload integrated module to use rtl libs, 
(lsmod | grep -q dvb_usb_rtl28xxu) && sudo rmmod dvb_usb_rtl28xxu

# optional, for last log, suppress user notification
[ -e ~/opencpn.log ] && mv -f ~/opencpn.log ~/opencpn.log.log

# optional, reduce write access on static storages, Xinutop /tmp is on ramdisk
[ -e /tmp/ocpn-${USER}.log ] || touch /tmp/ocpn-${USER}.log
[ -h ~/opencpn.log ] || ln -s /tmp/ocpn-${USER}.log ~/opencpn.log

# launch
opencpn &

# keep n lines during ocpn session life
run_ocpn="1"
while [ -n "$run_ocpn" ]; do
   # modify path and log name if you don't use /tmp
   msg=$(tail -n ${nb_lgn} /tmp/ocpn-${USER}.log)
   echo "${msg}" >/tmp/ocpn-${USER}.log
   sleep 5
   run_ocpn=$(pgrep -x "opencpn")
done

# optional, for tmp only, save the last log
[ -e /tmp/ocpn-${USER}.log ] && mv -f /tmp/ocpn-${USER}.log ~/opencpn.log
 
# reload rtl module
(lsmod | grep -q dvb_usb_rtl28xxu) || sudo modprobe dvb_usb_rtl28xxu


exit
__________________
Cordialement
Frank Marinux
FY4PS
marinux is offline   Reply With Quote
Reply

Tags
enc, opencpn


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


Advertise Here


All times are GMT -7. The time now is 02:34.


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.