r/OsmAnd • • 22d ago

Can OSMAnd+ accept external GPS tracking?

Came to ask a question related to this old thread:

https://old.reddit.com/r/OsmAnd/comments/1hx91zk/external_gps_receivers/

Is it in fact possible to get OSMAnd+ to use an external source for GPS? For example, one of these:

https://www.dualav.com/product/gps-solutions/gps/xgps150a-universal-gps-receiver

(Dual XGPS-150A)

or one of these:

https://www.dualav.com/product/gps-solutions/gps/xgps160-skypro-gps-receiver/

(Dual XGPS-160)

?

Looking at OSMAnd+ on my phone, I don't see any obvious way to get it to use a GPS source other than the phone's. The only options for anything external are ANT+ heart rate and cycling-related sensors, in the External Sensors plugin.

I looked in the official OSMAnd+ docs, but can't find anything related to external sensors outside the above.

FWIW, I do have the paid version of OSMAnd+.

Is this one of those things where the option doesn't show up unless you have the external GPS source connected? I haven't bought such a source yet.

Reason I'm asking: I'm shopping for an Android Auto display or possibly tablet to use for navigation on a motorcycle. My phone kinda sucks at GPS. It'll sometimes lose track for no clear reason, especially when I'm off the cellular network.

Ideally, I would run OSMAnd+ on the phone, have it use something like the XGPS-160 for GPS tracking, then display OSMAnd+ on the Android Auto screen.

6 Upvotes

15 comments sorted by

5

u/Kumba42 22d ago

It can, as I use this setup in my car. You need the GPS Connector app, unlock it w/ a one-time in-app purchase, and then you need to enable "Mock location" under developer settings and assign GPS Connector as the mock app. Last, you have to figure out what serial chip the specific external GPS device uses and you set that in GPS Connector at the appropriate baud rate (e.g., pl2303 @ 115200bps for the one I use). You have to connect that external device via a cable that supports USB OTG as well.

That app then feeds the internal GPS service the data from the external GPS device. When you disconnect that device, the internal GPS takes back over and you can just swipe the notification from GPS Connector away to close it.

Note that running OsmAnd+ with an external GPS attached can drain the phone's battery faster than the phone can charge, especially if you have hillshading enabled in OsmAnd+ and you drive around mountainous terrain, as that causes the phone's GPU to run hot and drink power. I use a Pixel 9 as a dedicated "mapping phone", and it can draw power at ~25W, I think, and when driving in the mountains, I can actually get a slow battery drain from the phone having high GPU usage alone, while it's plugged into an Anker car adapter that feeds ~45W power to the phone and also powers the external GPS. On flat terrain, it's not an issue at all.

I use a StarTech HB31C3A1CDPPD3 to solve these issues (more or less). I plug that into my phone, the Anker car power adapter plugs into the dedicated USB PD port on the back, the GPS plugs into one of the USB-A ports, and I run a USB C DP-Alt Mode cable from the dedicated video-out port to an OttoCast Mirror Touch to get my phone's screen up onto my infotainment display. Image attached shows how this all plugs together visually:

1

u/RedditWhileIWerk 21d ago edited 21d ago

Thank you, appreciate the additional detail. OSMAnd+ support outlined the procedure but of course couldn't address the specific hardware.

Next thing I was going ask is, if using an Android Auto screen to do the displaying would help with the power usage. Sounds like "No" because the phone GPU is still doing the heavy lifting?

Which external GPS device are you using? pl2303 is the USB-to-serial device, yes?

I'm looking for alternatives. I'm not too keen on buying the XGPS150A specifically, because it is quite an old design at this point. I don't really want a device that needs a USB Mini charging cable/adapter, plus it only updates at 1 Hz.

2

u/Kumba42 21d ago

I can't answer about using Android Auto, as I completely bypass that. It wants way too many permissions. I use an OttoCast MirrorTouch to mirror my phone's screen directly to my car's infotainment head-end unit via USB cables. I can even do touch input from the infotainment screen that passes straight to the phone, though it's a bit janky at times (I think it's more the low sensitivity of my car's infotainment screen). If you try this route, you might also need OrientationLock to force the screen to rotate to landscape, as most car infotainment screens use that format.

