GPS uart on android

Hi to all.
Has anyone managed to connect the gps module to Rock Pi 4?
I’m trying to connect u-blox neo-7m, but there are difficulties.
cat /dev/ttyS4 displays the receipt of NMEA data.
But there’s no “satellite” in settings - location and navigation programs do not find my locations.
What am I doing wrong?

I think HAL also needs to be compatible with your GPS device.

u may need to add some additional code
path must be changed to your needs

added to device/rockchip/rk3399/

-include vendor/quectel/ec25/

BUILD_WITH_EC25 := true

in device/rockchip/rk3399/
$(call inherit-product-if-exists, vendor/quectel/ec25/


ifeq ($(BOARD_HAS_GPS),true)
        android.hardware.gnss@1.0-impl \

            vendor/quectel/ec25/gps/ \   #Hardware Related Driver
            vendor/quectel/ec25/gps/gps_cfg.inf:system/etc/gps_cfg.inf \    #Optional Harware related
            vendor/quectel/ec25/gps/gps.cfg:system/etc/gps.cfg \  #Optional Harware related
            frameworks/native/data/etc/android.hardware.location.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.xml \

    PRODUCT_PROPERTY_OVERRIDES += \ \     # change to the tty you use** \      # depends on Hardware 9600-115200**

also add to manifest.xml

<manifest version="1.0" type="device" target-level="3">
    <hal format="hidl">

add to init.rc

# hardware/interfaces/gnss/1.0/default/android.hardware.gnss@1.0-service.rc
service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service
    class hal
    user gps
    group system gps radio


# for GPS
#/dev/ttyX                0600   gps        gps

my Modem/GPS (Quectel EC25) runs via mini PCIE and it uses ttyUSB instead of UART

1 Like

Thanks for your answer.
In principle, I understand. Only two question:

  1. Where to get the contents of the vendor folder (vendor/quectel/ec25). And as I understand it - this content should be different for me? I have a u-blox neo-7m module.
  2. Where is the ueventd.rc located?

/vendor/quectel/ec25 is Hardware related.
usually you should have a driver provided by HW Vendor such as
For U-Blox Hardware you have to change it to your needs.

ueventd.rc is located in

on Linux you can find file via:

find . -name “filename”

1 Like

Bottom line is that for GPS, you need a HAL that is compatible with your gps hardware.

Most GPS will work with GPSd, which has an Android HAL:

Would I need a root access to install GPSd to Android?
If so, how do I go about getting root access please?

I would also like to add a compass and other IMU sensors (that would be I2C) and make use of them in say Google map, how should I go about doing this?

Sorry, I’m a newb and inexperienced in Android.

I think I got the root access figured out.

adb shell

I got my GPS module connected to UART2.
But doing so causes android to freeze soon after booting.
Is that because UART2 is used as serial console by default?
How do I configure UART2 to use with GPS?