Boosting Linux Location Accuracy with a Local GPS Broadcast Server
Introduction
In today's digital ecosystem, applications and websites increasingly rely on location services to deliver context-aware features. Instead of requiring users to manually enter their coordinates, these tools automatically pinpoint a device's whereabouts—saving time and reducing friction. However, this convenience comes with an underlying dependency on robust location databases and services. For Linux users, the recent demise of the Mozilla Location Service has significantly degraded the accuracy of the Geoclue framework, which powers location awareness in many GNOME-based desktop environments.

The Problem: Why Geoclue Lost Its Way
Understanding Geoclue and Its Reliance on MLS
Geoclue is a location service daemon for Linux that provides applications—such as GNOME Maps, Firefox, and various mapping tools—with access to the user’s current geographic position. It aggregates data from multiple sources, including GPS hardware, Wi-Fi positioning, and cell tower triangulation. In many setups, Geoclue relied heavily on the Mozilla Location Service (MLS), a crowdsourced database that mapped Wi-Fi access points and cell towers to precise GPS coordinates. This allowed Geoclue to achieve location accuracy within a few meters, even on laptops without dedicated GPS receivers.
The Mozilla Location Service Shutdown in 2024
In 2024, Mozilla shut down MLS, citing the cost of maintaining the service and shifting priorities. The impact on Linux users was immediate and severe. Without MLS data, Geoclue’s accuracy plummeted—often dropping to a resolution of approximately 25 kilometers. For a user sitting in their home, the service might place them somewhere in the middle of a county, making location-aware features nearly useless. This sparked a search for alternative solutions, particularly among developers and power users who needed reliable positioning on local machines.
A Local Solution: Broadcasting GPS on the LAN
The Opportunity of a Static Network
Developer Evert Pot recognized a simple truth: most devices on a local area network (LAN) do not physically move around. A desktop computer, a server, or even a laptop docked at a desk has a fixed physical location. Instead of relying on external databases, why not broadcast that static location directly to Geoclue over the network? This approach would not only circumvent the MLS dependency but also guarantee consistent accuracy down to the building level—provided the LAN’s location was correctly configured.
How Geoclue Discovers Local GPS Servers
Geoclue actively looks for a specific network service using Multicast DNS (mDNS). The service must be advertised under the type _nmea-0183._tcp. When a device on the LAN publishes such a service, Geoclue attempts to connect to it and expects to receive GPS data in the standard NMEA 0183 format. NMEA 0183 is a widely used ASCII protocol for marine and GPS navigation devices. Each sentence typically starts with a dollar sign and a talker identifier, e.g., $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47—encoding latitude, longitude, altitude, and other navigation data.
Implementing a Local GPS Server with Python
Armed with this knowledge, Evert Pot crafted a simple Python server that continuously broadcasts a static set of NMEA 0183 sentences containing the LAN’s actual GPS coordinates. The server registers itself via mDNS as the required service type. Whenever Geoclue (or any other NMEA-capable client) connects, it receives the fixed coordinate stream. The implementation is lightweight: a few hundred lines of Python code using standard libraries like socket for TCP networking and pybonjour (or similar) for mDNS registration.
The key sentences broadcast typically include:

- $GPGGA (Global Positioning System Fix Data) – Contains latitude, longitude, fix quality, number of satellites, and altitude.
- $GPRMC (Recommended Minimum Specific GPS/Transit Data) – Contains time, date, speed over ground, and track angle.
- $GPGLL (Geographic Position – Latitude/Longitude) – Simpler position data.
By emitting these sentences at a standard interval (e.g., every second), the server mimics a real GPS device plugged into the network.
Results: Restoring Accuracy with Local Broadcasting
Testing with GNOME Maps and Firefox
After deploying the server, Evert tested the setup with GNOME Maps and Firefox (using Google Maps via the web). In both cases, Geoclue immediately picked up the broadcast service and reported the correct location—down to the specific house. Screenshots showed precise pinpointing, a stark contrast to the earlier 25 km uncertainty. The fix required no changes to the applications themselves; Geoclue transparently used the new local data source.
Limitations with Apple Devices
Interestingly, the same LAN broadcast did not work with Apple Maps on a Mac. The server was visible as an mDNS service, but Apple’s location framework ignored it. Only after turning off Apple’s Location Services entirely did the system fallback to other methods—though still not to the custom NMEA service. This suggests that Apple relies on its own proprietary equivalent of MLS (likely Apple’s Wi-Fi location database), and third-party NMEA servers on the LAN are not recognized by macOS’s core location engine. The solution is, therefore, primarily relevant for Linux environments.
Conclusion: A Resilient Approach for Linux Location
Evert Pot’s local GPS server demonstrates a clever workaround to the loss of MLS. By broadcasting static NMEA 0183 sentences over mDNS, any Linux machine running Geoclue can enjoy precise, building-level location accuracy without depending on external services. The approach is easy to implement, low-overhead, and perfectly suited for stationary devices like desktops, home servers, or IoT gateways. Users who often move their devices between fixed locations can even extend the idea by pre-configuring multiple static position sets or integrating a real GPS receiver for dynamic updates.
While the solution does not help with mobile laptops or Apple users, it fills a critical gap for the Linux desktop ecosystem. For those willing to invest a few minutes of setup, it restores a feature that many took for granted until the July 2024 MLS shutdown. Moreover, it highlights an important lesson: sometimes the best location service is the one you host yourself—on your own network, broadcasting your own unchanging coordinates.