Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 28-01-2013, 12:29   #121
Registered User

Join Date: Jun 2011
Posts: 17
Re: Chart Problems on Raspberry Pi

All I can say is F'in awesome!! Well done. I knew it would get figured out eventually - also knew it wasn't going to be me... so thanks for all your work folks.

Pi has been measured at 2-2.5 watts depending on load. The BU-353 consumes around 70 milliamps. .07*12.5 =.875 watts. So around 3.5 watts in all I'm guessing. You can pick up 5 inch screens that consume ~2-3 watts. I havent measured mine yet. Either way - its quite the setup if you're conscious of power. And I think most boaters would fall in that category. Point is - my 80 watt panel will be able to run this all day with stuff leftover. And that makes me extremely happy.

For anyone who wants it - I've been putting some code together to add some GPS functionality to the pi.
Link here: https://docs.google.com/file/d/0B1-U...pHb2lkYUE/edit

File includes 2 python scripts, as well as the GPSD python files.

1. 'gpstime.py' will set your pi's system time to that of the gps time. You will need to change your UTC offset in the settings.txt, as well as the direction to the settings.txt file within gpstime.py. This uses GPSD, so you will need to be running your GPS through that as well. Anyways - I find it useful. I set it up to run on boot up so tide charts are functional at all times. Remember - time only gets updated every minute, so you have to wait for the update to see the change.

2. 'gps_ui.py' is a pretty simple visual interface for the gps. I only hacked this together a couple days ago - so it is pretty rough around the edges - far from done. Anyways, it uses pygame python modules included on the pi to create a full screen interface for gps info. This also requires the use of GPSD. LAT/LONG, SOG, COG - with simple compass implemented, as well as distance/bearing to a specified LAT/LONG using haversine formula. Right now the coordinate is hard coded into the script under the distance function. Far from done - but for now, good simple full screen interface for gps output. Still very much a work in progress though.

Space key for night mode - turns things black and red.
Tab key to minimize.
Esc key to quit.

Give things a try on your pi's - perhaps you'll find it useful. Couldn't contribute much towards OpenCPN on pi, but perhaps can help in other ways.
nsweeting is offline   Reply With Quote
Old 30-01-2013, 04:39   #122
Registered User

Join Date: May 2010
Location: Med
Boat: Westerly Renown
Posts: 38
Re: Chart Problems on Raspberry Pi

Whilst this seems to have done the trick:

adding to /boot/config.txt:
framebuffer_depth=32
framebuffer_ignore_alpha=1

Could the brains here please explain why? How does it work?

Thanks

Stuart ( Life just been trashed by publication of new HS2 route )
stuartb is offline   Reply With Quote
Old 31-01-2013, 08:59   #123
Registered User

Join Date: Jun 2011
Posts: 17
Re: Chart Problems on Raspberry Pi

Sorry Stuart - cant explain that one.

Has anyone else experienced this though? As I said, I find it hard to believe its just me...

As noted in the v3.1.128 thread:

This is a fairly serious bug - though I haven't found anyone else saying anything about it yet. There is no reason why it should just be me experiencing it though. Have experienced it since I first tried OpenCPN on the pi a number of revisions ago.

On raspberry pi, running the raspbian operating system. Straight system install, followed by OpenCPN git download and compilation. No other changes. Did add MEMCacheLimit and NCacheLimit settings to the config file.

Once in a while - rather randomly it seems, the OpenCPN settings are deleted. I start OpenCPN and it acts like its the first time I started it. I have not found a repeatable reason why this would happen. Frustrating. Has there ever been complaints about this before? Don't know where to start on this one...
nsweeting is offline   Reply With Quote
Old 31-01-2013, 13:30   #124
Registered User

Join Date: Jul 2012
Location: UK
Boat: Albin Vega, 27'
Posts: 79
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by nsweeting View Post
Sorry Stuart - cant explain that one.

Has anyone else experienced this though? As I said, I find it hard to believe its just me...

