Skip to content

Conversation

@Lolmc0587
Copy link

No description provided.

@huakim
Copy link

huakim commented Jul 12, 2025

Thanks! I have merged this to my forked repository

@onny
Copy link

onny commented Jul 14, 2025

Thanks for the PR.

Tried to use it on my postmarketOS Linux phone

  1. Starting a fake GPS stream
virtualgps.py -c virtualgps.conf -p warsaw --verbose
Streaming virtual location (Lat: 52.13791, Lon: 21.00704, El: 100.0) to serial GPS device /dev/pts/3
  1. configured gpsd
cat /etc/conf.d/gpsd 
GPSD_OPTIONS="-n -D 1"
DEVICES="/dev/pts/3"
  1. started gpsd
sudo rc-service gpsd start
  1. installed gps with your waydroid_script fork
    supplied /var/run/gpsd.sock with baudrate 9600
  2. opened comaps on waydroid but cant get any position

@onny
Copy link

onny commented Jul 14, 2025

@Lolmc0587 updated my comment, not yet working for me

@Lolmc0587
Copy link
Author

Have you updated your LineageOS version to the latest or added the dialout group? Mine works perfectly on Ubuntu.
If it doesn’t work, can you send me the waydroid_logcat.log?

@onny
Copy link

onny commented Jul 14, 2025

Yes it's running Android 13 now. On the host system (postmarketOS/Alpine Linux) I added my user to the dialout group.

Maybe I'm going to test it on my desktop PC first (NixOS)

umount("system", copy_dir)

container.upgrade()
container.upgrade()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be offset?

# lxc.mount.entry = /dev/ttyGPSD dev/ttyGPSD none bind,create=file,optional 0 0

with open(config_nodes, "a") as f:
f.write(f"lxc.mount.entry = {self.gps_host} dev/{self.usb_name} none bind,create=file,optional 0 0\n")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i do container.upgrade(), this config will be reset.
i don't know how to solve this, so in this case it must be that

@doeni98
Copy link

doeni98 commented Sep 2, 2025

Thanks for your work!

Unfortunately this does not work for me either. I tried using it with the gpsfake tool since I have no gps receiver laying around. Running on Ubuntu 24.04 and waydroid 1.5.4

What I did:

GPS NMEA file to feed:

$GPGGA,192420.216,5231.722,N,01324.570,E,1,12,1.0,0.0,M,0.0,M,,*63
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192420.216,A,5231.722,N,01324.570,E,909.9,029.7,020925,000.0,W*7E
$GPGGA,192421.216,5231.941,N,01324.776,E,1,12,1.0,0.0,M,0.0,M,,*6D
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192421.216,A,5231.941,N,01324.776,E,1201.5,354.6,020925,000.0,W*46
$GPGGA,192422.216,5232.273,N,01324.725,E,1,12,1.0,0.0,M,0.0,M,,*61
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192422.216,A,5232.273,N,01324.725,E,1425.3,004.1,020925,000.0,W*4D
$GPGGA,192423.216,5232.668,N,01324.771,E,1,12,1.0,0.0,M,0.0,M,,*6F
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192423.216,A,5232.668,N,01324.771,E,1403.4,004.6,020925,000.0,W*47
$GPGGA,192424.216,5233.056,N,01324.822,E,1,12,1.0,0.0,M,0.0,M,,*6B
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192424.216,A,5233.056,N,01324.822,E,908.1,006.4,020925,000.0,W*71
$GPGGA,192425.216,5233.307,N,01324.869,E,1,12,1.0,0.0,M,0.0,M,,*62
$GPGSA,A,3,01,02,03,04,05,06,07,08,09,10,11,12,1.0,1.0,1.0*30
$GPRMC,192425.216,A,5233.307,N,01324.869,E,908.1,006.4,020925,000.0,W*78

Run the gpsfake service:

sudo gpsfake --speed 9600 --slow <nmea data file>.nmea -D4

(...)
gpsd:INFO: <= control(8): adding /dev/pts/14
gpsd:INFO: stashing device /dev/pts/14 at slot 0
(...)

Setup waydroid (lineage-20.0-20250809-MAINLINE-waydroid_x84_64):

sudo waydroid init

Install the gps using your script:

sudo ./venv/bin/python main.py
-> Android 13
-> Install
-> gapps, gps
-> /dev/pts/14
-> 9600

Then waydroid session start and waydroid show-full-ui but there is no location available in any navigation app (google maps, OsmAnd).

@Lolmc0587
Copy link
Author

I haven't tried the gpsfake yet. I will have a look at it.

@Lolmc0587
Copy link
Author

Maybe that will works

@Lolmc0587
Copy link
Author

Lolmc0587 commented Sep 3, 2025

Please don't use that pts device, you can set the fake gps device to like /dev/ttyGPSD
If you can't, follow the command below

sudo ln -s /dev/pts/<yourdevice> /dev/<nameyouwant>
sudo chmod 777 /dev/<nameyouwant>

@doeni98
Copy link

doeni98 commented Sep 3, 2025

Did not find any way from the gpsfake docs to specify the tty device path. Anyhow with the symbolic link it works like charm!

Thank you very much!

@mburucuyapy
Copy link

will this also read from /dev/ttyACM0 or just GPSD?

@Lolmc0587
Copy link
Author

Lolmc0587 commented Sep 9, 2025

will this also read from /dev/ttyACM0 or just GPSD?

Yeah
Just don't use /dev/pts/..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants