Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-02-2010, 06:59   #1
Registered User

Join Date: Feb 2010
Posts: 10
Portable OpenCPN

Hello,

I try to run OpenCPN as Portable in my PEN.

It works, but saves the configuration on the PC, and this is not a Portable Application!

Why the configuration can't be saved in the same folder as the applecation?
And for Portabillty the Path to the Charts must be relative and not absolute.

Is there a way to change this?

Thanks
__________________

__________________
zemaria is offline   Reply With Quote
Old 02-02-2010, 18:32   #2
Registered User
 
Don B. Cilly's Avatar

Join Date: Dec 2009
Location: Ibiza, Spain
Boat: At the moment, Chrome on Ubuntu I'm afraid, but I take out lots of little ones
Posts: 59
You could copy opencpn.conf to the pendrive and always start with the same config.
The chart paths are in it, so just edit it once...

I use a bootable linux USB stick for portability, 8 gig has the whole OS, Opencpn, gpsd and utilities, and over 4 gigs worth of charts. It has the advantage that it does not touch the host PC at all, remove the pendrive and it's as it was, you were never there.
__________________

__________________
Don B. Cilly is offline   Reply With Quote
Old 02-02-2010, 19:35   #3
Registered User

Join Date: Dec 2009
Location: Ocean Grove Aus
Boat: adams 40
Posts: 70
Quote:
Originally Posted by Don B. Cilly View Post

I use a bootable linux USB stick for portability, 8 gig has the whole OS, Opencpn, gpsd and utilities, and over 4 gigs worth of charts. It has the advantage that it does not touch the host PC at all, remove the pendrive and it's as it was, you were never there.
Don, Zemaria

Could you please let us know what linux sys you are using on pendrive? Also any tips on how to get Opencpn running. Preferably without compiling which I try to avoid although have done it for openais.

Advantage of a lightweight system is reliability -less things to go wrong out at sea.

I recall seeing a reference with puppy linux and opencpn but for the likes of me cannot refind it.

I have tried out puppy linux and its a blazingly fast system without any of the bloatware that say ubuntu has (my desktop sys.). Browser loads in millisecs compared to the several seconds that firefox takes for example.

I believe there are some offshoot systems -eg sailor pup and woof is under development that enables puppylinux to access any of the ubuntu deb packages.

Ultimately I'll run on a low spec (ie low power) netbook (after my sick laptop dies) or even an atom motherboard if I can source a high res small format lcd screen. These seem to be very scarce and cost more than a netbook itself! These motherboards are cheap so I can afford to carry two for redundancy and are easier to interface with serial port. I guess I could run without a screen using a remote login for access to any of higher level stuff with comp always on to monitor alarms ais etc etc.

I recall seeing you also use wine on your netbook -Is this run off of your pendrive as well?

Phil
__________________
otya is offline   Reply With Quote
Old 03-02-2010, 04:55   #4
Registered User
 
Don B. Cilly's Avatar

Join Date: Dec 2009
Location: Ibiza, Spain
Boat: At the moment, Chrome on Ubuntu I'm afraid, but I take out lots of little ones
Posts: 59
I use a full Ubuntu Karmic distro.
I couldn't be bothered with the niceties I guess, so I just installed a full distro to a flash drive, got gpsd and OpenCPN, and it works.

It is a bit slow compared to a system runnung off HD, but once it boots, OpenCPN is fast enough anyway, it's very usable.
I just use it to show off to my friends, so I don't have to carry the netbook around, and it's a good show-off :)

That puppylinux look really interesting though, I'll check it one of these days.

Wine I use on the netbook, on the pendrive I only have OpenCpn, although I can show off the Linux desktop and browser if I want to... except I have to explain it's slow because of the pendrive ;)

- D.
__________________
Don B. Cilly is offline   Reply With Quote
Old 03-02-2010, 07:31   #5
Registered User

Join Date: Feb 2010
Posts: 10
Quote:
Originally Posted by Don B. Cilly View Post
You could copy opencpn.conf to the pendrive and always start with the same config.
The chart paths are in it, so just edit it once...
- D.
I also use Windows, so I can't find this file opencpn.conf.
I found this file «opencpn.ini» in the folder:
«C:\Users\XXXXXXX\AppData\Roaming\opencpn»

I try to put the INI file in the PEN but it doesn't work!