For the GPS, I am using a Navisys GR-M02U, which I stuck into a small tray I added that fits right behind the infotainment screen on the dashboard. It uses a PL2303 serial chip to communicate via USB, so in GPS Connector, that's the driver I had to use. Was a bit tricky to coil all the USB cables up and tuck them away using glue-on clips, and I still need to redo several clips, because car plastics seem to be very resistant to adhesives, but the overall plan worked out quite well.

Also, the updating at 1Hz thing is possibly configurable, but finding the manufacturer-specific tool to do so can be tricky. The Navisys GR-M02U also defaults to 1Hz updates, but I used the manufacturer's tool, NaviViewerAh, to configure the device to use faster updates, 5MHz specifically (but it can do up to 10Hz), as well as enable/disable specific GNSS satellite families.

I'll also add that the GR-M02U is a touch power hungry and can be slow to warm up and find satellites, sometimes needing ~30s, sometimes needing 2-3 minutes. Seems random, but I think also temperature based, with the longer times on cold days, though I've had to sit in my car for a few minutes waiting for it to get a lock on hot summer days. Minor issue for me, but might be something to consider.

There's another Navisys model, the GR-U01U, that I think uses a bit less power and uses a Ublox chipset (unsure what driver in GPS Connector). Faster update rate, but I don't know if it's faster than the other model at finding satellites for the initial lock. I thought about swapping out, but decided to stick with the GR-M02U for the time being.

1

u/RedditWhileIWerk 21d ago edited 21d ago

The use case I have in mind is for navigation on a motorcycle, so ...not much room for cabling or devices such as USB hubs.

I do have a 12V USB PD charger on the bike, which can supply up to 45W. It has both USB C PD and USB A QC outputs. That should serve the same function as your StarTech hub + charger for power. However I'd need external GPS to have Bluetooth for connection to phone. Unless there is such a thing as a dongle/small adapter that would both pass through both power for charging, and allow a USB OTG connection.

There do exist all-in-one navigation/TPMS/dashcam, full-up Android screen devices in the motorcycle world, but so far I can't find one I like all that much. The dedicated GPS + TPMS devices from the likes of Garmin cost more than I want to spend, and also you're locked into Garmin's software ecosystem (which by some reports is garbage). Thus the idea to add external GPS to fix the deficiencies of phone GPS, then display the result on an inexpensive AA screen.

you might also need OrientationLock to force the screen to rotate to landscape, as most car infotainment screens use that format.

fighting Android because it prefers "portrait" orientation by default, is one reason I'm not keen on using a phone for a navigation device (in the sense of primarily using the phone's display). That's one nice thing about AA screens: they generally are locked to "landscape" orientation, and no other orientation is usually even possible.

2

u/Kumba42 21d ago

I do have a 12V USB PD charger on the bike, which can supply up to 45W. It has both USB C PD and USB A QC outputs. That should serve the same function as your StarTech hub + charger for power. However I'd need external GPS to have Bluetooth for connection to phone. Unless there is such a thing as a dongle/small adapter that would both pass through both power for charging, and allow a USB OTG connection.

Dig around on StarTech's website and see if they might have that kind of dongle. They have a variety of weird USB gizmos, so you might find something. I feel like the hub I found was just dumb luck, because I honestly didn't think something like that existed. It's also not that big of a device, so it could still be useful to you if you were clever on placement to get power and GPS to the phone. Slap some strong velcro on the back of it and it can mount anywhere. The connector pigtail on it is about ~6" long, so it gives some options.

For the GPS device, look around on GPSWebShop, as they have a large variety of GPS-specific devices, so there might be something more relevant to your needs there as well. They're a small outfit in Canada, though, so if you're in the US, expect to pay the silly import tariff (was about ~$5 for the GR-M02U).

 

fighting Android because it prefers "portrait" orientation by default, is one reason I'm not keen on using a phone for a navigation device (in the sense of primarily using the phone's display).

OrientationLock will solve that problem for you. It will lock the screen to the mode you set it to once you grant it the special "draw over other apps" permission. The only concern with it is it hasn't been updated in two years, so at some point, Android's rolling target SDK version thing will make it more difficult to install, on top of the developer verification nonsense that Google's enabled by now (my mapping phone is a Pixel 9 running GrapheneOS, so it is unaffected by developer verification).

