Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GeoLocation from gpsd

The gpsd program lets linux users cleanly organize their GPS peripheral data, such that a command line program like cgps or a graphical one like xgps can read the data, and write to a socket, like /var/run/gpsd.sock.

There's a nice tutorial on the net for rigging a raspberry pi to use this data. This is all well and good, but how can I integrate this data in firefox or chromium, as the geolocation API? Is there a specific build process I might need? For instance, setting a ./configure flag or something? Is there a way to integrate this data in a prebuilt version of either browser?

like image 708
Athan Clark Avatar asked Mar 14 '16 05:03

Athan Clark


People also ask

How do I turn off geolocation?

You can control what location information your phone can use. Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.

What is Gpsd in Linux?

gpsd is a GPS service daemon for Linux, OpenBSD and Mac OS X. There's also a Windows version. It can connect to GPS receivers via serial, USB port, Bluetooth, or via another gpsd through the network (TCP/IP connection).


2 Answers

Firefox on Linux supports gpsd - it was added in Firefox 4, removed in Firefox 23 and added back in Firefox 50.

However, it still needs to be enabled during build, with --enable-gpsd (which seems not to be the case yet in Ubuntu) and in the configuration, by following these steps:

  1. Navigate to about:config
  2. Create a new string preference, name geo.location.use_gpsd value true

Prior to Firefox 23, you had to:

  1. Create a new string preference, name geo.gpsd.host.ipaddr value localhost
  2. Create a new boolean value, name geo.gpsd.logging.enabled value true

Google Chrome had gpds support added in November 2011 and removed in October 2013. It looks like hardware GPS support is not a priority. If this was handled in Chrome OS, it might be possible to use the same mechanism, but I don't see support there either.

Someone built an extension which attempts to provide support in recent versions, requiring to install a script system-side.

like image 189
Cécile Bertau Avatar answered Oct 10 '22 06:10

Cécile Bertau


Firefox on linux used to support gpsd.

  1. Navigate to about:config
  2. Create a new string preference, name geo.gpsd.host.ipaddr value localhost
  3. Create a new boolean value, name geo.gpsd.logging.enabled value true

However, it seems that the gpsd support has been removed

Chromium seems to have had gpsd support in the past, but I can't find anything about it now. It looks like hardware gps support is not a priority. If this was handled in ChromeOS, it might be possible to use the same mechanism, but I don't see support there either.

In both cases, it should be possible to write an extension to fake the GPS coordinates, which could read from your real GPS.

like image 45
Thomas Zwaagstra Avatar answered Oct 10 '22 06:10

Thomas Zwaagstra