Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 20-12-2016, 19:41   #1
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
OpenCPN on Pi Zero

Just wanted to share my little project.

Got a Raspberry Pi Zero recently, along with a Pi3.

Hooked up the Pi-Zero and installed Raspbian that didn't have a GUI. Installed one, but had some issues. Once I finally got the GUI to actually log in, then I tried installing OpenCPN using the instructions for adding the PPA to the repository list. It seemed to install ok, but when I tried starting from a terminal window, I kept getting a message about an illegal operation.

After a while of trying to figure out what was going on, I noticed the link for being able to install from source code. So, I started over. This time, I wiped the 16G memory card and installed Raspbian w/Pixel GUI. No problems there. Downloaded the source and compiled.... While in the desktop and running the terminal commands, it kept getting hung up. So, I booted up into command line only, thinking the GUI was probably slowing things down. Finished the compiling, did the "make install" command, and now I have OpenCPN working (so far) on the Pi-Zero.

So far, I'm just testing it at home and not looking to use this setup on the boat right now, but I'm pretty happy to see this little thing is working. I've only installed about 8 to 10 charts of the local area, the Chesapeake, so it wouldn't crash the system. And, I've only been using one of the BU-353 puck style USB GPS units. This being since yesterday, but still wanted to share that it seems to work ok on the $5 computer.

Still some things I'd like to figure out to try... but still...

Pretty cool, I think.

__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Old 20-12-2016, 20:02   #2
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
Re: OpenCPN on Pi Zero

it probably didn't work as a package since it's compiled for arm7 and the zero is arm6 hence illegal instructions.

For compiling, you probably ran out of ram with the gui. Making swap on the sdcard should enable it to finish (slowly) or compiling without optimizations (but then it would run more slowly)

are you using the vc4 driver and opengl?
seandepagnier is offline   Reply With Quote
Old 21-12-2016, 11:07   #3
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
Re: OpenCPN on Pi Zero

Thanks for the info. I also thought the RAM was limiting its ability to compile.

I'm not familiar with VC4 and OpenGL, so I'd have to say that I'm not using it. I had to look them up to see what they were for.

Someone was telling me once that I could run a VNC server and an ad hoc wireless setup to access with a tablet, so looking into how to do that too. Not sure if the WiFi dongle will work in ad hoc mode. Raspbian isn't showing any WiFi devices, but was able to connect when setting up with wpa_cli. May have to use a command line method to setup any other configuration.



Quote:
Originally Posted by boat_alexandra View Post
it probably didn't work as a package since it's compiled for arm7 and the zero is arm6 hence illegal instructions.

For compiling, you probably ran out of ram with the gui. Making swap on the sdcard should enable it to finish (slowly) or compiling without optimizations (but then it would run more slowly)

are you using the vc4 driver and opengl?
__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Old 21-12-2016, 11:11   #4
cruiser

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

On your Pi 3 have you checked out openplotter yet?

As a boat nav system it's excellent.

Sailing with free hardware | Sailoog
conachair is offline   Reply With Quote
Old 21-12-2016, 14:46   #5
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
Re: OpenCPN on Pi Zero

Quote:
Originally Posted by conachair View Post
On your Pi 3 have you checked out openplotter yet?

As a boat nav system it's excellent.

Sailing with free hardware | Sailoog

I haven't dived into the Pi 3 just yet. I've only recently come across info on OpenPlotter... actually from that same site. Going to look into it and see how that one compares to OpenCPN.

Thank you
__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Old 22-12-2016, 00:42   #6
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,683
Re: OpenCPN on Pi Zero

OpenPlotter contains OpenCPN as a core component - plus a lot of other goodies for a complete boat system.
Connecting sensors for example. Or external dash boards via web browsers.
bcn is offline   Reply With Quote
Old 22-12-2016, 01:40   #7
cruiser

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