Another option is to use a launcher that supports home screen rotation. Nova Launcher is what I use on all of my phones and it has that option. But you'll want to consider firewalling it because the company that owns it added AI stuff and it constantly tries to phone home in the background, but they're pretty relaxed and don't hinder the app if it can't phone home. If you need a firewall app, give ReThink a look.

1

u/RedditWhileIWerk 16d ago edited 16d ago

The two devices by Dual Electronics, plus the Garmin GLO 2, seem to be absolutely the only Bluetooth-capable GPS receivers available. That's disappointing, because I don't care for any of the 3.

No reason to order from GPSWebShop, not rolling the tariff dice. No need, I have the same GPS device selection here in the States.

There may be no such animal as a USB C power/data passthrough adapter, far as I can tell. Closest thing is, dongles to let you plug in 3.5mm audio while also charging via USB C, for phones missing a headphone jack.

This thing:

https://www.amazon.com/AreMe-Headphone-Adapter-Charging-Splitter/dp/B0DC51W9YC

might be the thing, but I'm not sure yet.

1

u/RedditWhileIWerk 7d ago edited 7d ago

I got an inexpensive external GPS receiver (VK-172, uBlox series 7000 chipset), installed the GPS Connector app, did all the configuration things you mentioned. OSMAnd+ only says "position not yet known."

I can see in the GPS Connector app that the VK-172 is tracking 10+ satellites and getting a position solution, but OSMAND+ isn't ingesting the position. Why?

Same problem on two Android devices, one a phone, one a tablet.

What's the secret?

2

u/Kumba42 4d ago

If GPS Connector is talking to the device, and you can even see the raw GNSS/NMEA messages in it (the third icon on the left-hand side), then at least you have the serial connection working. That means the likely culprit is you don't have Mock location set right.

You have to first enable mock location under developer options, then you have to choose an app to provide the mock location. Select "GPS Connector" as that app. That will then enable it to feed the GNSS/NMEA datastream to the system location service (or whatever Android calls it), then all location-aware apps should JustWork™.

Also double-check that OsmAnd+ has the location permission and that location access is turned on (if you toggle it on or off at times). If it all works, tapping the location button in OsmAnd+ should zero in on your position.

1

u/RedditWhileIWerk 4d ago

Did all that, and yes I do get an NMEA stream from the VK-172 in GPS Connector.

If the device (for instance, phone) has its own GNSS, will I see satellites from that as well as from the external receiver at the same time, or is it an either/or thing?

2

u/Kumba42 4d ago

I think it is an either-or thing. When the external GPS is plugged in and GPS connector is active, it will be the source of GPS data. Once you unplug the external device and swipe away GPS Connector, then the internal GNSS device becomes the source.

Only other thing I can think of is, in GPS Connector, go into its Settings, find the "Mock location" section, and make sure it is toggled on. Might have to go back one screen after entering settings.

1

u/RedditWhileIWerk 4d ago

That's how I understand it as well. You either use the device's own GNSS, or that supplied by the external receiver.

4

u/zmeuka OsmAnd CMO 21d ago

On iPhone/iPad the Dual receivers work out of the box: iOS hands their position to every app. On Android, OsmAnd uses the system location, so an external Bluetooth/USB receiver needs a bridge app (e.g. GPS Connector or Bluetooth GPS) set as the mock location app in Developer options, as Kumba42 described. Android Auto then shows that same position.

2

u/RedditWhileIWerk 21d ago

Yes, that's exactly what OSMAnd+ support said too! Thanks!

3

u/etk300ex 22d ago

I use a non-cellular iPad and a Dual XGPS150 with Osmand. Works great! Just connect the Dual via Bluetooth and open Osmand. I have used the Dual with my phone before but I don't recall if I had to do anything specific. I can assure you it wasn't hard to figure out.

2

u/RedditWhileIWerk 22d ago edited 7d ago

So OSMAnd+ will use the Dual's GPS feed ..automagically? Interesting.

I guess it's worth a shot, thanks!

update: It is not this simple on an Android tablet. You need some other app to pass the external GPS receiver's location to OSMAnd+. Working on that.