10-04-2017, 06:27 PM
(This post was last modified: 08-27-2018, 06:23 AM by lobo. Edited 5 times in total.)
Hello there,
I would like to share this GPS library. I worked on it last time, but I was not yet able to test it in my car. I don't remember where I found the original code, but this code was the only one of several, that didn't failed or freezed. I had to search for a bug that caused that there was never a Location Fix and I made the serial port configurable.
Let's say it is a beta version.
The source code you can find here, also a description how to install: https://github.com/joerg65/libGPS_TinkerBoard
Library V3:
gps.default.so.v3.zip (Size: 14.2 KB / Downloads: 101)
Library V4:
-with some fixes due to my Ublox8 based dongle
-enabled 4800 baud
gps.default.so.v4.zip (Size: 11.24 KB / Downloads: 173)
How to install:
-unpack the library
-open a terminal in the library folder and copy to TB
-check out the serial device by opening a adb shell and command dmesg after connection of the gps usb device
-create a gps.conf (change the port and baud rate to your needs)
-change permission temporary and restart the Android OS (not the TinerBoard) to check the gps messages
Change the permission permanently alternative 1 (SuperUser install-recovery-2.sh):
-remount system partition writeable from inside adb shell
-create the file 'install-recovery-2.sh' from inside adb shell
-reboot your TinkerBoard
Change the permission permanently alternative 2 (uevent.rk30board.rc):
To do this you'll need the tools rkflashtool and rkcrc. It can be checked out here: https://github.com/linux-rockchip/rkflashtool/issues and you need to compile it on your host pc.
To get into the bootloader for me the best method is to power the TB over the 40p header and boot with connected usb cable into the Android. Then you can open a adb connection over the usb cable, and then you can give command 'adb reboot bootloader'.
-read the boot.img (in a terminal on your host pc)
-unpack boot.img
-add the line to the uevent.rk30board.rc
-pack boot.img
-flash boot.img to TB
-reboot the TB
I would like to share this GPS library. I worked on it last time, but I was not yet able to test it in my car. I don't remember where I found the original code, but this code was the only one of several, that didn't failed or freezed. I had to search for a bug that caused that there was never a Location Fix and I made the serial port configurable.
Let's say it is a beta version.
The source code you can find here, also a description how to install: https://github.com/joerg65/libGPS_TinkerBoard
Library V3:
gps.default.so.v3.zip (Size: 14.2 KB / Downloads: 101)
Library V4:
-with some fixes due to my Ublox8 based dongle
-enabled 4800 baud
gps.default.so.v4.zip (Size: 11.24 KB / Downloads: 173)
How to install:
-unpack the library
-open a terminal in the library folder and copy to TB
Code:
adb root
adb remount
adb push gps.default.so /system/lib/hw/-check out the serial device by opening a adb shell and command dmesg after connection of the gps usb device
Code:
# dmesg
.
.
.
[ 1475.507432] usb 3-1.4: new full-speed USB device number 5 using usb20_host
[ 1475.606598] usb 3-1.4: New USB device found, idVendor=1546, idProduct=01a7
[ 1475.606624] usb 3-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1475.606631] usb 3-1.4: Product: u-blox 7 - GPS/GNSS Receiver
[ 1475.606644] usb 3-1.4: Manufacturer: u-blox AG - www.u-blox.com
[ 1475.613246] cdc_acm 3-1.4:1.0: ttyACM0: USB ACM device-create a gps.conf (change the port and baud rate to your needs)
Code:
(already in adb shell terminal)
# echo "'GPSPORT /dev/ttyACM0\nGPSSPEED 115200' > /system/etc/gps.conf"
(or from host pc)
adb shell echo "'GPSPORT /dev/ttyACM0\nGPSSPEED 115200' > /system/etc/gps.conf"-change permission temporary and restart the Android OS (not the TinerBoard) to check the gps messages
Code:
# chmod 666 /dev/ttyACM0
# am restart
# logcat | grep gpsChange the permission permanently alternative 1 (SuperUser install-recovery-2.sh):
-remount system partition writeable from inside adb shell
Code:
mount -o remount, rw /system-create the file 'install-recovery-2.sh' from inside adb shell
Code:
echo '#!/system/bin/sh' >> /system/etc/install-recovery-2.sh
echo 'chmod 666 /dev/ttyACM0' >> /system/etc/install-recovery-2.sh
chmod 755 /system/etc/install-recovery-2.sh-reboot your TinkerBoard
Change the permission permanently alternative 2 (uevent.rk30board.rc):
To do this you'll need the tools rkflashtool and rkcrc. It can be checked out here: https://github.com/linux-rockchip/rkflashtool/issues and you need to compile it on your host pc.
To get into the bootloader for me the best method is to power the TB over the 40p header and boot with connected usb cable into the Android. Then you can open a adb connection over the usb cable, and then you can give command 'adb reboot bootloader'.
-read the boot.img (in a terminal on your host pc)
Code:
cd /to/your/prefered/folder
adb reboot bootloader
sudo path/to/rkflashtool r boot >boot.img-unpack boot.img
Code:
dd if=boot.img of=boot.img.gz skip=8 bs=1 count=100000000000
gunzip boot.img.gz
mkdir unpacked
cd unpacked
cpio -i <../boot.img-add the line to the uevent.rk30board.rc
Code:
/dev/ttyACM0 0660 gps gps-pack boot.img
Code:
cd unpacked
find . | xargs -I file touch -d "1970-01-01 01:00" file
find . | cpio -o -H newc | gzip -n >../newboot.img.gz
cd ..
path/to/rkcrc -k newboot.img.gz newboot.img-flash boot.img to TB
Code:
sudo path/to/rkflashtool w boot <newboot.img-reboot the TB
Code:
sudo path/to/rkflashtool b


![[-]](https://tinkerboarding.co.uk/forum/images/collapse.png)