Quote:
Originally Posted by Rhapsody-NS27 View Post
I haven't dived into the Pi 3 just yet. I've only recently come across info on OpenPlotter... actually from that same site. Going to look into it and see how that one compares to OpenCPN.

Thank you
As bcn said, the openplotter image has Opencpn already installed with all the plugins. V0. 9 is still very much alpha with signalk being used extensively, also the raspberry pi hardware graphics driver seems to be stable now so Opencpn runs quick.

The pi zero also makes a great entertainment centre, just plug into a hdmi monitor (using the monitor speakers)

https://osmc.tv/download/
conachair is offline   Reply With Quote
Old 22-12-2016, 02:49   #8
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
Re: OpenCPN on Pi Zero

Thanks for the info.
I have another memory card I can try it out with.
__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Old 22-12-2016, 03:24   #9
Marine Service Provider

Join Date: May 2013
Location: Norway
Posts: 719
Re: OpenCPN on Pi Zero

If you have a USB hub for your Zero - or normal usb port for all other OI models, I have very good experience and increased disk performance by using a USB thumb drive for the file system except for the "boot" partion on raspberry PI. The Samsung microfit 64 gb or larger is excelent for this use on the PI.
Samsung USB 3.0 FIT Drive Review | StorageReview.com - Storage Reviews

Reason for using the 64 gb and not the cheaper and smaller 32GB is that the 32GB have less write speed than the 64GB and theoretically can throttle the PI on write operations.

https://learn.adafruit.com/external-...-root/overview


Quote:
Originally Posted by Rhapsody-NS27 View Post
Thanks for the info.
I have another memory card I can try it out with.
petter5 is offline   Reply With Quote
Old 20-01-2017, 05:47   #10
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
Re: OpenCPN on Pi Zero

I added a couple devices to my setup. Still playing around with it mostly before doing anything with the Pi3 I have.

I got a Red Bear Wifi card and a Zero4U USB hub. This really shrinks down the package. I also got a small wifi router that's about as big as the Pi-Zero, to have it's own network.

I have an old Acer A500 Tablet that I connect to the Pi-Zero with through VNC. Being on it's own wifi router and off-line from the internet, I realized the system time was way off... at one point, as much as a day off. I had an idea to see if the time could be set from the GPS since it always receives accurate time.

Many websites with different approaches to this, and usually being a few years old, many didn't work. I finally found one source that actually worked.
I had to play around with a few things, such as "service gpsd stop" then "gpsd -D2 -N /dev/ttyUSB0" in order to see what was going on.

Then, when I saw the GPS LED blinking, showing it had a lock, I used these three commands:

Quote:
gpspipe -w | grep -qm 1 '"mode":3'

UTCDATE=`gpspipe -w | grep -m 1 "TPV" | sed -r 's/.*"time":"([^"]*)".*/\1/' | sed -e 's/^\(.\{10\}\)T\(.\{8\}\).*/\1 \2/'`