For the Charts the problem is the FULL Path (like the c:\...), because when we insert the PEN in different computer it take different Drive leters!
So it must be relative Paths
__________________
zemaria is offline   Reply With Quote
Old 03-02-2010, 18:44   #6
Registered User
 
Don B. Cilly's Avatar

Join Date: Dec 2009
Location: Ibiza, Spain
Boat: At the moment, Chrome on Ubuntu I'm afraid, but I take out lots of little ones
Posts: 59
I guess that's one reason I made it bootable and Linux :)
Others are you don't want to "touch" other's people's machines too much, therefore bootable, and you want the bootable thing to work on just about anything without configuring, therefore Linux.

Apparently this thing will allow you to windows-portabilize it :)

- D.
__________________
Don B. Cilly is offline   Reply With Quote
Old 23-02-2010, 07:15   #7
Registered User

Join Date: Feb 2010
Posts: 10
Portable in test

As I described in another topic I managed to compile Opencpn using MS VC++ 6.

I looked into the code and I changed this file «chart1.cpp» after the Line 877

#ifdef _PORTABLE_
pHome_Locn->Append(std_path.GetDataDir());
#else
pHome_Locn->Append(std_path.GetUserConfigDir());

#endif

And after a few lines...

#ifdef _PORTABLE_
log.Append(std_path.GetDataDir());

#else
log.Append(std_path.GetUserConfigDir());
#endif


With this changes the configuration files and Log files go to the same Dir as the executable.

I must change things (I don't know where!) so the Path to the charts can be relative and not absolute...

I am trying...
__________________
zemaria is offline   Reply With Quote
Old 23-02-2010, 13:00   #8
Registered User
 
Psyches's Avatar

Join Date: Apr 2008
Location: SF Bay Area
Boat: Tartan 30 - Bluegrass
Posts: 187
Send a message via Yahoo to Psyches Send a message via Skype™ to Psyches
Quote:
Originally Posted by zemaria View Post
As I described in another topic I managed to compile Opencpn using MS VC++ 6.

I looked into the code and I changed this file «chart1.cpp» after the Line 877

#ifdef _PORTABLE_
pHome_Locn->Append(std_path.GetDataDir());
#else
pHome_Locn->Append(std_path.GetUserConfigDir());

#endif

And after a few lines...

#ifdef _PORTABLE_
log.Append(std_path.GetDataDir());

#else
log.Append(std_path.GetUserConfigDir());
#endif


With this changes the configuration files and Log files go to the same Dir as the executable.

I must change things (I don't know where!) so the Path to the charts can be relative and not absolute...

I am trying...
zemaria, it would not be a bad idea to make this a command-line option or env var used during OpenCPN invocation rather than as conditional compile. For that matter, with a param you could specify where the data should go.

However, currently the app locates writable data the official Windows way, like a good windows app should, so don't expect this to become the default. It's considered bad practice to write into the app directory by default, and there are pretty good reasons for that. But again, an alternative option sounds very reasonable.

As for the chart paths, I'm afraid you'll find it difficult to make them relative: I believe there is a lot of code in a lot of places that assumes full paths...but I could be wrong and haven't looked in awhile. If you wanted to proceed and identify all that code, I'll bet we could add portability support when you're done.

Mark
__________________
Psyches is offline   Reply With Quote
Old 24-02-2010, 07:10   #9
Registered User

Join Date: Feb 2010
Posts: 10
Command Line

I agree with the option for the command line switchs.

I just don't know how to do it (I'm not a C++ programmer).

For me the best choice is:
  • An *.ini file side by side with the executable, just for initialization. In that INI file there are parameters to point the program to the config file (*.cfg). The INI and CFG files must be almost Static files, so all the data from Waypoints and Routes must be in another files.
  • In the absence of an INI file (imagine an executable in a CD Read Only) then the program must act like now (saving to APPDATA).
  • A command line Switch can change all that and redirect to another INI and CFG files.
For me it's importante to have the program, the config files and the charts in a PEN, so I can go anywhere and the program works allways the same.
I have a Sail Boat, I participate in Regatas in another boats, I make boat transport with friends,... So if the boat have a PC I just need to take my Pen with me.

I hope some of these ideas can be implemented.

Thanks
__________________
zemaria is offline   Reply With Quote
Old 24-02-2010, 11:29   #10
Registered User
 
Psyches's Avatar

Join Date: Apr 2008
Location: SF Bay Area
Boat: Tartan 30 - Bluegrass
Posts: 187
Send a message via Yahoo to Psyches Send a message via Skype™ to Psyches
Quote:
Originally Posted by zemaria View Post
I agree with the option for the command line switchs.

I just don't know how to do it (I'm not a C++ programmer).

