Linux – Is it possible to provide local geolocation data

debiangeolocationlinuxnetworkingrouter

This may not be possible, but I thought I may as well ask.

I have set up my own local network, using a small computer running Debian Linux (Wheezy), which is acting as a wireless router.

What I'd like to know is whether it's possible to somehow provide geolocation data on the local network of where it is situated. This means I could define the location of my house as that's where I am situated.

I'll expand a bit more:

Say for example, on a smartphone, you visit a website and look for your nearest shop. You use the "locate me" feature, It will request your location, you allow it, then it accesses your GPS radio.

If you use a desktop computer with no GPS, it will provide your location (I'm presuming via geoIP data) from your IP address. For me, it's always wrong as it uses the location of the ISP.

I find it handy that some websites offer a "locate me" feature, and I'd like to use it when it's available on my desktop computer. One way I could utilize it would be to buy a USB GPS radio, but it seems a bit wasteful (using a port, consuming additional power, cost etc.).

That said, is it possible to setup some kind of service/daemon in my router where I can predefine the location (lon/lat, postcode, etc.) to be provided to local devices that are connected to the same network?

All help appreciated.

Best Answer

I'm not sure of a software program or change to your router that can do this. However, your web browser does have emulation options that can fake the GPS data to give you the desired results.

If you're using Google Chrome, you can press F12 to bring up an Developer window. Click on the blue icon on the top right of the developer frame. Then click on the Emulation tab. In the Sensors option, you can Enable Geolocation Coordinates.

enter image description here

Related Question