GPS module(receiver) for android

Which system do you use? Android, Ubuntu, OOWOW or others?

Android

Which version of system do you use? Khadas official images, self built images, or others?

latest official android image

Please describe your issue below:

Hello, I am lookung for a gps module for egde2 on android os. Could you recommend any modules that will work 100% with egde2? I need it for my car project (for google maps etc.).
P.s. also I have a edge2 IO module, and maybe it can be used to connect gps module with egde2

Hello @Emil_902

@goenjoy @xiong.zhang will help you here.

Thank you. @goenjoy @xiong.zhang can you help me?

@Emil_902 You can use a USB GPS module. However, the firmware currently does not support GPS functionality. You need to add it yourself. I will provide instructions on how to add GPS functionality.

Hello @goenjoy

Can you help me to provide instruction on how to add GPS?

Thank you!

@AngelBBB Are you using a USB GPS module?

@goenjoy Yes, i am using module USB GPS.

@AngelBBB We have separately uploaded the warehouse code that supports USB GPS related directories for you. You only need to synchronize the code.

1 Like

Hello! I have a U-blox M8030-KT GPS usb dongle. When I connect it to khadas edge2 it needs confirmation every time to use it. I checked the save settings box, but after a reboot, khadas again asks for permission to use USB. The same problems are observed when connecting USB iODD st400 (SSD samsung 2Tb) and USB 3.0 Video capture. How to solve the problem so that when connecting external USB devices, khadas does not ask for permission?

@magetra Can you take a photo and see the pop-up information for me? Alternatively, you can make the following code modifications for verification.

frameworks/base$ git diff
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index d6c52ca4cd31..7db63f38c8cf 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2552,7 +2552,7 @@
 
     <!-- If true, then we do not ask user for permission for apps to connect to USB devices.
          Do not set this to true for production devices. Doing so will cause you to fail CTS. -->
-    <bool name="config_disableUsbPermissionDialogs">false</bool>
+    <bool name="config_disableUsbPermissionDialogs">true</bool>

Iā€™m not good with android commands. Can you explain to me in which program to enter these commands, I will do

I recorded a video for you and took a photo of the GPS program itself
https://drive.google.com/drive/folders/1VY0aMkl-NU_u7y5g0PGr1TzFkR2tDplC?usp=sharing

@magetra You need to download the code SDK to compile and download firmware. Alternatively, you can use ADB to push my compiled file(framework-res.apk) to your machine:

C:\Users\25348>adb root && adb remount
remount succeeded

C:\Users\25348>adb push W:\edge2_new\out\target\product\kedge2\system\framework\framework-res.apk system/framework/framework-res.apk
W:\edge2_new\out\target\product\kedge2\system\framework\framework-res.apk: 1 file pushed. 18.0 MB/s (51227915 bytes in 2.710s)

C:\Users\25348>adb shell sync

C:\Users\25348>adb reboot

Thank you very much! You solved my USB permission problem! I am very happy!!!

Tell me please, where can I see the code that you added, I downloaded the Android source code, as it is written at this link:
https://docs.khadas.com/products/sbc/edge2/development/android/download-android-source-code
But I did not see the added code for the GPS there.

@denbon

device/khadas/common$ git log --grep=gps
commit 40b1aa1d3a9bd503eeaa3e6a84597389bd419d95
Date:   Sun Apr 23 11:50:43 2023 +0800

    gps: add usb gps support [1/3]
    external/libgps [2/3]
    hardware/interfaces [3/3]

goenjoy Please tell me, is it enough to make changes to the two files device.mk and ueventd.rockchip.rc for the u-blox Gps to work. Isnā€™t it still necessary to add it to the kernel config kedge2_defconfig
CONFIG_GNSS=m
CONFIG_GNSS_SERIAL=m
CONFIG_GNSS_UBX_SERIAL=m

@denbon Is your GPS module a USB interface? If so, the default code or firmware supports it. No modification required.

goenjoy
Ok, I have a U-blox GPS module, it has both USB and UART.
I wanted to clarify two more questions:

  1. In the common/BoardConfig.mk file, the value BOARD_HAS_GPS := false should not be changed to true either
  2. And via UART, this GPS can be somehow connected

@denbon
1ļ¼ŒNo need.
2ļ¼ŒPlease refer to the following link for hardware connection. There are a lot of modifications needed in the software, such as changing the uart debug port to a regular uart function. We have not yet verified uart GPS.