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 24-06-2019, 11:25   #16
Registered User

Join Date: Jun 2019
Location: Reunion
Boat: Plastic Galapagos43
Posts: 14
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

dear rgleason,

Many thanks to you for your valuable recommendations.
I looked at the methods of compiling Opencpn plugins under linux, and thanks to your different links, I managed to compile the latest version of watchdog (2.4) and install it. Since then, all my alarms work perfectly (I salute the extraordinary work of Seandepagnier at the same time !!). I regret at the same time the lack of responsiveness ubunbtu deposits that left me to think that I had a current version of the plugin(1.9043)
Although Linux allows its users to go deep into the details and configuration, it must still have the right information!
Thank you again for your perseverance and dedication
Sincerely
kinefou
kinefou is offline   Reply With Quote
Old 24-06-2019, 11:48   #17
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,700
Images: 2
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

kinefou,


Congratulations. I am acting like a sponge right now, getting into linux. How did you do it? If you can remember, please give me the blow by blow description. What would I have to do to do the same compilation? What is the final result we are looking for? Thanks!


I am going to try it in my WSL Ubuntu18.04LTS installation.


Thanks
Rick



Quote:
Originally Posted by kinefou View Post
dear rgleason,

Many thanks to you for your valuable recommendations.
I looked at the methods of compiling Opencpn plugins under linux, and thanks to your different links, I managed to compile the latest version of watchdog (2.4) and install it. Since then, all my alarms work perfectly (I salute the extraordinary work of Seandepagnier at the same time !!). I regret at the same time the lack of responsiveness ubunbtu deposits that left me to think that I had a current version of the plugin(1.9043)
Although Linux allows its users to go deep into the details and configuration, it must still have the right information!
Thank you again for your perseverance and dedication
Sincerely
kinefou
rgleason is offline   Reply With Quote
Old 25-06-2019, 02:34   #18
Registered User

