How to get accurate localization with Firefox or others when using a map with a PC using an ethernet cable

IF you use a PC connected to the internet with an Ethernet wire, then geoclue uses your IP to localize you on a map. The error is about several Km.
For example, if you live in a town, geoclue localizes you in the center of this town, several km away from your home.

If you want a better localization (error = 10 to 20 m)
then
add a WiFi card or dongle
and
just activate the Wi-Fi with Networkmanager plasmoid. No need to be connected to Wi-Fi. Just activate.

1 Like

Sorry, but I do not understand what the question is.

It is not a question. It is a HOWTO.

You cannot - it is always the location of the ISP or the VPN you use for your “location”.
My VPN says Seattle, Atlanta or Dallas depending on when I connect. My ISP is 70 miles away in another state.
I have to enter my Zip code every time to say where I am when I shop anywhere.

The wifi does not know any location - it just scans for wifi routers to report about.
The most accurate way is to attach the wifi to your cell phone. Some cell phone providers use the tower location your phone is pinging for your location - some do not and say Kansas City or Atlanta.

Thanks

So the solution is not for everyone.

For the others, how to attach the Wi-Fi to the cell phone ?

You create a hotspot with your cellphone where other devices can connect to.

Once upon a time you could have geoclue installed and geoclueshare app installed on your android and get gps location from the phone over the wifi (mDNS/DNS‐SD).

If you use NetworkManager and have geoclue installed, you can run a script in your /etc/NetworkManager/dispatcher.d/ and put static lat long in /etc/geolocation when you connect to some known wifi like your own at home.

The definition of the problem is “you use an Ethernet cable, you don’t want to use a Wi-Fi for connecting to internet”

Yes “Once upon a time”.

I tried this solution without any success.

@promeneur:

Attach a GPS/GLONASS receiver to the Linux box and, install the “gpsd” package …

I tried this solution without any success.

The solution I use now by just activating Wi-Fi works well for me and is simple.

Which Desktop Environment?

  • GNOME?
  • KDE Plasma?
  • Something else?

At lease some KDE Plasma applications and Plasmoids support GPS data input – for example “Night Color”.

KDE

I used

  • DIYmalls G72 G

1546:01a8 U-Blox AG [u-blox 8]

Perhaps a bad initialization of the dongle. It’s too techie to use ubxtool.

  • gpsd

in /etc/sysconfig/gpsd file the options of the gpsd command parameters are not assigned


Whether or not to start gpsd automatically on plugin event

GPSD_STARTBYUDEV=“no”

Type: string

Default: “”

Further options to gpsd

GPSD_OPTIONS=

Type: integer

Default: 2947

Use different port for the daemon

GPSD_PORT=


What value for “OPTIONS” ?
What value for “DEVICES” ?
Today there is no more /dev/USBx or /dev/ttyACM0. How to find the right value ?

Night color does not use the GNSS dongle because with or without the dongle it uses the same coordinates.

I assume the location is supplied by networkmanager

I tried “/usr/sbin/gpsd -D 5 -N /dev/ttyACM0”

but I get this


:~> sudo head /dev/ttyACM0
[sudo] Mot de passe de root :
$GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E

$GNTXT,01,01,02,HW UBX-M8130 00080000*61

$GNTXT,01,01,02,ROM CORE 3.01 (107888)*2B

$GNTXT,01,01,02,FWVER=SPG 3.01*46

$GNTXT,01,01,02,PROTVER=18.00*11


and this


x gpsd.service - GPS (Global Positioning System) Daemon
Loaded: loaded (/usr/lib/systemd/system/gpsd.service; enabled; preset: disabled)
Active: failed (Result: timeout) since Wed 2023-11-22 13:56:46 CET; 3min 2s ago
TriggeredBy: * gpsd.socket
Process: 9401 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
CPU: 112ms