As noted in the v3.1.128 thread:

This is a fairly serious bug - though I haven't found anyone else saying anything about it yet. There is no reason why it should just be me experiencing it though. Have experienced it since I first tried OpenCPN on the pi a number of revisions ago.

On raspberry pi, running the raspbian operating system. Straight system install, followed by OpenCPN git download and compilation. No other changes. Did add MEMCacheLimit and NCacheLimit settings to the config file.

Once in a while - rather randomly it seems, the OpenCPN settings are deleted. I start OpenCPN and it acts like its the first time I started it. I have not found a repeatable reason why this would happen. Frustrating. Has there ever been complaints about this before? Don't know where to start on this one...
If you log in as root the opencpn config is in /root/.opencpn/config.txt

If you log in as pi, for example by letting the window manager start automagically, the opencpn config is in /home/pi/.opencpn/config.txt

Neither config is lost, but they may be different; also first time you log in as a different user you are prompted with the disclaimer and that you don't have any charts setup.

I've never seen the pi actually lose its opencpn settings - but it's worth keeping a backup of known good settings though.
Alisdair is offline   Reply With Quote
Old 31-01-2013, 13:53   #125
Registered User

Join Date: Jun 2011
Posts: 17
Re: Chart Problems on Raspberry Pi

I'm only ever logged in automatically under the pi user. Never run it under root. I'm only ever working off of the /home/pi/.opencpn/config.txt file

The config file is definitely being replaced with a default one though - as the MEMCacheLimit and NCacheLimit settings that I would originally have placed in the file would be gone. All settings wiped to default. It's as if I'm running it for the first time. Curious to say the least. But as I said it is not all the time - just some of the time. I just haven't seen a repeatable reason...
nsweeting is offline   Reply With Quote
Old 31-01-2013, 14:11   #126
Registered User

Join Date: Jun 2011
Posts: 17
Re: Chart Problems on Raspberry Pi

Here is the log file from the time when everything was OK - to the time after.

It definitely shows several settings have been replaced. My original ChartDB Cache policy was 5. The next time I opened OpenCPN it is the default 20.

Code:
________

