Using phone GPS from PC?

Is something like this even possible with SFOS??

LIke connect the phone to your PC via BT or USB and use its GPS.

And if yes how?

You can probably pipe gpscon | OpenRepos.net — Community Repository System output to your pc via ssh and some scripting, not sure about bt/usb

3 Likes

I’d prefer something more noob friendly TBH :grinning:

1 Like

without parameter gpscon will be in endless loop and print to stdout: Latitude; Longitude; Altitude

So all you need to enter on your PC is

ssh defaultuser@your_phone_ip gpscon

:person_shrugging:

1 Like

With this (and maybe some formatting):
GitHub - rkaczorek/virtualgps: Virtual GPS simulates GPS receiver available on pseudo terminal you should be able to trick your linux laptop into thinking it has gps (just get data from gpscon on device into format /etc/location.conf expects), on windows no idea

2 Likes

Instead of tricks and workarounds some sort of build in functinality for that would be a cool feature to have.

Enable it in the settings somewhere and have the PC use it.

You can do it with android afaik.

Not sure what the use case is here? Do you want the browser popup ‘share location?’ to work? Then hardcoding your coords in /etc/location.conf will suffice for that python virtual device script I believe. If you want to drive around and save your trip as gpx, gpscon will do that alone. Never had a laptop with gps receiver so not really sure what’s the point? In the end you just want the same data gpscon spews out fed into your laptop, there is no universal pseudo driver for linux/mac/windows that will do that for you by just plugging your phone into usb, so best we can do is figure out easiest way to get the data to the receiver (same with using your phone’s accelerometer or light sensor etc etc)
Edit: and pretty sure the ‘android can do that’ is just an app that does the same thing, register a pseudo device on PC side and pull sensor data from phone, never heard of android phones showing up as gps device in windows after just plugging in?
Edit2: oh and don’t get me wrong it would be a cool feature if every piece of hw was available through usb, you plug in your phone and your win/mac/linux pc asks you: would you like to use this device’s: camera, bt, gps, nfc, accelerometer, fingerprint reader, mic, sim cards… Definitely a cool feature

1 Like

Not tested, but gpsd is available in the jolla repos. It more or less was made for something like that:

It also has the gpsd-tools package which ships a ton of gps related tools like gpxtrack, gps2udp and many more.

3 Likes

The whole thing is probably just a case of gluing it all together.

Phone > BT > Laptop > Geoclue or something like that.