sudo date -u -s "$UTCDATE"
so the first one, confirms there's a lock, second one pulls the time from the GPS data, then the third, sets the date/time. I did notice, when setting UTCDATE in the second command, the date command had to be submitted right away, otherwise it could still be off slightly. Just typing the UTCDATE command didn't quite work out... apparently, there's two different single quote marks above. You have to look closely. '`
Copy/Paste worked.

At one point, the GPS went into SiRF mode, where I found I could set back to NMEA mode by the command, gpsctl -n /tty/USB0

I noticed also along the line, OpenCPN stopped connecting to the GPS. I had to remove the connection and add it again.

It took some time, but it seemed to work. Thought it would be helpful to share for anyone who may use their setup off-line.

Here is the Pi Zero with the Red Bear and Zero4U.
http://i.imgur.com/B4faLZr.jpg
http://i.imgur.com/JQUdFPt.jpg

and to speed up the work I described above, I added a small keyboard and wireless mouse and used the tablet as a screen. but for the most part, a relatively small setup.
http://i.imgur.com/5mjXJc6.jpg
__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Old 20-01-2017, 11:03   #11
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
Re: OpenCPN on Pi Zero

This python script is a little nicer way to set the gps date:

Code:
#!/usr/local/bin/python

import os, time
import gps

while True:
    while True:
        try:
            gpsd = gps.gps(mode=gps.WATCH_ENABLE) #starting the stream of info
            break
        except:
            time.sleep(3)

    while True:
        try:
            gpsd.next()
        except KeyboardInterrupt:
            exit(1)
        except:
            break

        if len(gpsd.utc):
            date, t = gpsd.utc[:-5].split('T')
            print date, t
            os.system('date -u -s "' + date + ' ' + t + '"')
            time.sleep(3*24*60*60) # sync again in 3 days
seandepagnier is offline   Reply With Quote
Old 20-01-2017, 12:24   #12
Registered User

Join Date: Aug 2009
Location: between the devil and the deep blue sea
Boat: a sailing boat
Posts: 20,420
Re: OpenCPN on Pi Zero

Quote:
Originally Posted by Rhapsody-NS27 View Post

used the tablet as a screen
Why not set up the OpenCPN on the tablet then?

Setting OpenCPN on Pi to send the screen wirelessly, via a router, over to a tablet sounds like a long long way to get there.

And also why a wifi router in the middle? You are using 3 pieces of hardware to get a very simple job done.

Why?

b.
barnakiel is offline   Reply With Quote
Old 20-01-2017, 12:53   #13
ejs
Registered User

Join Date: Mar 2013
Location: From San Francisco
Boat: Leopard 48
Posts: 175
Re: OpenCPN on Pi Zero

Hi,
I have an Orange PI Plus 2E (raspberry PI clone) running OpenCPN with a GPS Puck, an RTL-SDR radio that does both AIS and downloads weather pictures from the APT satellites. I also run it headless and use my PC and VNC as the display. The reason is that the Pi runs all the time with very low power and I have instant access to the data without waiting for the GPS to acquire every time I turn the PC on (or unsleep it) The weather sats are also at odd times and I don't have to remember to turn the PC on to catch them this way, I run a Samba server on the Pi and just access the pictures when I want to. I am also getting all my NMEA nav data and using OpenCPN dashboards to display it.

I do wish that the Openplotter project had a way to run on the clone Pis, but currently it doesn't, it is only available as a complete SD image.

Cheers, Eric
ejs is offline   Reply With Quote
Old 20-01-2017, 19:05   #14
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,414
Re: OpenCPN on Pi Zero

Quote:
Originally Posted by ejs View Post
Hi,
I have an Orange PI Plus 2E (raspberry PI clone) running OpenCPN with a GPS Puck, an RTL-SDR radio that does both AIS and downloads weather pictures from the APT satellites.
What is your boot time? I am able to see the chart in 17 seconds on raspberry pi with tinycore linux.

I use rtlsdr for AIS and HF weather fax (via upconverter)

Apparently it's possible to modify the rtl-sdr to receive weather fax without the need of an upconverter, so I may try this. I will integrate support into the weather fax plugin, so that it becomes fully automatic.

How do you pick up the apt satellite? I tried but didn't succeed.

Quote:
I also run it headless and use my PC and VNC as the display. The reason is that the Pi runs all the time with very low power and I have instant access to the data without waiting for the GPS to acquire every time I turn the PC on (or unsleep it) The weather sats are also at odd times and I don't have to remember to turn the PC on to catch them this way, I run a Samba server on the Pi and just access the pictures when I want to. I am also getting all my NMEA nav data and using OpenCPN dashboards to display it.
Maybe usable via vnc, but the graphics performance will be a limitation to usability. Why not run opencpn locally, and connect to the remote opencpn? It would be interesting if networked opencpn's could synchronize user data like routes and tracks.

Quote:
I do wish that the Openplotter project had a way to run on the clone Pis, but currently it doesn't, it is only available as a complete SD image.

Cheers, Eric
Why don't you just clone the repository with git on your orange pi?
seandepagnier is offline   Reply With Quote
Old 20-01-2017, 20:21   #15
Registered User
 
Rhapsody-NS27's Avatar

Join Date: Oct 2010
Location: VA, boat: Deale, MD
Boat: 1981 Nor'sea 27
Posts: 1,414
Re: OpenCPN on Pi Zero

Quote:
Originally Posted by barnakiel View Post
Why not set up the OpenCPN on the tablet then?

Setting OpenCPN on Pi to send the screen wirelessly, via a router, over to a tablet sounds like a long long way to get there.

And also why a wifi router in the middle? You are using 3 pieces of hardware to get a very simple job done.

Why?

b.
I do have a couple things on a phone and the tablet, but thought it best to keep the bulk of the processing off the tablet as I expected to add to the setup in the future and be able to use it for other things. It was just a thought that the tablet battery wouldn't become depleted as quickly.

Quote:
Originally Posted by ejs View Post
Hi,
I have an Orange PI Plus 2E (raspberry PI clone) running OpenCPN with a GPS Puck, an RTL-SDR radio that does both AIS and downloads weather pictures from the APT satellites. I also run it headless and use my PC and VNC as the display. The reason is that the Pi runs all the time with very low power and I have instant access to the data without waiting for the GPS to acquire every time I turn the PC on (or unsleep it) The weather sats are also at odd times and I don't have to remember to turn the PC on to catch them this way, I run a Samba server on the Pi and just access the pictures when I want to. I am also getting all my NMEA nav data and using OpenCPN dashboards to display it.

I do wish that the Openplotter project had a way to run on the clone Pis, but currently it doesn't, it is only available as a complete SD image.

Cheers, Eric
Eric, I recently heard about the Orange Pi variant. I think there's another Pi-type system out there too. Cool that you're doing that much on your setup. Might do something similar with the APT reception. Did a lot of that with a hand-held yagi in the middle of a parking lot when I was younger. It was fun being able to get the images. I'll look into that. I've seen info on the RTL-SDR and I'll see about finding the software for APT too. Just gives me ideas to expand.

The Pi Zero is mostly tinkering around at this point, but may build on this by moving to a Pi-3 that I have on hand too.


responses in blue:
Quote:
Originally Posted by boat_alexandra View Post
What is your boot time? I am able to see the chart in 17 seconds on raspberry pi with tinycore linux.
I tried testing tinycore in virtualbox a bit but it seemed unstable to me. I had thought of trying it out on the Pi to slim down the system. How long have you used it and how has it been working for you?

How do you pick up the apt satellite? I tried but didn't succeed.
I'd like to know too.

Why not run opencpn locally, and connect to the remote opencpn? It would be interesting if networked opencpn's could synchronize user data like routes and tracks.
I was wondering about this myself about what info can be shared between computers.
__________________
Daniel - Rhapsody Blog,
“A sailor’s joys are as simple as a child’s.” — Bernard Moitessier
"I don't need therapy, I just need my boat"
Rhapsody-NS27 is offline   Reply With Quote
Reply

Tags
enc, opencpn

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN puts Track Point at Lat Long Zero LifePart2 OpenCPN 6 02-05-2014 02:15
Navnet3d / Maxsea Time Zero Mapmedia Charts for Australia - Screenshots ? TrevC Navigation 0 09-12-2009 17:23
Navionics Platinum+ in MaxSea Time Zero yme_bosma Navigation 0 02-12-2009 09:23
Code Zero Furler kiapa Deck hardware: Rigging, Sails & Hoisting 13 27-10-2009 17:38
Solar Panel Voltage Drops to Zero Sergy Electrical: Batteries, Generators & Solar 4 05-05-2009 10:10

Advertise Here


All times are GMT -7. The time now is 04:21.


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.