How to install GPSD to my RPi setup?

Hi!
I’m currently setting up Home Assistant for my boat, and have burned the image over and started setting it up on my RPi3. Works fine, and I love how easy it was to get it configured with DuckDNS and let’s encrypt etc.

As I’m using it in a boat, I’d like to connect a GPS that tracks my boats movement. I don’t necessarily need it to update its location in Home Assistant, while that would also be “cool”, as I would mostly be in the same marina.

But I’d like to install GPSD so I can use Python or similar to create a file which I can send to MarineTraffic through email (“email AIS”).

The guide on installing GPSD doesn’t seem to work as it needs you to manually install the package, but even with SSH add-on installed, I won’t get that access. Is this impossible at the current state with RPi?

How did you install home assistant?

Sorry for my late reply, I used the Hassio image, 32bit for RPi 3.

Ok then I think the best way would be to install the portainer addon and then add gpsd via docker/portainer.

Great! Thank you, I’ll have a look at that.
I think I used Hassbian the last time I was a HA user, but avoiding having a full Raspbian install to manage is a priority for the boat.

I tried adding “docker-gpsd” but I immediately get “Stopped for a few seconds with exit code 1” and no logs?

Update:
I now tried a newer one that’s made for RPi, but still exits with same error. Last log entry was “Starting up GPSD”

What could be wrong?

Did you get the gpsd to work?

Hi! I’ve had more than enough to do with other boat-electronics, but I’m hoping to revisit this soon :wink:

Hi DIYglenn,

I successfully installed and configured gpsd using “sudo apt-get install gpsd”. I then configured hass to get data from it by putting the following in the configuration:

sensor:
  - platform: gpsd

my problem now is that I can’t get hass to display and access individual values such as lat, lon, speed, etc.

I know they are there, because my hass installation is connected to influxdb, and I can see all the values there, but it would be stupid to have to extract the values from there. If anyone knows of a more direct way, please let me know

They are there as attributes. Use a template sensor.

So how is your installation set up? I guess you’re not using the Hassio image?

Nope. Using standard Buster. It runs a lot more than just Hass. Sorry, I have no experience with Hassio. Does it not let you connect the GPS?

What is your difficulty, I see all the data in your picture?

Hassio is a container, meaning it acts more like an app with plugins. You can’t use terminal for installing anything etc. The big plus is that everything is containerized/virtual, so very easy to update etc. I think I want to stick with that in the boat, so it’s simple and I don’t have to worry about keeping it up to date.
But it also means having to build a container with gpsd to run in portainer to be able to install anything else.

The problem has been solved. I think the discussion sidetracked, sorry.

How did you install your Home Assistant? Docker or env?

env. Post must be 10 characters, so here you go :))))

1 Like

I’m again revisiting this, trying to get more time to do “none-essential” electronics in my boat (I’m re-doing EVERYTHING).

Anyways, does HA installed as RPi image have any way to use a GPS for location and maybe also sending emails so I won’t have to have a separate container for that?

I do the “sending e-mail” part on a RPi “vanilla” image. I just use the SMTP platform:

Works great. I actually send an e-mail to the SMS message address for my cellular provider, so instead of an e-mail I get a text.

My thought on GPS data would be to get it from the NMEA bus. There are lots of folks playing with NMEA 2K and/or SignalK on a RPi. I could dig out some links I’ve saved somewhere if you’re interested.

The NMEA 2K network will be off when the boat is moored, but I have a USB GPS for the RPi which will always be online.
Will check out that SMTP service!