For me the best choice is:
  • An *.ini file side by side with the executable, just for initialization. In that INI file there are parameters to point the program to the config file (*.cfg). The INI and CFG files must be almost Static files, so all the data from Waypoints and Routes must be in another files.
  • In the absence of an INI file (imagine an executable in a CD Read Only) then the program must act like now (saving to APPDATA).
  • A command line Switch can change all that and redirect to another INI and CFG files.
For me it's importante to have the program, the config files and the charts in a PEN, so I can go anywhere and the program works allways the same.
I have a Sail Boat, I participate in Regatas in another boats, I make boat transport with friends,... So if the boat have a PC I just need to take my Pen with me.

I hope some of these ideas can be implemented.

Thanks
Moving waypoints, routes, etc from the main ini is pretty high priority, I think.

As for the rest, I suggest you submit a feature request. Not sure who would implement or when, but at least the idea won't get lost. Again, I'm afraid changing paths to support relative everywhere could take awhile.

Mark
__________________
Psyches is offline   Reply With Quote
Old 01-03-2010, 14:03   #11
Registered User
 
Don B. Cilly's Avatar

Join Date: Dec 2009
Location: Ibiza, Spain
Boat: At the moment, Chrome on Ubuntu I'm afraid, but I take out lots of little ones
Posts: 59
Zemaria,
all considered, wouldn't it just be simpler to do the Linux bootable thing?
Sient'a'mme, it works better with Linux, I've never had a problem with it (except with S-57 charts) and it has the following advantages:

- If it's bootable, you don't "touch" the computer you're using, take the pendrive out, you've never been there.

- It'll work on just about any machine, and with any gps unit.

- It takes less time to boot from a pendrive than Windows from a HD.

- It uses less power :)

- It gives you a chance to try Linux (which I wouldn't pass on) and show it around.

You could either do it with an 8GB pendrive and a full Ubuntu distro, or a smaller drive and Puppylinux.

I haven't tried Puppy, so if you want to try the full distro, it's easy enough:

- Get Ubuntu and install it to the pendrive
- (once booted from the pendrive) get gpsd and gpsd-clients, with System, Administration, Package Manager.
- Get OpenCPN and tell it to use gpsd for the gps, copy your charts, and tell it where they are.

That's it, you got a pendrive with a full Linux on it (which will fix your Windows, whereas Windows won't fix your Linux) and a chart plotter that really works.

Hey, you could make a bootable Windows pendrive, but you'd need a huge one, wait hours for it to boot and have copyright and compatibility issues.

Provare per credere...

D.
__________________
Don B. Cilly is offline   Reply With Quote
Old 01-03-2010, 14:26   #12
֍֎֍֎֍֎֍֎֍֎

Cruisers Forum Supporter

Join Date: Apr 2006
Posts: 13,056
If you first format the USB stick with Windows' Disk Manager (from any version of 2000 or XP or Vista or 7) and use the option to assign a drive letter to it, that drive letter should be stable even across different computers, as long as they also are running some version of NT. Very few computers are likely to be using letters beyond H or I, so typically M-S should be good choices. Avoid the tail end of the alphabet since many users assign X Y Z to portable devices as well, coming back from the tail end of the alphabet in order to avoid conflicts as well.
__________________
hellosailor is offline   Reply With Quote
Old 05-07-2010, 05:34   #13
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
You guys rock!! Never thought about the possibility of running the whole ball of wax from a pen drive. Great idea... I'd be very interested porting linux et all on my pen drive but totally lack the technical know-how. I'm a moron in this respect..

As pen drives are relatively in-expensive and solid state,it could be an ideal application for on board navigation where you could also carry a reserve backup for safety.
__________________

__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Reply

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
OpenCPN bdbcat OpenCPN 1343 19-09-2009 16:59
Portable Reefers iiii Plumbing Systems and Fixtures 1 15-08-2009 04:33
Portable Solar (Again) Ex-Calif Electrical: Batteries, Generators & Solar 0 30-10-2007 20:07
Portable Generator How-to? Amfivena Electrical: Batteries, Generators & Solar 14 26-07-2006 06:49



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 22:23.


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.