How to Activate I2C and UART on Android 6 with Ublox M8N GPS


(Chong Thien Pow) #1

I have just received the Ublox M8N, connected the I2C and UART, but I can’t get the Ublox UCenter app to read the data from I2C… did the Android 6 we have has support for I2C?

Update

Thanks to @BPI_Justin Justin Chen from BPI, Answer found and solved!

as shown in the pic above, the Ublox M8N GPS is detected as built-in GPS.

to get the UART working for PB0(pin 8, TX) and PB1(pin 10, RX) must modify the sys_config.fex and change the uart2_used = 0 to become 1 as shown below:

[uart2]
uart2_used       = 1
uart2_port       = 2
uart2_type       = 2
uart2_tx         = port:PB0<2><1>< default>< default>
uart2_rx         = port:PB1<2><1>< default>< default>
uart2_rts        = port:PB2<2><1>< default>< default>
uart2_cts        = port:PB3<2><1>< default>< default>

put the GPS driver source to the device folder: android/device/softwinner/bpi-m64-hdmi

then add the following line to bpi-m64-hdmi.mk

#gps $(call inherit-product, device/softwinner/bpi-m64-hdmi/gps/gps.mk

and then rebuilt and repack.

after flashed into the eMMC and booted up, then do the following

adb devices
adb root
adb remount
adb shell

after inside the shell type the following and press enter: setenforce 0

then reboot the device again, it will be detected.


(bpi team) #3

please send mail to : lionwang@banana-pi.com


(Edmilson Junior) #4

Hi. I’m try to the same, but with ublox neo M6 Can you explain better the part of put gps driver source to the device folder? And i did not found the bpi-m64-hdmi.mk

i’m using the imgeRepacker to extract


(柠檬小妖) #5

Hello Chong_Thien_Pow:

   I want to use M3 to accept GPS data, i connected the gps pins to the uart2,also i have must modify the sys_config.fex and change the uart2_used = 0 to become 1 as shown below:

[uart2]
uart2_used = 1
uart2_port = 2
uart2_type = 2
uart2_tx = port:PB0<2><1>< default>< default>
uart2_rx = port:PB1<2><1>< default>< default>
uart2_rts = port:PB2<2><1>< default>< default>
uart2_cts = port:PB3<2><1>< default>< default>

but i can not accept data from the ttys2.

Where did you get the gps driver source? For the M3 , the file is bpi-m3-hdmi.mk ? and where i could find the file? thank you


(Naish) #6

Nice, but I have a little problem: in the source that i was downloaded has no device/softwinner/bpi-m64-hdmi/gps/gps.mk btw device/softwinner/bpi-m64-hdmi/gps also missed. where can get the gps folder and its content?


(John Wong) #7

You need to get gps driver yourself.I use this driver :https://github.com/zxcwhale/android_hal_gpsbds,and it is work for me!