Join Date: Jun 2019
Location: Reunion
Boat: Plastic Galapagos43
Posts: 14
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Hi Rick, I was strongly inspired by the site: https://opencpn.org/wiki/dokuwiki/do...ompiling_linux First of all, you have to prepare the computer for this compilation by installing the tools and libraries:
Code:
$ sudo apt-get install build-essential cmake gettext git-core gpsd gpsd-clients libgps-dev wx-common libwxgtk3.0-dev libglu1-mesa-dev libgtk2.0-dev wx3.0-headers libbz2-dev libtinyxml-dev libportaudio2 portaudio19-dev libcurl4-openssl-dev libexpat1-dev libcairo2-dev libarchive-dev liblzma-dev libexif-dev libelf-dev libsqlite3-dev
When all this is installed, he clone the git of OpenCPN:
Code:
$ git clone git: //github.com/OpenCPN/OpenCPN.git
In the created OpenCPN folder, we find a plugin folder in which we copy Sean's program (watchdog_pi-master, which I renamed watchdog_pi). Then you have to create a build folder in the OpenCPN folder
Code:
$ cd OpenCPN // # if you are not already at this location.//
Code:
$ mkdir build
Code:
$ cd build
Code:
$ cmake ../plugin/watchdog_pi
[CODE$ make[/CODE]

After a long time of compilation, we can install the plugin with:
Code:
sudo make install
If all went well, we will find version 2.4 of watchdog in Opencpn. I tested under Linux mint 19 and raspberry (raspbian) and it works without problems. At your disposal in case you have problems. cordially
kinefou
kinefou is offline   Reply With Quote
Old 25-06-2019, 02:41   #19
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Hi,

The current implementation relies on a gps input being available for working out angles and locations of the guard zone when checking if an AIS target is in the zone. So if you are not providing a GPS input then this particular alarm will not work.


I have attached a VDR file which I have used for testing.


Regards
Jon



Quote:
Originally Posted by kinefou View Post
Thank you very much for your interest.
When reading your post, I find that decidedly, this alarm works as expected!
Yet at home, nothing to do!
I followed your instructions to the letter, I placed my boat on the road of a moving cargo ship, but no alarm is triggered when it enters my guard zone.
Note that my boat has no gps (so I can move it at will), but I think it is georeferenced by opencpn!
On the other hand, you use version 1.5 of OD, but what is the watchdog? Under windows, it is the version 2.04 (and that works very well!), But under linux, it is the version 1.9042 (can be an incompatibility at this level?).
It would be very nice of you to send me your Vdr file and tell me if your boat needs a GPS or if its only position on the map is enough to operate the alarms (for zone alarms, it works very well under linux so on raspberry!): only the guard zones pose a problem.
cordially
kinefou
Attached Files
File Type: pdf vdr-2016-04-04-Duinwich-to-Myora.txt.zip.pdf (267.8 KB, 39 views)
jongough is offline   Reply With Quote
Old 25-06-2019, 03:38   #20
Registered User

Join Date: Jun 2019
Location: Reunion
Boat: Plastic Galapagos43
Posts: 14
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Hi Jon, Thank you for your answer and your VDR file which works very well. I solved the problem under linux by compiling the latest version of watchdog (2.4) instead of 1.9043 presented as the latest version in the Ubuntu repository. Curiously, it works without GPS, because the geolocation of the boat in Opncpn is enough for alarms. Sincerely kinefou
kinefou is offline   Reply With Quote
Old 25-06-2019, 05:57   #21
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

A little info on a raspberry pi running openplotter, to compile watchdog >

Check all the dependencies are there >

Code:
 sudo apt-get install build-essential cmake gettext git-core gpsd gpsd-clients libgps-dev wx-common libwxgtk3.0-dev libglu1-mesa-dev libgtk2.0-dev wx3.0-headers libbz2-dev libtinyxml-dev libportaudio2 portaudio19-dev libcurl4-openssl-dev libexpat1-dev libcairo2-dev libarchive-dev liblzma-dev libexif-dev libelf-dev libsqlite3-dev
In an empty directory, get the code >
Code:
git clone git://github.com/seandepagnier/watchdog_pi.git
Make a build directory and go there >
Code:
cd watchdog_pi/
  sudo mkdir build
  cd build
  ls
Compile >
Code:
sudo cmake ../
  sudo make
 sudo make install
Compiling puts the plugin in a different directory than the place opencpn lives is installed as opposed to compiled, so backup the old plugin and move the new one >
Code:
sudo cp /usr/lib/opencpn/libwatchdog_pi.so /usr/lib/opencpn/libwatchdog_pi.so.bak
 sudo cp /usr/local/lib/opencpn/libwatchdog_pi.so /usr/lib/opencpn/libwatchdog_pi.so
The draw plugin wasn't installed and wouldn't install with apt-get install so compiled that as well from here, same steps as above>
git clone https://github.com/jongough/ocpn_draw_pi.git

Works, but..... complains about no plugin icons and the watchdog boundery alarm setup window has the OK button off the bottom of the screen so you can't click on it, workaround is tab until the 'graphicas enabled' checkbox is highlighted then press tab 3 more times then return.
Apart from that seems to work OK, which is good - mighty handy singlehanding

EDIT> This seems to get the icons in the right place ..
Code:
 sudo cp -r /usr/local/share/opencpn/plugins/* /usr/share/opencpn/plugins
conachair is offline   Reply With Quote
Old 25-06-2019, 08:23   #22
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,700
Images: 2
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

@conachair,
Thank you for the instructions for standalone build of plugins!

@kinefou,
Thank you for the instructions for OpenCPN inline build of plugins!
I believe there are a couple of commands before

$ cmake ../plugin/watchdog_pi
that are needed to clone or download watchdog to some location. What are those commands and what is the right directory location for linux?

Thank you for taking the time to educate me.
rgleason is offline   Reply With Quote
Old 25-06-2019, 09:10   #23
Registered User

Join Date: Jun 2019
Location: Reunion
Boat: Plastic Galapagos43
Posts: 14
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

hi Rick, It was enough to place me in my / home directory before launching the command git clone. The cloning is done in a subfolder placed in the folder where the command is launched (in / home in the example). We go to this directory to create a directory 'build' in which we place oneself. From here we launch the cmake commands, then make, then make install and everything goes well. conachair seems to say that the plugin is not placed in the right place (/ usr / local / lib instead of / usr / lib and that we have to move the libwatchdog.so file obtained with the commands it describes ( move libwatchdog_pi.so from / usr / local / lib / opencpn to / usr / lib / opencpn /). I took his advice into account because he is certainly better at Linux than I am, but without this manipulation, it was already working. I hope that answers your question cordially kinefou
kinefou is offline   Reply With Quote
Old 25-06-2019, 09:59   #24
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,700
Images: 2
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Ok, kinefou,

I think I understand. You're git clone directory is
/home/ and the plugin lands in /home/[plugin_name] .


(I think this is a standalone build)
So from /home/ you execute
  • $ git clone [https://github.com[user]/[plugin_name].git
  • which makes a new folder /home/[plugin_name]
  • $ cd [plugin_name]
  • $ sudo mkdir build
  • $ cd build
  • $ls
  • Then don't you copy opencpn.lib into build ?
  • $ sudo make ../
  • $ sudo make
  • $ sudo make install
  • $ sudo cp /usr/lib/opencpn/libwatchdog_pi.so /usr/lib/opencpn/libwatchdog_pi.so.bak
  • $ sudo cp /usr/local/lib/opencpn/libwatchdog_pi.so /usr/lib/opencpn/
Now I am a little confused about the built location of the *.so file. Is this indeed where it is found?
I understand it does not matter much which directory the plugins are located in
  • / usr / local / lib / opencpn
  • / usr / lib / opencpn / <--Preferred location
The above is a standalone compile!
How would you do an inline compile like the internal plugins?
Wouldn't you

  • $ sudo cd /usr/lib/opencpn/plugins/
  • $ git clone [https://github.com[user]/[plugin_name].git
  • and then just build opencpn again normally from
  • $ sudo cd /usr/lib/opencpn/build?
  • $ cmake ../
  • $ sudo make install
Note: I seem to have to use "cmake". Inline build is working fine. Very nice that linux has compiler built in!
rgleason is offline   Reply With Quote
Old 25-06-2019, 14:50   #25
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Hi,
My mistake, looking at it further OCPN sends through the lat/lon of the boat but all the rest of the GPS information is either null or zero if there is no gps input. OD takes the lat/lon in this case and makes the heading and cog 0. So it does work as you found.



Regards
Jon


Quote:
Originally Posted by kinefou View Post
Hi Jon, Thank you for your answer and your VDR file which works very well. I solved the problem under linux by compiling the latest version of watchdog (2.4) instead of 1.9043 presented as the latest version in the Ubuntu repository. Curiously, it works without GPS, because the geolocation of the boat in Opncpn is enough for alarms. Sincerely kinefou
jongough is offline   Reply With Quote
Old 25-06-2019, 14:59   #26
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Hi,
The location of the files for a plugin is setup in cmake. You need to ensure you set the correct "CMAKE_INSTALL_PREFIX", i.e. the command would be:


cmake -DCMAKE_INSTALL_PREFIX=/usr ..


This will make it look in /usr/lib, /usr/share, etc.


or


cmake -DCMAKE_INSTALL_PREFIX=/usr/local


This will make it look in /usr/local/lib, /usr/local/share, etc.



For debugging it has to be setup so that it looks in the correct location for the debugging version of OCPN.


Regards
Jon
jongough is offline   Reply With Quote
Old 25-06-2019, 16:34   #27
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,700
Images: 2
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Quote:
..looking at it further OCPN sends through the lat/lon of the boat but all the rest of the GPS information is either null or zero if there is no gps input. OD takes the lat/lon in this case and makes the heading and cog 0. So it does work as you found.
Jon, Is there a way to send a signal with no GPS when there is none, (or just to not send it) which would not require a change in the API? Just an idea, that I have not thought through.
rgleason is offline   Reply With Quote
Old 25-06-2019, 21:53   #28
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

Rick,
I am not quite sure what you are asking. The GPS information is provided by OCPN through its call the the plugin SetPositionFixEx proceedure. The JSON API for guard zones and AIS only receives the Lat/Lon of the AIS target and the GUID of the guard zone to check. The 'GPS' Lat/Lon is used to centre the guard zone i.e. the boat position.


Regards
Jon
jongough is offline   Reply With Quote
Old 26-06-2019, 05:07   #29
Registered User

Join Date: Jun 2019
Location: Reunion
Boat: Plastic Galapagos43
Posts: 14
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

@rgleason, reply to your post # 24: On Linux, you do not have to copy opencpn.dll to the build folder (however, you have to do it on Windows, as explained in the Sean installation file). After, you have to send the command cmake ../ (not 'make') Then 'make' Then 'sudo make install'. This for a standalone compilation. I think the inline compilation should be the one you describe, adding a 'make' after the 'cmake ../plugin/watchdog_pi' but I do not have the time on weekdays to try it. Otherwise, it must be possible to download the Opencpn source code, add the watchdog plugin to the sources and recompile everything. But I can not be sure of all this before having tried it on a blank system., My knowledge in linux being still basic! cordially kinefou
kinefou is offline   Reply With Quote
Old 26-06-2019, 07:52   #30
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,700
Images: 2
Re: Pb with draw-watchdog under openplotter 1.2 and Opencpn 5.0.0

That seems pretty clear to me now.

I was thinking the gps heading 0 & cog null/0 caused an null/O failure. I guess that is incorrect.
rgleason 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Watchdog for OpenCpn doublebubble OpenCPN 5 07-10-2022 09:19
OpenCPN (via openplotter) slow on RaspPi3 Foeboat OpenCPN 49 16-03-2020 18:23
Problems with opencpn-watchdog under linux kinefou Marine Electronics 0 10-06-2019 11:02
OpenCPN - OpenPlotter - KPlex - RPi - CPU Maxed Out Dsanduril OpenCPN 8 26-09-2018 10:44
Using openplotter & opencpn on a 60 feet SAR boat? Flod Marine Electronics 2 28-04-2016 13:18

Advertise Here


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


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.