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/BoardConfig.mk

-include vendor/quectel/ec25/BoardConfigPartial.mk

BUILD_WITH_EC25 := true
BOARD_HAS_GPS := true
BOARD_HAVE_DONGLE := false

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

................

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

    PRODUCT_COPY_FILES += \
            vendor/quectel/ec25/gps/gps.default.so:vendor/lib64/hw/gps.default.so \   #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 \
            frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml

    PRODUCT_PROPERTY_OVERRIDES += \
        ro.kernel.android.gps=ttyUSB1 \     # change to the tty you use**
        ro.kernel.android.gps.speed=115200 \      # depends on Hardware 9600-115200**
        ro.kernel.android.gps.max_rate=1
endif 

also add to manifest.xml

<manifest version="1.0" type="device" target-level="3">
    <hal format="hidl">
        <name>android.hardware.gnss</name>
        <transport>hwbinder</transport>
        <version>1.0</version>
        <interface>
            <name>IGnss</name>
            <instance>default</instance>
        </interface>
    </hal>
</manifest>

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

ueventd.rc

# for GPS
#/dev/ttyX                0600   gps        gps

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

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 gps.default.so
For U-Blox Hardware you have to change it to your needs.

ueventd.rc is located in
/system/core/rootdir/ueventd.rc

on Linux you can find file via:

find . -name “filename”