16:18:06 UTC: 2013-01-29
16:18:06 UTC:  ------- Starting OpenCPN -------
16:18:06 UTC: Version 3.1.1328 Build 2013-01-28
16:18:06 UTC: wxWidgets version: wxWidgets 2.8.12
16:18:06 UTC: MemoryStatus:  mem_total: 232 mb,  mem_initial: 39 mb
16:18:06 UTC: SData_Locn is /usr/local/share/opencpn/
16:18:06 UTC: Using existing Config_File: /home/pi/.opencpn/opencpn.conf
16:18:07 UTC: Styles loading from /usr/local/share/opencpn/uidata/styles.xml
16:18:07 UTC: No styles found at: /home/pi/
16:18:07 UTC: No styles found at: /home/pi/.opencpn/
16:18:07 UTC: Setting Viewpoint Lat/Lon 17.128, -61.8658
16:18:07 UTC: Setting Ownship Lat/Lon 44.496, -80.0465
16:18:07 UTC: System default Language:  en_GB
16:18:07 UTC: Error: Cannot set locale to 'en_US'.
16:18:07 UTC: Error: Cannot set locale to 'en_US'.
16:18:07 UTC: Opencpn language set to:  en_US
16:18:10 UTC: ChartSymbols loaded from /usr/local/share/opencpn/s57data/chartsymbols.xml
16:18:13 UTC: Using s57data in /usr/local/share/opencpn/s57data
16:18:13 UTC: Setting Viewpoint Lat/Lon 17.128, -61.8658
16:18:13 UTC: Setting Ownship Lat/Lon 44.496, -80.0465
16:18:14 UTC: PlugInManager searching for PlugIns in location /usr/local/lib/opencpn
16:18:14 UTC: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libdashboard_pi.so
16:18:14 UTC:   /usr/local/lib/opencpn/libdashboard_pi.so Version detected: 106
16:18:14 UTC: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libgrib_pi.so
16:18:14 UTC:   /usr/local/lib/opencpn/libgrib_pi.so Version detected: 107
16:18:15 UTC: ChartDB Cache policy:  Max open chart limit is 5.
16:18:15 UTC: Loading chart db version: V017
16:18:15 UTC: Chartdb: Chart directory list follows
16:18:15 UTC:   Chart directory #0: /home/pi/NAVSTAT/Charts
16:18:15 UTC: GPS Watchdog Timeout is: 6 sec.
16:18:15 UTC: Initializing Chart /home/pi/NAVSTAT/Charts
16:18:15 UTC: CM93Composite Chart Root is /home/pi/NAVSTAT/Charts/
16:18:15 UTC: Loaded CM93 Dictionary from /home/pi/NAVSTAT/Charts/
16:18:15 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/E/03210894.E
16:19:07 UTC: LOGBOOK:  2013-01-29 16:19:07 UTC  DR Lat   44.49600 Lon  -80.04650
16:19:32 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/D/03210894.D
16:19:43 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/C/03180888.C
16:19:48 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/B/03000870.B
16:19:54 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/A/02700840.A
16:19:55 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700900/A/02700900.A
16:19:57 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700840/Z/02700840.Z
16:20:02 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700960/Z/02700960.Z
16:20:05 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/02700720/Z/02700720.Z
16:20:18 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900720/Z/03900720.Z
16:20:18 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/Z/03900840.Z
16:20:42 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/A/03900840.A
16:20:49 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900780/A/03900780.A
16:20:58 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/B/03900840.B
16:21:06 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/C/03900840.C
16:21:08 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/D/03990840.D
16:21:27 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/E/04000841.E
16:21:32 UTC: Loading CM93 cell /home/pi/NAVSTAT/Charts/03900840/F/04000841.F
16:29:47 UTC: opencpn::MyFrame exiting cleanly.
16:29:47 UTC: Chart cache purge
16:29:48 UTC: PlugInManager: UnLoading PlugIn: /usr/local/lib/opencpn/libdashboard_pi.so
16:29:48 UTC: PlugInManager: UnLoading PlugIn: /usr/local/lib/opencpn/libgrib_pi.so
16:29:48 UTC: Chart cache purge
16:29:48 UTC: LOGBOOK:  2013-01-29 16:29:48 UTC OFF: Lat   44.49600 Lon  -80.04650
16:29:48 UTC: opencpn::MyApp exiting cleanly...

16:18:13 UTC: 

________

16:18:13 UTC: 2013-01-29
16:18:13 UTC:  ------- Starting OpenCPN -------
16:18:13 UTC: Version 3.1.1328 Build 2013-01-28
16:18:13 UTC: wxWidgets version: wxWidgets 2.8.12
16:18:13 UTC: MemoryStatus:  mem_total: 232 mb,  mem_initial: 39 mb
16:18:13 UTC: SData_Locn is /usr/local/share/opencpn/
16:18:13 UTC: Using existing Config_File: /home/pi/.opencpn/opencpn.conf
16:18:13 UTC: Styles loading from /usr/local/share/opencpn/uidata/styles.xml
16:18:13 UTC: No styles found at: /home/pi/
16:18:13 UTC: No styles found at: /home/pi/.opencpn/
16:18:13 UTC: Setting Viewpoint Lat/Lon 33.358, -79.282
16:18:13 UTC: Setting Ownship Lat/Lon 33.358, -79.282
16:18:13 UTC: System default Language:  en_GB
16:18:13 UTC: Error: Cannot set locale to 'en_US'.
16:18:13 UTC: Error: Cannot set locale to 'en_US'.
16:18:13 UTC: Opencpn language set to:  en_US
16:18:23 UTC: ChartSymbols loaded from /usr/local/share/opencpn/s57data/chartsymbols.xml
16:18:25 UTC: Using s57data in /usr/local/share/opencpn/s57data
16:18:25 UTC: Setting Viewpoint Lat/Lon 33.358, -79.282
16:18:25 UTC: Setting Ownship Lat/Lon 33.358, -79.282
16:18:26 UTC: PlugInManager searching for PlugIns in location /usr/local/lib/opencpn
16:18:27 UTC: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libdashboard_pi.so
16:18:27 UTC:   /usr/local/lib/opencpn/libdashboard_pi.so Version detected: 106
16:18:27 UTC: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libgrib_pi.so
16:18:27 UTC:   /usr/local/lib/opencpn/libgrib_pi.so Version detected: 107
16:18:27 UTC: ChartDB Cache policy:  Max open chart limit is 20.
16:18:27 UTC: Chartlist file not found, config chart dir array is empty.  Chartlist target file is:/home/pi/.opencpn/chartlist.dat
nsweeting is offline   Reply With Quote
Old 31-01-2013, 14:41   #127
Registered User