Nov 22 13:56:46 grincheux systemd[1]: gpsd.service: start operation timed out. Terminating.
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:WARN: received terminating signal 15.
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:INFO: CORE: closing /dev/ttyACM0, fd 9
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:IO: SER: gpsd_close(/dev/ttyACM0), close(9)
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:PROG: CORE: no /etc/gpsd/device-hook present, skipped running DEACTIVATE hook. No such file or directory(2)
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:WARN: exiting.
Nov 22 13:56:46 grincheux gpsd[9401]: gpsd:INFO: detaching ::1 (sub 0, fd 8) in detach_client
Nov 22 13:56:46 grincheux gpsd[9401]: SHM: shmctl(12) for IPC_RMID failed, Operation not permitted(1)
Nov 22 13:56:46 grincheux systemd[1]: gpsd.service: Failed with result ‘timeout’.
Nov 22 13:56:46 grincheux systemd[1]: Failed to start GPS (Global Positioning System) Daemon.

  • gpsd.socket - GPS (Global Positioning System) Daemon Sockets
    Loaded: loaded (/usr/lib/systemd/system/gpsd.socket; disabled; preset: disabled)
    Active: active (listening) since Wed 2023-11-22 13:47:52 CET; 11min ago
    Triggers: * gpsd.service
    Listen: /run/gpsd.sock (Stream)
    [::1]:2947 (Stream)
    127.0.0.1:2947 (Stream)
    Tasks: 0 (limit: 4915)
    CPU: 981us
    CGroup: /system.slice/gpsd.socket

Nov 22 13:47:52 grincheux systemd[1]: Listening on GPS (Global Positioning System) Daemon Sockets.


With

GPSD_OPTIONS=“tcp://localhost:2947”

OPTIONS=“-D 5 -N”

DEVICES=“/dev/ttyACM0”

There is no more problem with gpsd service start.

I get some info from the gnss dongle with xgps :
NO FIX
Sats seen : 6
not any other data (not any coordinates)

see the capture

i initialise the gnss dongle with

:~> export UBXOPTS=“-P 18 -v 2”

ubxtool -p RESET

:~> ubxtool -e NMEA

:~> sudo head /dev/ttyACM0
$GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E

$GNTXT,01,01,02,HW UBX-M8130 00080000*61

$GNTXT,01,01,02,ROM CORE 3.01 (107888)*2B

$GNTXT,01,01,02,FWVER=SPG 3.01*46

$GNTXT,01,01,02,PROTVER=18.00*11

:~> sudo cat /dev/ttyACM0
$GNTXT,01,01,02,u-blox AG - www.u-blox.com*4E

$GNTXT,01,01,02,HW UBX-M8130 00080000*61

$GNTXT,01,01,02,ROM CORE 3.01 (107888)*2B

$GNTXT,01,01,02,FWVER=SPG 3.01*46

$GNTXT,01,01,02,PROTVER=18.00*11

$GNTXT,01,01,02,GPS;GLO;BDS*06

$GNTXT,01,01,02,QZSS*58

$GNTXT,01,01,02,GNSS OTP=GPS;BDS*26

$GNTXT,01,01,02,LLC=FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFF-FFFFFFFD*2F

$GNTXT,01,01,02,ANTSUPERV=AC SD PDoS SR*3E

$GNTXT,01,01,02,ANTSTATUS=OK*25

$GNTXT,01,01,02,PF=3FF*4B

$GNVTG,N*2E

$GNGGA,0,00,99.99,*56

$GNGSA,A,1,99.99,99.99,99.99,1*33

$GNGSA,A,1,99.99,99.99,99.99,4*36

$GPGSV,1,1,00,0*65

$GBGSV,1,1,00,0*77

$GNGLL,V,N*7A

$GNRMC,V,N,V*37

$GNVTG,N*2E

$GNGGA,0,00,99.99,*56

$GNGSA,A,1,99.99,99.99,99.99,1*33

$GNGSA,A,1,99.99,99.99,99.99,4*36