avnav icon indicating copy to clipboard operation
avnav copied to clipboard

Directory List for Charts

Open AWeerWolf opened this issue 2 years ago • 15 comments

It would be nice if we can specify list of directories for the charts. This could be useful to put the chart on a separate partition and also share them with OpenCPN.

AWeerWolf avatar Apr 14 '22 15:04 AWeerWolf

Do you talk about the charts that you directly use in AvNav (for o-charts you can already easily share them with OpenCPN)? Currently you can set the chart directory at AVNHttpServer... Something like

<AVNHttpServer>
....
<Directory path="/my/special/folder/for/charts" urlpath="maps"/>
</AVNHttpServer>

Just refer to the existing avnav_server.xml for the current values. You can use the update plugin to edit the config file. But multiple chart dirs are still not possible....

wellenvogel avatar Apr 14 '22 17:04 wellenvogel

Hello,

I did what you suggested : Specify a path for the Maps (on a different partition) There is a mbtiles file in the specified directory. I did restart AVNav server and refresh the web page, but I do not see the map. Any idea ???

By the way, it seems that the ChartHandler is still pointing to the old chart directory.

Regards, uZPBnqZvnkRcVfaO X80CTW0NNtAWEK0V XLOoWl5TRSjQ4XIo cBWvDNt60lwhc6nF

AWeerWolf avatar May 04 '22 18:05 AWeerWolf

Ok, I have to cross check. Basically this is no "official" way of doing it - so not sure if it still works.

wellenvogel avatar May 05 '22 05:05 wellenvogel

Currently the chart dir is determined by the -c paramter when AvNav is started. You could go for a systemd service override to change this. I will have a look if this parameter can be removed in the default set up - this should make the setting from avnav_server.xml working again.

wellenvogel avatar May 12 '22 17:05 wellenvogel

That will be great. Thanks

AWeerWolf avatar May 12 '22 18:05 AWeerWolf

What you can do for now: Create a (systemd) config override with the following commands

sudo mkdir /etc/systemd/system/avnav.service.d
sudo nano /etc/systemd/system/avnav.service.d/zzcharts.conf
sudo systemctl daemon-reload
sudo systemctl restart avnav

When the editor (nano) is open, just insert:

[Service]
ExecStart=
ExecStart=/usr/bin/avnav -q -c /home/pi/avnav/charts2 -b /home/pi/avnav/data -t /usr/lib/avnav/raspberry/avnav_server.xml

Use the path to your chart directory for the "-c" parameter. Import to have both of the ExecStart= lines (the first one with empty parameter)! The name of the file is important to be the last one considered (zzcharts.conf in my example). This will continue to work even if I change the behavior as described later on...

wellenvogel avatar May 13 '22 18:05 wellenvogel

Works great. Just one modification, for the "-t" parameter I used /home/pi/avnav/data/avnav_server.xml

AWeerWolf avatar May 15 '22 18:05 AWeerWolf

Bad idea... -t is the template if the config file at the destination location does not exist. But maybe i missed the last part of the start command - this is the name of the config file ;-(

wellenvogel avatar May 15 '22 18:05 wellenvogel

In /usr/lib/avnav/raspberry is empty except there is only one file : sound.sh

AWeerWolf avatar May 15 '22 18:05 AWeerWolf

Ok, this is for the normal raspberry installation. If it works for you leave it as you have it.

wellenvogel avatar May 16 '22 06:05 wellenvogel

Just an additional info : As the partition containing the charts is not completely mounted when the system try to start the AVNav service, this one fail to auto start. To solve this I did add the following lines to the "conf" file : Restart=on-failure RestartSec=60 StartLimitBurst=3 StartLimitInterval=400

With these lines, the system will try 3 times to start the service and wait 60 sec between each start.

AWeerWolf avatar Jun 05 '22 10:06 AWeerWolf

Would be better to use correct dependencies. AvNav will happily start with an empty chart dir...

wellenvogel avatar Jun 05 '22 11:06 wellenvogel

The chart dir is not empty it just does not exist. (not yet mounted) So i got the following error (in journalctl):

jun 05 13:54:27 Elshina avnav[604]: ERROR: unable to create chart dir /media/pi/Data/Charts/AVNav jun 05 13:54:27 Elshina systemd[1]: avnav.service: Main process exited, code=exited, status=1/FAILURE jun 05 13:54:27 Elshina systemd[1]: avnav.service: Failed with result 'exit-code'. jun 05 13:54:27 Elshina systemd[1]: avnav.service: Service RestartSec=100ms expired, scheduling restart.

AWeerWolf avatar Jun 05 '22 12:06 AWeerWolf

Hello,

I did what you suggested : Specify a path for the Maps (on a different partition)

There is a mbtiles file in the specified directory:

I did restart AVNav server and refresh the web page, but I do not see the map:

Any idea ???

By the way, it seems that the ChartHandler is still pointing to the old chart directory :

Regards,

Le 14-04-22 à 19:06, Andreas Vogel a écrit :

Do you talk about the charts that you directly use in AvNav (for o-charts you can already easily share them with OpenCPN)? Currently you can set the chart directory at AVNHttpServer... Something like

|<AVNHttpServer> .... <Directory path="/my/special/folder/for/charts" urlpath="maps"/> </AVNHttpServer> |

Just refer to the existing avnav_server.xml for the current values. You can use the update plugin to edit the config file. But multiple chart dirs are still not possible....

— Reply to this email directly, view it on GitHub https://github.com/wellenvogel/avnav/issues/209#issuecomment-1099417412, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARWGFBGDOD5BOERLNZXP5A3VFBGAVANCNFSM5TOFELBA. You are receiving this because you authored the thread.Message ID: @.***>

AWeerWolf avatar Oct 11 '22 08:10 AWeerWolf

Just check the log file - it should tell you about the chart dir. And what exactly did you do? Which version, avnav_server.xml,..

wellenvogel avatar Oct 11 '22 09:10 wellenvogel