Join Date: Jul 2012
Location: UK
Boat: Albin Vega, 27'
Posts: 79
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by nsweeting View Post
Here is the log file from the time when everything was OK - to the time after.

It definitely shows several settings have been replaced. My original ChartDB Cache policy was 5. The next time I opened OpenCPN it is the default 20.

...
As a workaround, you could change ownership and permissions of the (good) config file:

sudo chown root:root /home/pi/.opencpn/opencpn.conf
sudo chmod 444 /home/pi/.opencpn/opencpn.conf

I know, it won't store your last position, and it doesn't solve your problem ...
but you might trip something that's trying to delete or overwrite the file.
Alisdair is offline   Reply With Quote
Old 31-01-2013, 14:45   #128
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
Re: Chart Problems on Raspberry Pi

nsweeting...
Looks like a normal shutdown to me...
Could you please use a script like
Code:
#!/bin/sh
cp ~/.opencpn/opencpn.conf ~/.opencpn/opencpn.conf.bak
opencpn
to run OpenCPN and do a
Code:
diff  ~/.opencpn/opencpn.conf ~/.opencpn/opencpn.conf.bak
when this problem appears (as soon as it appears, before closing O or doing any config changes)
I wonder if the problem is that the config is not entirely written on shutdown...

Thanks

Pavel
nohal is offline   Reply With Quote
Old 01-02-2013, 15:11   #129
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by EeroVahala View Post
Hello and thank you very much for your work so far on this matter.

I tried to find out if the problem is in the xserver rather than in the OpenCPN. I contacted my Pi from another computer with ssh (ssh -X pi@192.168.0.8) and ran opencpn (built from latest sources from git). It seemed to fork fine.

After that I started tweaking Pi's X-settings to see if they had any difference. Setting depth to 32 bits and ignoring alpha did the trick.

I added these lines to /boot/config.txt:
framebuffer_depth=32
framebuffer_ignore_alpha=1

Now CM93 -maps (year 2011) seem to work quite nicely.

Eero Vahala
That works for me as well, fantastic! Really good work everyone.

As for power draw, I make it 0.6A running a Pi, gps128 and nasa ais engine. Monitor is plugged into mains at the moment.

Has anyone got it running using a tablet over wifi as a monitor yet?

Ta
conachair is offline   Reply With Quote
Old 04-02-2013, 11:39   #130
Registered User

Join Date: Jul 2012
Location: UK
Boat: Albin Vega, 27'
Posts: 79
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by conachair View Post
... Has anyone got it running using a tablet over wifi as a monitor yet?

Ta
After installing "X-server" and "ConnectBot" apps on SWMBO's Android phone I can see a few components of different UIs (Lat/Long for OCPN, File menu for zygrib and so on) but nothing usable. It might be OK on a tablet, but I hae ma doots.

[if you want to try... install the two free apps mentioned above;
in X Server, Access Control, on the phone: set the Pi's IP address so that it is an authorized device;
in a Pi terminal: export DISPLAY=x.x.x.x:0.0 (where x.x.x.x is the phone's IP address)l;
start the program from the command line

... and you can also launch it from the ssh client in ConnectBot, but one step at a time ]
Alisdair is offline   Reply With Quote
Old 04-02-2013, 14:52   #131
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
Re: Chart Problems on Raspberry Pi

Quote:
...power draw...0.6A running a Pi, gps128 and nasa ais engine. Monitor is plugged into mains at the moment.
Is this power draw including usb mouse and keyboard? Thanks.
rgleason is offline   Reply With Quote
Old 04-02-2013, 15:41   #132
cruiser

Join Date: Nov 2007
Location: Probably in an anchorage or a boatyard..
Boat: Ebbtide 33' steel cutter
Posts: 5,030
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by rgleason View Post
Is this power draw including usb mouse and keyboard? Thanks.
Yep, cordless mouse and usb keyboard. Will be looking into hardwiring the ais & GPS onto gpio puins at some point, never liked those usb/serial adaptors. Got a max 3232 chip today to convert the levals down to 3.3v but will be a little while before getting round to playing with that side of things. But looking good so far, had it running overnight and all seemed well apart from the dev/usb ports for gps & ais changing for some reason. Happy days
conachair is offline   Reply With Quote
Old 05-02-2013, 06:15   #133
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
Re: Chart Problems on Raspberry Pi

So instead of the USB hub you're planning on using some pins on the Raspberry Pi for the signal? Does this save power too? But first you need to power the AIS and GPS at 3.3vdc? I thought the GPS puck required 5 vdc? Would love to see a diagram when you get there. I recently made a 5vdc Power Supply for the puck gps and wired it to send nmea to VHF/DSC which is a similar problem. Could I have used 3.3vdc?
rgleason is offline   Reply With Quote
Old 05-02-2013, 06:31   #134
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,494
Images: 2
Re: Chart Problems on Raspberry Pi

Dell Laptop XPS15 L1501 and L1502 power consumption for comparison
Bootup 72-75w then 43w loading, 59w, ending at 43w when all booted up. Brightness is up, Keyboard lite is on.
.58 amp, .56 amp at 131 vollts.
Brightness down now at 33w running.
Keyboard Lights off goes from 35 down to 31watts

All these tests done with Brightness at lowest and keyboard light off!
Wireless on 45-33 watts Wireless off 31 w
Hibernate (Shut top ) 6w
Shutting down 45, 49, 52, 62, 58, 40, 50, 33-39w, scroll 34 w, zoom in 33-40, settings 38-40


Typing email with Low screen brightness and no keyboard lights. 33 w
Loading qtVlm peak at 58, then down to 32, up to 56, down to 32 w, Download Grib 35w Routing 65w
Loading OpenCpn 61-66 momentarily, then 35-40 Settings 35-40, make route 40-65 w Zoom out 45-65 w, shutdown 55-63

Big change is screen brightness.

These readings were using 120vac with a Watt Meter.
rgleason is offline   Reply With Quote
Old 05-02-2013, 06:45   #135
Registered User

Join Date: Jul 2012
Location: UK
Boat: Albin Vega, 27'
Posts: 79
Re: Chart Problems on Raspberry Pi

Quote:
Originally Posted by rgleason View Post
So instead of the USB hub you're planning on using some pins on the Raspberry Pi for the signal? Does this save power too? But first you need to power the AIS and GPS at 3.3vdc? I thought the GPS puck required 5 vdc? Would love to see a diagram when you get there. I recently made a 5vdc Power Supply for the puck gps and wired it to send nmea to VHF/DSC which is a similar problem. Could I have used 3.3vdc?
The advantage of using GPIO pins for the GPS is that it frees up a USB port, also USB/RS232 converters seem to be a bit hit or miss on the Pi.
Alisdair is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


Advertise Here


All times are GMT -7. The time now is 00:46.


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.